4 posts
Posted 03 December 2012 - 05:35 AM
ok im having a problem where im getting the following error in lua scripting bios:206: [string "ok"]:15 'end' expected (to close 'if' at line 9)
so im wondering if you know how to fix it because he is the coding that im using
http://pastebin.com/BzdYpJ5kwhich i call the scrip ok
and my startup scrip is
print ("welcome")
shell.run("ok")
which is working fine so is there any suggestions on how to get my script to work
318 posts
Location
Somewhere on the planet called earth
Posted 03 December 2012 - 05:37 AM
In lua if statements require an end.
if this == that then
DoThat()
elseif this == dat then
DoDat()
else
DoWhatEver()
end
4 posts
Posted 03 December 2012 - 06:06 AM
ok i updated my script but now i get a close 'if' at line five i updated the pastebin so its still the same link to the updated scrip
so any help would be appretiated :)/>
818 posts
Posted 03 December 2012 - 06:14 AM
elseif is 1 word ;)/>
And if you want to set something to a string you use "" or '', so yogscast = yogscast would be yogscast = "yogscast"
4 posts
Posted 03 December 2012 - 06:31 AM
ok i updated the script again but it for some resone it isnt waiting for an input so do you no how to get it to wait for an input
818 posts
Posted 03 December 2012 - 06:33 AM
yogscast = "yogscast"
close = "close"
print ("jrabba_co.os")
print ("please enter password")
input = read("*")
if input == yogscast then
print ("correct password")
shell.run("yogscast")
elseif input == close then
print ("ok")
shell.run("close")
else
print ("incorrect password")
sleep(2)
os.shutdown()
end
4 posts
Posted 03 December 2012 - 06:50 AM
thank you it works