This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
WolfsRainESP's profile picture

Help in advanced programing

Started by WolfsRainESP, 02 April 2012 - 08:59 AM
WolfsRainESP #1
Posted 02 April 2012 - 10:59 AM
Ok hello guys i started this post for ask the more advanced people smart and advanced things to do with CC mod, so i will start posting if someone can help me to understand to use the events, i know them all, "char", "redstone" and more but i dont know when or how to use the os.pullEvent() and for whats for, also i want to add that im spanish and my English its a bit bad, sorry for my English have a nice day or nights and please reply me. Thanks and bye!
Neuis #2
Posted 02 April 2012 - 01:03 PM
Type in a Computer "help events". You became a list of events with Name and Arguments. (My English is bad too, because i'm german)
virtualayu #3
Posted 08 April 2012 - 04:20 AM
using events in you code will pause your program until an "event" (key press, change redstone status…) with that you can ask a question and your program will continue after the user respond to that question

in example you can ask if they wan't to open a door, and test if the key is "Y" so open it or if it's "N" don't do anything ….
kamnxt #4
Posted 08 April 2012 - 11:25 AM

event, var1, var2, var3 = os.pullEvent()
event: the name of the event ("redstone","key" or something else)
var1-var3: the values returned.
You can also use os.pullEvent(eventType) where eventType is "redstone", "key" or something else to choose what types of events it will wait for.