Difference between revisions of "Os.queueEvent"
From ComputerCraft Wiki
Line 4: | Line 4: | ||
|args=[[string]] eventName, param1, param2, param3 | |args=[[string]] eventName, param1, param2, param3 | ||
|api=os | |api=os | ||
− | |returns= | + | |returns= |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Adds an event <var>eventName</var> with the specified parameters to the event queue. | |desc=Adds an event <var>eventName</var> with the specified parameters to the event queue. |
Revision as of 08:36, 12 July 2012
Function os.queueEvent | |
Adds an event eventName with the specified parameters to the event queue. | |
Syntax | os.queueEvent(string eventName, param1, param2, param3) |
Returns | |
Part of | ComputerCraft |
API | os |
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 |