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

help!

Started by mrcrocodile123, 02 September 2012 - 07:52 PM
mrcrocodile123 #1
Posted 02 September 2012 - 09:52 PM
i have tried to make a menu for one of my computers but get the error 'bios:206: [string "go"]:4: ')' expected

i am new to this and have no idea what this means…

code is posted below, any help is appreciated !!! thank you!


while x ~= "exit" do
print("——————————")
print("MAIN MENU")
print("To access the lighting menu interface enter "lights" ")
print("to access the generator menu interface enter "generators" ")
print("——————————")
x=io.read()
if x = "lights" then
while y ~= "exit" do
print("——————————")
print("LIGHTING MENU")
print("To turn on the lighting system enter "on" ")
print("To turn off the lighting system enter "off" ")
print("To return to the Main Menu enter "exit" ")
print("——————————")
y=io.read()
if y = "on" then
rednet.open("left")
rednet.send(13, "lights on")
rednet.close("left")
end
end
end
Magus #2
Posted 02 September 2012 - 10:19 PM
if you want to use " in a string you either escape them like this

someString = "this is a string with a "quote" "

or use ' to define it


someString = ' another string with a "quote" '
mrcrocodile123 #3
Posted 02 September 2012 - 10:24 PM
Thank you!