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)
Question from extremely old topic.
Started by gjalt14, Jan 23 2014 02:01 PM
2 replies to this topic
#1
Posted 23 January 2014 - 02:01 PM
#2
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:
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
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:
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.
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











