Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikaoto committed Apr 3, 2018
1 parent 5c2ac84 commit 7b7aa9a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,22 @@ Queues a function for execution at index `i`

```lua
deep.queue(100, print, "Hello")
-- or
deep.queue(100, function() print("Hello") end)
```

Arguments:
* `i` `(number)` - The index of the action, must be positive.
* `fun` `(function)` - An anonymous or named function
* `...` `(*)` - The arguments of the passed named function

### Two ways to queue actions
1. Using anonymous functions:
```lua
deep.queue(400, function() hit(iron, 100) end)
```
Usage:

2. Using named functions:
```lua
deep.queue(400, hit, iron, 100)
```
* With anonymous functions: `deep.queue(400, function() hit(iron, 100) end)`

* With named functions: `deep.queue(400, hit, iron, 100))`

#### Queuing multiple actions
Simply use an anonymous function:
* With multiple functions:
```lua
deep.queue(1, function()
print("Hello")
Expand Down

0 comments on commit 7b7aa9a

Please sign in to comment.