– Items on sale + GUI
term.clear()
term.setCursorPos(18,1)
write("PRICE CALCULATOR")
term.setCursorPos(1,2)
write("—————————————————")
term.setCursorPos(2,3)
write("Items on sale: :")
term.setCursorPos(1,4)
print("1) Computer :")
print("2) Turtle :")
print("3) Monitor :")
print("4) Printer :")
print("5) Modem :")
print("6) Mine/fell Turtle :")
print("7) Fight/Shov Turtle :")
print("8) Farming Turtle :")
print("9) Advanced Comp :")
print("10) Advanced Mon :")
– Choice 1
term.setCursorPos(24,3)
print("Pick Items By Number.")
term.setCursorPos(24,4)
item = read()
if item == ("1"or"2"or"3"or"4"or"5"or"6"or"7"or"8"or"9") then
term.setCursorPos(24,4)
print("Quantity:")
term.setCursorPos(33,4)
end
if item ~= ("1"or"2"or"3"or"4"or"5"or"6"or"7"or"8"or"9") then
term.setCursorPos(27,4)
print("Invalid Option.")
sleep(1)
os.reboot()
end
– quantity
quantity = read()
if quantity == "1"or"2"or"3"or"4"or"5"or"6"or"7"or"8"or"9"or"10"
then term.setCursorPos(24,5)
print("Anything else? yes/no")
end
if quantity ~= "1"or"2"or"3"or"4"or"5"or"6"or"7"or"8"or"9"or"10"
then term.setCursorPos(33,4)
print("Invalid Option")
sleep(1)
os.reboot()
end
The problem is when i input "1" in the first step to select the computer, it brings up the next step with is the quantity but the only answer that works for quantity is the number "1". anything else will display incorrect option as well as anything else yes/no. can anyone help me fix this error? i cant continue the code for the other items without this bug being fixed! (if you can find a way to shorten my code that would be a huge help too!), (the final product should be able to pick a number of products with each having a price and adding them to have a final price and knowing what you owe people. thought i would share the idea :D/>)