Posted 25 October 2012 - 12:55 PM
So I made this menu for my cafe on a server, this is the first thing that I have coded in Lua. But I keep on getting an error I don't understand, and even the CC pro on my server couldn't fix it. Could you guys possibly help me? Here is my code:
The error I'm getting is:
term.clear()
term.setCursorPos(1,1)
print("Welcome to El Cafe Uno!")
print("Here are all of our wonderful products that we offer!")
print("Please type the name of the item to view information and prices.")
term.setCursorPos(1,5)
print("Drinks:")
term.setCursorPos(1,7)
print("Coffee")
print("Milk")
print("Juice")
print("Water")
print("Hot Water")
print("Rum")
print("Beer")
term.setCursorPos(1,14)
print("Food:")
term.setCursorPos(1,18)
print("Cookies")
print("Bread")
print("Honey Bread")
term.setCursorPos(1,22)
print("Please input an item from our menu above:")
term.setCursorPos(1,24)
input = read()
if input == "Coffee" then
term.clear()
term.setCursorPos(1,1)
print("Our coffee is brewed daily in our brewery downstairs, our coffee beans are grown with love.")
print("Price: 2 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Milk" then
term.clear()
term.setCursorPos(1,1)
print("We get our milk fresh from cows trapped in the basement, with love of course!")
print("Price: 2 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Juice" then
term.clear()
term.setCursorPos(1,1)
print("Our juice is made fresh daily. We use apples from tree farms, mexican plantations, and trashcans!")
print("Price: 4 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Water" then
term.clear()
term.setCursorPos(1,1)
print("It's water, what could go wrong?")
print("Price: 1 Iron Nugget")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Hot Water" then
term.clear()
term.setCursorPos(1,1)
print("It's actually just lava from underground pools, but you don't need to know that.")
print("Price: 4 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Rum" then
term.clear()
term.setCursorPos(1,1)
print("Yarr Matey! Captain Porkchop gives our rum two hooks up!")
print("Price: 5 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Beer" then
term.clear()
term.setCursorPos(1,1)
print("It gets you drunk!")
print("Price: 8 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Cookies" then
term.clear()
term.setCursorPos(1,1)
print("These individual cakes of yum are perfect with coffee.")
print("Price: 1 Iron Nugget")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Bread" then
term.clear()
term.setCursorPos(1,1)
print("It's your standard, run of the mill bread.")
print("Price: 2 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else if input == "Honey Bread" then
term.clear()
term.setCursorPos(1,1)
print("Dis some fancy shit right here.")
print("Price: 10 Iron Nuggets")
sleep(10)
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
else
print("Please check your spelling and try again.")
sleep(1)
print("Reloading menu....")
sleep(4)
shell.run("startup")
end
The error I'm getting is:
bios:206: [string "startup"]:137: 'end' expected (to close 'if' at line 111)