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

Need help with timing: [string "fireworks"]:10: '=' expected

Started by subzero22, 13 March 2013 - 02:43 AM
subzero22 #1
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:

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
Lyqyd #2
Posted 13 March 2013 - 03:51 AM
Split into new topic.

You capitalized `while true do` (making it While), which doesn't work. Lua is case-sensitive. Change it back to a lower-case "w".
subzero22 #3
Posted 13 March 2013 - 04:55 AM
Thanks it worked. Now I'm getting same thing for line 14 for the redpulse. Will try to figure it out.

edit: ok finally got it working. I guess redpulse has to be in a shell.run