1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 19:50:31 +00:00

Update event docs (#1304)

This commit is contained in:
ouroborus 2023-01-17 13:17:47 -08:00 committed by GitHub
parent 9e1de23f4a
commit 67244b17af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,7 @@ The @{computer_command} event is fired when the `/computercraft queue` command i
## Return Values ## Return Values
1. @{string}: The event name. 1. @{string}: The event name.
... @{string}: The arguments passed to the command. 2. @{string}<abbr title="Variable number of arguments">&hellip;</abbr>: The arguments passed to the command.
## Example ## Example
Prints the contents of messages sent: Prints the contents of messages sent:

View File

@ -4,6 +4,9 @@ module: [kind=event] redstone
The @{event!redstone} event is fired whenever any redstone inputs on the computer change. The @{event!redstone} event is fired whenever any redstone inputs on the computer change.
## Return values
1. @{string}: The event name.
## Example ## Example
Prints a message when a redstone input changes: Prints a message when a redstone input changes:
```lua ```lua

View File

@ -10,7 +10,7 @@ The @{task_complete} event is fired when an asynchronous task completes. This is
2. @{number}: The ID of the task that completed. 2. @{number}: The ID of the task that completed.
3. @{boolean}: Whether the command succeeded. 3. @{boolean}: Whether the command succeeded.
4. @{string}: If the command failed, an error message explaining the failure. (This is not present if the command succeeded.) 4. @{string}: If the command failed, an error message explaining the failure. (This is not present if the command succeeded.)
...: Any parameters returned from the command. 5. <abbr title="Variable number of arguments">&hellip;</abbr>: Any parameters returned from the command.
## Example ## Example
Prints the results of an asynchronous command: Prints the results of an asynchronous command:

View File

@ -9,6 +9,9 @@ The @{term_resize} event is fired when the main terminal is resized. For instanc
When this event fires, some parts of the terminal may have been moved or deleted. Simple terminal programs (those When this event fires, some parts of the terminal may have been moved or deleted. Simple terminal programs (those
not using @{term.setCursorPos}) can ignore this event, but more complex GUI programs should redraw the entire screen. not using @{term.setCursorPos}) can ignore this event, but more complex GUI programs should redraw the entire screen.
## Return values
1. @{string}: The event name.
## Example ## Example
Print a message each time the terminal is resized. Print a message each time the terminal is resized.

View File

@ -8,6 +8,9 @@ This event is normally handled by @{os.pullEvent}, and will not be returned. How
@{terminate} will be sent even when a filter is provided to @{os.pullEventRaw}. When using @{os.pullEventRaw} with a filter, make sure to check that the event is not @{terminate}. @{terminate} will be sent even when a filter is provided to @{os.pullEventRaw}. When using @{os.pullEventRaw} with a filter, make sure to check that the event is not @{terminate}.
## Return values
1. @{string}: The event name.
## Example ## Example
Prints a message when Ctrl-T is held: Prints a message when Ctrl-T is held:
```lua ```lua

View File

@ -4,6 +4,9 @@ module: [kind=event] turtle_inventory
The @{turtle_inventory} event is fired when a turtle's inventory is changed. The @{turtle_inventory} event is fired when a turtle's inventory is changed.
## Return values
1. @{string}: The event name.
## Example ## Example
Prints a message when the inventory is changed: Prints a message when the inventory is changed:
```lua ```lua