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

Home Core

Started by _XD_XD_XD_, 03 September 2012 - 03:19 PM
_XD_XD_XD_ #1
Posted 03 September 2012 - 05:19 PM
Hi, I have spent hours looking for my mistake in this 'Home Core' program I am writing, and I still cant find it!

It says :

bios:206: [string "startup"]:19: 'eof' expected

and here is the code :


fs.delete("startup")
fs.copy("disk/startup", "startup")
print ("Welcome To The Core")
print ("-----------------------------------")
print ("Lights")
print ("To access lighting menu type : 'Lighting'")
sleep(3)
print (" ")
print ("Energy")
print ("To access energy menu type : 'Energy'")
sleep(3)
print (" ")
print ("Self Destruct")
print ("To activate self desruct sequence type : 'Boom'")
input = read()
elseif input == ("Lighting") then
print ("Lighting")
print ("-----------------------------------")
print (" ")
print ("To turn lights on type : 'On'")
print ("To turn lights off type : 'Off'")
print ("To return to previous menu type : 'Exit'")
light = read()
elseif light == "On" then
rs.setOutput("back", true)
elseif light == "on" then
rs.setOutput("back", true)
elseif light == "Off" then
rs.setOutput ("back", false)
elseif light == ("off") then
rs.setOutput ("back", false)
elseif light == "Exit" then
shell.run "startup"
end
elseif input == ("Energy") then
print ("Energy")
print ("-----------------------------------")
print (" ")
print ("To turn energy generation on on type : 'On'")
print ("To turn energy generation off type : 'Off'")
print ("To return to previous menu type : 'Exit'")
en = read()
elseif en == "On" then
rs.setOutput("left", true)
elseif en == "on" then
rs.setOutput("left", true)
elseif en == "Off" then
rs.setOutput ("left", false)
elseif en == ("off") then
rs.setOutput ("left", false)
elseif en == "Exit" then
shell.run "startup"
end
elseif input == ("Boom") then
print ("Self Destruct")
print ("-----------------------------------")
print (" ")
print ("To accept total annialation on on type : 'Ok'")
print ("To stop total annialation type : 'No'")
print ("To return to previous menu type : Exit")
pop = read()
if pop == "Ok" then
rs.setOutput("right", true)
elseif pop == "No" then
shell.run "startup"
elseif pop == "Exit" then
shell.run "startup"
end
end

Many thanks to anyone who can help

_XD_XD_XD_
Kazimir #2
Posted 03 September 2012 - 05:21 PM
"elseif" should not stand before the "if"
_XD_XD_XD_ #3
Posted 03 September 2012 - 05:35 PM
"elseif" should not stand before the "if"

Thanks, there was some more code before that before and I must have missed that when re-writing thanks alot

_XD_XD_XD_