Jump to content




Question from extremely old topic.


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

#1 gjalt14

  • New Members
  • 1 posts

Posted 23 January 2014 - 02:01 PM

i got a simple thing but it isnt worrking program code:
print("welcome wait for the door to open")
sleep(2)
("redset right true")
sleep(2)
("redset right false")
("shutdown")
and if I run the program I get a bios error:
bios:399: [string "startup"]:3: ambiguous syntax
(function call x new statement)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 23 January 2014 - 02:25 PM

Don't post completely unrelated questions in ancient topics, please. I've split this for you.

I'm not sure what magic you think parentheses and quotes around a string are supposed to perform, but if you want to run a program, you need to use shell.run. You can fix this code by putting shell.run at the start of those three lines, so they look like:

shell.run("shutdown")


#3 surferpup

  • Members
  • 286 posts
  • LocationUnited States

Posted 24 January 2014 - 12:08 AM

Specifically (although there are far better ways to do this), your program would be syntactically correct if it read:

print("welcome wait for the door to open")
os.sleep(2)
shell.run("redset right true")
sleep(2)
shell.run("redset right false")
shell.run("shutdown")

Lua expects a function when you wrote just ("redset right true"). When it saw your parentheses ( ), it assumed you had tried to run a function, it just didn't know which one. What you gave it was the arguments to an unnamed, undeclared function. So it got confused.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users