This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Stran's profile picture

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

Started by Stran, 29 May 2013 - 04:41 PM
Stran #1
Posted 29 May 2013 - 06: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
Lyqyd #2
Posted 30 May 2013 - 12:12 AM
Split into new topic.

You don't have an if statement, so how can you have an else or an end?
Pyro_ #3
Posted 30 May 2013 - 09: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
Cranium #4
Posted 30 May 2013 - 10: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.
Hinds #5
Posted 30 May 2013 - 11:33 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

You might want to put an os.pullEvent = os.pullEventRaw somewhere there, stops the program being terminated.
Pyro_ #6
Posted 30 May 2013 - 12:57 PM
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.