but can you me explain the event, why i don't need the variable declare?
The "event" variable ends up pointing to a
table, which is basically a collection of data. All the data returned by os.pullEvent() goes into that table.
So if you do this:
local myEvent = {os.pullEvent()}
… then if the event that comes back is a monitor touch, then the table will look like this:
myEvent[1] = "monitor_touch"
myEvent[2] = side of the monitor
myEvent[3] = x position of the touch
myEvent[4] = y position of the touch
… but if the event is a timer, then it will look like this:
myEvent[1] = "timer"
myEvent[2] = id number of the timer
… and if the event is a Stargate state change, it might look like this:
myEvent[1] = "sgStargateStateChange"
myEvent[2] = source
myEvent[3] = new state
myEvent[4] = old state
The wiki page for os.pullEvent() shows you the layout for all events you might encounter in vanilla ComputerCraft.
i have an other question, is it possible one position with two different aktion? ehm..example, pos 1 = open door, pos 1 = close door ?
Sorry, not quite sure what you mean by this. Can you show an example of how you think you might code it?