Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 95 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Trivial INSTEAD interpreter for developers.

## Build and run
## Build

Dependencies: luajit (or lua), iconv.

```
```bash
$ git clone https://github.com/instead-hub/instead-cli.git
$ cd instead-cli
$ git submodule init
Expand All @@ -19,23 +19,23 @@ $ ./instead-cli

System wide setup:

Edit Makefile.defs.
Edit `Makefile.defs`.

```
```bash
DESTDIR=/
BIN=/usr/local/bin
STEADPATH=/usr/local/share/instead-cli/
```

Then:

```
```bash
$ make && sudo make install
```

### 9front (Plan9) build

```
```bash
% git/clone https://github.com/instead-hub/instead-cli.git
% mk init
% mk
Expand All @@ -44,29 +44,101 @@ $ make && sudo make install

## Run

```bash
./instead-cli <gamedir path>
```

To pass internal command to STEAD use `/` prefix. Some internal commands:

* `/act 1` (or just `1`) — interact with object in room (if object has `tak` field, it is activated; otherwise, `act` field (if defined) is activated)

```bash
$ instead-cli fantasy-game
Room

The lever(1) on the wall is raised.

> /act 1
The lever(1) on the wall is lowered.

> 1
The lever(1) on the wall is raised.

>
```

* `/use 1 2` (or just `1,2`) — use item from inventory on another item of inventory or object in room

```bash
$ instead-cli apple-game
Room

The apple(1) is lying on the floor. The table(2) stands in the
corner.

> 1
/I take the apple./

The table(1) stands in the corner.

** Apple(2)

> 2,1
The table(1) stands in the corner. The apple(2) lies on the table.

>
```

* `/go 1` (or just `1`)

```bash
$ instead-cli game/
Room

The lever(1) on the wall is raised.

>

>> Kitchen(2)

> /go 2
Kitchen

The apple(1) is lying on the floor. The table(2) stands in the
corner.

>

>> Room(3)

> 3
Room

The lever(1) on the wall is raised.

To pass internal command to STEAD use '/' prefix. Some internal commands:
>> Kitchen(2)
```

* /save filename
* /load filename
* /quit
* /inv
* /look
* `/way` (or just empty line) — return list of ways from current room
* `/inv` (or just empty line) — return items in the inventory
* `/look` — return the description of the current room
* `/save filename`
* `/load filename`
* `/quit`

Options:

* -d - debug mode;
* -dfile - debug mode + write stderr to file;
* -wnum - line width is num symbols (70 by default);
* -iscript - read script line by line and use it as commands;
* -lfile - write all input commands to file;
* -cpCODEPAGE - Win only (1251 by default), use 65001 for UTF-8;
* -a - autosave on exit and autoload on start (autosave file);
* -x - execute lua script;
* -e - echo input command;
* -m - enable multimedia output;
* -mcmd - enable run cmd on multimedia. Examples: -m/usr/bin/xdg-open (Linux), -m/bin/plumb (Plan9), -m"start\"\"" (Windows).
* `-d` - debug mode;
* `-dfile` - debug mode + write stderr to file;
* `-wnum` - line width is num symbols (70 by default);
* `-iscript` - read script line by line and use it as commands;
* `-lfile` - write all input commands to file;
* `-cpCODEPAGE` - Win only (1251 by default), use 65001 for UTF-8;
* `-a` - autosave on exit and autoload on start (autosave file);
* `-x` - execute lua script;
* `-e` - echo input command;
* `-m` - enable multimedia output;
* `-mcmd` - enable run cmd on multimedia. Examples: `-m/usr/bin/xdg-open` (Linux), `-m/bin/plumb` (Plan9), `-m"start\"\""` (Windows).

## Links

Expand Down