Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
electricessence authored Apr 23, 2018
1 parent 61466cb commit 4c5a8df
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ async function sendHelp()
{
rcon.connect();
// safe to immediately setup requests without waiting.
await rcon.send('help');
await rcon.send('/help');
rcon.disconnect();
}
sendHelp();
sendHelp().finally(()=>{
const errors = rcon.errors;
if(errors.length) console.warn("Errors:",errors);
});
```

or

```typescript
rcon
.session(async c=> {
return {
part1: await c.send('part1'),
part2: await c.send('part2')
}
})
.then(result=>
console.log(result));
.session(c=> c.send('/help'))
.then(
result=> console.log(result),
error=>console.error(error));
```

## Factorio
Expand All @@ -87,8 +87,4 @@ For usage or testing, make sure you are starting the game from command line or c

### Verifying It's Working:

```typescript
rcon
.session(c=> c.send('/help')) // As what is possible in the current state.
.then(result=> console.log(result));
```
Try either one of the examples above.

0 comments on commit 4c5a8df

Please sign in to comment.