I am trying to make a startup code for a multi function defence system, which i have not finished, but every time i try to launch it on my advanced terminal, i get <eof> error on line 46... why?
shell.run("clear")
print("Welcome to MoRBiiD's cannon control terminal!")
sleep(5)
print("What is your command?")
print("arm, deactivate") -- No deactivation yet...
local input = read()
if (input) == ("arm") then
shell.run("clear")
print("Loading...")
sleep(2)
shell.run("clear")
print("Fire, arrow or tnt?") -- No TNT yet...
local input = read()
if (input) == ("fire") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.red)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end
elseif (input) == ("arrow") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.white)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end
end -- <eof> expected?
sleep(2)
shell.run("startup")
Why is this error popping up?
Started by MoRBiiD Legacy, Apr 09 2015 08:56 PM
3 replies to this topic
#1
Posted 09 April 2015 - 08:56 PM
#2
Posted 09 April 2015 - 09:00 PM
<eof> expected means you have too many ends somewhere in your code. Proper indentation can reveal this:
Also, I'd take a look at textutils.slowPrint
shell.run("clear")
print("Welcome to MoRBiiD's cannon control terminal!")
sleep(5)
print("What is your command?")
print("arm, deactivate") -- No deactivation yet...
local input = read()
if (input) == ("arm") then
shell.run("clear")
print("Loading...")
sleep(2)
shell.run("clear")
print("Fire, arrow or tnt?") -- No TNT yet...
local input = read()
if (input) == ("fire") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.red)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end --#here
elseif (input) == ("arrow") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.white)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end
end -- <eof> expected?
sleep(2)
shell.run("startup")
Also, I'd take a look at textutils.slowPrint
#3
Posted 09 April 2015 - 09:07 PM
KingofGamesYami, on 09 April 2015 - 09:00 PM, said:
<eof> expected means you have too many ends somewhere in your code. Proper indentation can reveal this:
Also, I'd take a look at textutils.slowPrint
shell.run("clear")
print("Welcome to MoRBiiD's cannon control terminal!")
sleep(5)
print("What is your command?")
print("arm, deactivate") -- No deactivation yet...
local input = read()
if (input) == ("arm") then
shell.run("clear")
print("Loading...")
sleep(2)
shell.run("clear")
print("Fire, arrow or tnt?") -- No TNT yet...
local input = read()
if (input) == ("fire") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.red)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end --#here
elseif (input) == ("arrow") then
shell.run("clear")
print(".")
sleep(1)
shell.run("clear")
print("..")
sleep(1)
shell.run("clear")
print("...")
sleep(1)
shell.run("clear")
redstone.setBundledOutput("back", colors.white)
sleep(1)
redstone.setBundledOutput("back", 0)
print("Done.")
end
end -- <eof> expected?
sleep(2)
shell.run("startup")
Also, I'd take a look at textutils.slowPrint
thx it worked! i didnt think the problem was that i had too many "end"s but that i needed another (end of function EXPECTED) Now to blow up my friend's house >
Edited by GAMR DUD3, 09 April 2015 - 09:12 PM.
#4
Posted 09 April 2015 - 10:27 PM
eof stands for end of file (if there are too many ends, it'll do something like '<eof> expected').
Edited by KingofGamesYami, 09 April 2015 - 10:28 PM.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











