I need to know how to get this to work with multiple words for input.
if input ~= "Command 1" or "Command 2" or "Command 3" then
Something like that how do i correctly put that in?
I might post my code when I am finished.
Posted 20 September 2012 - 11:07 PM
Posted 20 September 2012 - 11:21 PM
Posted 20 September 2012 - 11:30 PM
if input ~= "command 1" or input ~= "command 2" or input ~= "command 3" then --you need to use the equations each time. --if you are wanting it to be neither of these, switch the "or" to "and"
Posted 20 September 2012 - 11:48 PM
Posted 20 September 2012 - 11:55 PM
Posted 20 September 2012 - 11:55 PM
Posted 20 September 2012 - 11:59 PM
Posted 21 September 2012 - 01:07 AM
Posted 21 September 2012 - 01:10 AM
term.clear()
term.setCursorPos(1,1)
print("COM API 1.0")
print("Available Commands")
print("Current List Unavailable")
write("Command: ")
input = read()
if input == "filter" then
shell.run "Filter_Prompt"
end
if input ~= "filter" or if input ~= "lights" or if input ~= "cancel" then
term.clear()
term.setCursorPos(1,1)
print ("Command Not Available")
end
Posted 21 September 2012 - 05:01 AM
if input ~= "filter" or input ~= "lights" or input ~= "cancel" then
term.clear()
term.setCursorPos(1,1)
print("COM API 1.0")
print("Available Commands")
print("Current List Unavailable")
write("Command: ")
input = read()
if input == "filter" then
shell.run "Filter_Prompt"
elseif input == "lights"
-- handle lights here
elseif input == "cancel" then
-- handle cancel here
else -- anything we're not expecting
term.clear()
term.setCursorPos(1,1)
print ("Command Not Available")
end
Posted 22 September 2012 - 04:18 PM
Posted 02 February 2013 - 07:52 AM
0 members, 1 guests, 0 anonymous users