Accidentally uploaded outdated 1.6 docs
This commit is contained in:
Robert Jelic
2023-05-01 16:28:46 +02:00
parent 92b93a3862
commit d4c72514ef
265 changed files with 25608 additions and 3867 deletions

View File

@@ -0,0 +1,22 @@
# Object - Event
## onEvent
`onEvent(self, event, ...)`
This event gets called on any other event. Some examples: http_success, disk, modem_message, paste, peripheral, redstone,...
You can find a full list here: [CC:Tweaked](https://tweaked.cc/) (on the left sidebar)
Here is a example on how to add a onEvent event to your frame:
```lua
local basalt = require("basalt")
local main = basalt.createFrame()
main:onEvent(function(event, side, channel, replyChannel, message, distance)
if(event=="modem_message")then
basalt.debug("Mesage received: "..tostring(message))
end
end)
```