Jump to content




bios:206: [string "startup"]:13: '=' expected


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

#1 rjqg327

  • New Members
  • 1 posts

Posted 28 June 2012 - 02:46 AM

i am running this code

function start()
print("password required to open")
a = read()
if a == "password" then
print ("accewss Granted")
rs.setOutput("right.true)
else
print ("access denied")
rs.setOutput("left", true)
sleep(3)
os.shutdown

end

what am i doing wrong? i gives me a bios:206: [string "startup"]:13: '=' expected when i start up please help!

#2 Bossman201

  • New Members
  • 92 posts

Posted 28 June 2012 - 03:06 AM

After formatting your code, your error wasn't hard to track down:
function start()
 print("password required to open")
 a = read()
 if a == "password" then
  print ("Access Granted") --Minor spelling error
  rs.setOutput("right", true) --Corrected code, unfinished string, nil function call: rs.setOutput("right", true). I did not even notice this until posting it in the forum, as the rest of the program became green. right.true is not a function, you put a period instead of a comma. Lastly, forgot to close the string, "right", by adding a quotation mark at the end.
 else
  print ("Access Denied") -- Capitalized words
  rs.setOutput("left", true)
  sleep(3)
  os.shutdown
 end --Forgot to close 'if' statement, or function. In short, you left out one 'end'.
end

Also, since you defined this as a function, you'll need to add:
start()
At the end of all the code to call the function or else after the computer starts up, it'll just go to the shell and not do anything.

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 28 June 2012 - 04:34 AM

os.shutdown() instead of os.shutdown.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users