Posted 13 March 2013 - 03:43 AM
First all I'd like to say hi as I'm new here and couldn't find an area for new people to introduce themselves lol.
Well anyway I just started messing arround with computer craft and have been reading a lot on lua in the wiki and other places to.
I'm trying to get this code to work but it comes up with an error that I can't figure out what to do with. There were 2 other errors before it that I was able to fix but this one stumps me.
The idea of the code is once night comes it will start a firework show.
The error I get is:
bios:338: [string "fireworks"]:10: '=' expected
here's my code:
Well anyway I just started messing arround with computer craft and have been reading a lot on lua in the wiki and other places to.
I'm trying to get this code to work but it comes up with an error that I can't figure out what to do with. There were 2 other errors before it that I was able to fix but this one stumps me.
The idea of the code is once night comes it will start a firework show.
The error I get is:
bios:338: [string "fireworks"]:10: '=' expected
here's my code:
local side = "right"
local alarm
if os.time() >= 00 then
rs.setOutput(side, false)
alarm = os.setAlarm(12)
else
rs.setOutput(side, true)
alarm = os.setAlarm(12)
end
While true do
local evt, arg = os.pullEvent("alarm")
local i = 1
repeat
redpulse right 1
os.sleep(15)
i = i + 1
until i == 20
if arg == alarm then
os.setalarm()
end
end