Jump to content




[lua] [error] :35: <eof> expected

help

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

#1 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 26 July 2012 - 12:56 PM

So i have been trying to make a hotel, and i want a computer at each lvl to open the correct door, here is the code for first floor with rooms. But i get the error stated in the title. So i would like some help as this is my first "big" programming, my highest before this was 15. I'm sorry i forgot line jumps inbetween each part of code. Program is called context, beacuse this is my first time using this program to code.

It would be nice if you could spot any other error for me to :)/>

os.pullEvent = os.pullEventRaw
print("Loadning")
sleep(2)
print("----------------------")
print("Done loading")
print("Press E to continue")
local event, param = os.pullEvent("char")
param = "e"
if true then
print("Choose a number between 1-5")
write("Insert number:  ")
input = read()
end
door1  = "1"
door2 = "2"
door3 = "3"
door4 = "4"
door5 = "5"
yes = "yes"
no = "no"
if input == door1 then
print("1 is chosen")
print("Door is opening")
rs.setBundledOutput ("back", colors.red)
sleep(5)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end
elseif input == door2 then
print("2 is chosen")
print("Door is opening")
rs.setBundledOutput ("back", colors.yellow)
sleep(5)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end
elseif input == door3 then
print("3 is chosen")
print("Door is opening")
rs.setBundledOutput ("back", colors.blue)
sleep(5)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end
elseif input == door4 then
print("4 is chosen")
print("Door is opening")
rs.setBundledOutput ("back", colors.lime)
sleep(5)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end
elseif input == door5 then
print("5 is chosen")
print("Door is opening")
rs.setBundledOutput ("back", colors.black)
sleep(5)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end
else
print("Wrong door number, no door is opening!")
sleep(3)
print("Is this understood")
write("yes or no: ")
input = read()
if input == yes then
print("Remember to use correct room number next time")
sleep(3)
print("Door selector is restarting! This will take a few seconds")
sleep(2)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
elseif input == no then
print("I'll take it as a yes")
sleep(3)
print("Door selector is restarting! This will take a few seconds")
sleep(2)
term.clear()
term.setCursorPos(1,1)
shell.run(context)
end


#2 Watcher7

  • Members
  • 25 posts
  • LocationEquestria, TX

Posted 26 July 2012 - 01:40 PM

http://pastebin.com/Y9kxy062
M'kay so here's the deal, formatting is VERY important. I normally don't do this for people, but it's just formatting so there's the pastebin. But I didn't fix every-thing, I don't think I saw you define context, and I'm pretty sure shell.run takes a string, not plain-text/undefined-var.

#3 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 26 July 2012 - 01:42 PM

Thank you. I'll try the code :)/>

#4 BigSHinyToys

  • Members
  • 1,001 posts

Posted 26 July 2012 - 01:55 PM

So I have made some huge changes to your code If you have any problems please just ask i will be happy to explain
Spoiler
[EDIT]
looks like i was beat lol XD

#5 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 26 July 2012 - 05:21 PM

I've got code working now, thanks for you're help :)/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users