Jump to content




bios:337: [string "startup"]:16: '<eof>' expected


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

#1 Stran

  • New Members
  • 1 posts
  • LocationLouisiana

Posted 29 May 2013 - 05:41 PM

I am getting the error

bios:337: [string "startup"]:16: '<eof>' expected

when i attempt to run my program. It is a program designed to require a password to open an iron door on Minecraft. The problem is when it gets to the end and it is supposed to reboot to repeat the program, the error above appears. Here is my code:

os.pullEvent = os.pullEventRaw
local side = "left"
local password = "Password" //Not real password, just a note
write "Password: "
local input == (password) then
term.clear()
write "Access Granted"
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
os.reboot()

else
term.clear()
write "Your Failure Saddens Me :(/>/>"
sleep(3)
os.shutdown()
end


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 May 2013 - 11:12 PM

Split into new topic.

You don't have an if statement, so how can you have an else or an end?

#3 Pyro_

  • Members
  • 39 posts
  • LocationAustralia

Posted 30 May 2013 - 08:23 AM

I think you missed a couple of lines around line 5, nonetheless I've refactored the code, and it should work like this.

http://pastebin.com/WrPkJxAe

#4 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 30 May 2013 - 09:39 AM

When running if statements, it needs to be in the following format, or it won't work:
if someCondition == someValue then
	--do first action
elseif someCondition == someOtherValue then
	--do another action
else
	--do action if not the same as anything above.
end
You can have as many elseif's as you want, but only one if or else. Of course, always remember to end your conditional statements.

#5 Hinds

  • Members
  • 25 posts
  • LocationMy house.

Posted 30 May 2013 - 10:33 AM

View PostPyro_, on 30 May 2013 - 08:23 AM, said:

I think you missed a couple of lines around line 5, nonetheless I've refactored the code, and it should work like this.

http://pastebin.com/WrPkJxAe

You might want to put an os.pullEvent = os.pullEventRaw somewhere there, stops the program being terminated.

#6 Pyro_

  • Members
  • 39 posts
  • LocationAustralia

Posted 30 May 2013 - 11:57 AM

View PostHinds, on 30 May 2013 - 10:33 AM, said:

View PostPyro_, on 30 May 2013 - 08:23 AM, said:

I think you missed a couple of lines around line 5, nonetheless I've refactored the code, and it should work like this.

http://pastebin.com/WrPkJxAe

You might want to put an os.pullEvent = os.pullEventRaw somewhere there, stops the program being terminated.

Hrm, I thought I forgot something, thanks for the reminder.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users