Posted 07 July 2012 - 06:56 PM
Hello..
I am trying to make program like this http://i.imgur.com/Sc0HT.png
Maybe you can tell your ideas how to make this program…
My idea - I have array of timers, and i start them for 15 sec … If i get in this time rednet signal for device then device timer reset and device state true… If i dont get rednet signal for 15 sec then i change state to false…
And my problem is… I cant get timer id :P/>/>
I am saving timers in array laiki
My code who dont work
Only this code dont work…
I think i get timer id in wrong way…
Sorry for my english…
I am trying to make program like this http://i.imgur.com/Sc0HT.png
Maybe you can tell your ideas how to make this program…
My idea - I have array of timers, and i start them for 15 sec … If i get in this time rednet signal for device then device timer reset and device state true… If i dont get rednet signal for 15 sec then i change state to false…
And my problem is… I cant get timer id :P/>/>
I am saving timers in array laiki
My code who dont work
os.startTimer(0.1)
while true do
local evt, arg = os.pullEvent()
term.setCursorPos(10,10)
if evt == "timer" then
ir=false
for i=1,n do
if laiki[i]==arg then
aktivs[i]="OFF"
ir=true
break
end
end
if ir==false then
break
end
else
break
end
end
Only this code dont work…
I think i get timer id in wrong way…
Sorry for my english…