Jump to content




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


  • You cannot reply to this topic
2 replies to this topic

#1 subzero22

  • Members
  • 97 posts

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


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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".

#3 subzero22

  • Members
  • 97 posts

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





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users