os.queueEvent
From ComputerCraft Wiki
Revision as of 08:33, 12 July 2012 by Pinkishu (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=os.queueEvent |args=string eventName, param1, param2, param3 |api=os |returns=? |addon=ComputerCraft |desc=Adds an event <var>eventNam...")
{{Function
|name=os.queueEvent |args=string eventName, param1, param2, param3 |api=os |returns=? |addon=ComputerCraft |desc=Adds an event eventName with the specified parameters to the event queue. |examples=
Example | |
The program adds an event which it will eventually pull. | |
Code |
function clear() term.clear() term.setCursorPos (1,1) end os.queueEvent("abc",2,"meow") while true do local event, param1 = os.pullEvent() if event == "abc" print("ABC EVENT! Parameters: " .. param1 .. " / " .. param2) else print("Event: " .. event ) end end |