Files
Basalt/docs/objects/Object/onEvent.md
Robert Jelic 1d3e2018ef docs update
Updated some docs stuff
2022-10-09 12:05:30 +02:00

582 B

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 (on the left sidebar)

Here is a example on how to add a onEvent event to your frame:

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)