Posted 23 June 2013 - 05:05 PM
hi i am making a program for a hotel me and friends have built but its not working right and im not sure why am i doing something wrong
ive put the code in the spoiler sorry its a bit long
ive put the code in the spoiler sorry its a bit long
Spoiler
diskSide = 'right'
bcaSide = "back"
bcbSide = "bottom"
room1 = redstone.testBundledInput(bcaSide, colors.white)
room2 = redstone.testBundledInput(bcaSide, colors.orange)
room3 = redstone.testBundledInput(bcaSide, colors.magenta)
room4 = redstone.testBundledInput(bcaSide, colors.yellow)
room5 = redstone.testBundledInput(bcaSide, colors.lime)
room6 = redstone.testBundledInput(bcaSide, colors.green)
roomempty = redstone.testBundledInput(bcaSide, colors.black)
print("Please insert your ticket into the machine")
print("and wait for it to load")
e = os.pullEvent('disk')
label = disk.getLabel(diskSide)
disk.eject(diskSide)
term.clear()
term.setCursorPos(1, 1)
if label == "Themepark Ticket Diamond" then
if roomempty == false then
print("Sorry all rooms are full")
print("Thank You for visiting the hotel")
sleep(3)
os.shutdown()
else
print("Your ticket includes a free room!")
print("would you like to book a room y/n")
inputd = read()
if inputd == "yes" or "y" then
term.clear()
term.setCursorPos(1, 1)
if room1 == true then
print("Room 1 is available")
end
if room2 == true then
print("Room 2 is available")
end
if room3 == true then
print("Room 3 is available")
end
if room4 == true then
print("Room 4 is available")
end
if room5 == true then
print("Room 5 is available")
end
if room6 == true then
print("Room 6 is available")
end
print("Please select a room...")
input = read()
if input == '1' or "room 1" or "Room 1" or "room1" or "Room1" then
rs.setBundledOutput(bcbSide, colors.white)
rs.setBundledOutput(bcaSide, colors.pink)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if input == '2' or "room 2" or "Room 2" or "room2" or "Room2" then
rs.setBundledOutput(bcbSide, colors.orange)
rs.setBundledOutput(bcaSide, colors.gray)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if input == '3' or "room 3" or "Room 3" or "room3" or "Room3" then
rs.setBundledOutput(bcbSide, colors.magenta)
rs.setBundledOutput(bcaSide, colors.cyan)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if input == '4' or "room 4" or "Room 4" or "room4" or "Room4" then
rs.setBundledOutput(bcbSide, colors.yellow)
rs.setBundledOutput(bcaSide, colors.purple)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if input == '5' or "room 5" or "Room 5" or "room5" or "Room5" then
rs.setBundledOutput(bcbSide, colors.lime)
rs.setBundledOutput(bcaSide, colors.blue)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if input == '6' or "room 6" or "Room 6" or "room6" or "Room6" then
rs.setBundledOutput(bcbSide, colors.blue)
rs.setBundledOutput(bcaSide, colors.red)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
print("Please wait while we prepare your room card")
e = os.pullEvent("redstone")
if rs.testBundledInput(bcbSide, colors.pink) == true then
term.clear()
term.setCursorPos(1, 1)
print("Your card has arrived")
print("Enjoy your stay")
sleep(3)
os.shutdown()
end
end
if inputd == "no" or "No" or "n" or "N" then
print("Thank you for visiting the hotel")
sleep(2)
os.shutdown()
end
end
else
print("Your ticket does not include a free")
if roomfull == false then
print("Sorry all rooms are full")
print("Thank You for visiting the hotel")
sleep(3)
os.shutdown()
else
print("would you like to book a room y/n")
print("for 1 gold ingot")
inputb = read()
if inputb == "Yes" or "yes" or "y" or "Y" then
print("Please insert one Gold Ingot")
print("into the card return shoot")
e = os.pullEvent("redstone")
if rs.testBundledInput(bcaSide, colors.brown) == true then
if room1 == true then
print("Room 1 is available")
end
if room2 == true then
print("Room 2 is available")
end
if room3 == true then
print("Room 3 is available")
end
if room4 == true then
print("Room 4 is available")
end
if room5 == true then
print("Room 5 is available")
end
if room6 == true then
print("Room 6 is available")
end
print("Please select a room...")
inputc = read()
if inputc == '1' or "room 1" or "Room 1" or "room1" or "Room1" then
rs.setBundledOutput(bcbSide, colors.white)
rs.setBundledOutput(bcaSide, colors.pink)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if inputc == '2' or "room 2" or "Room 2" or "room2" or "Room2" then
rs.setBundledOutput(bcbSide, colors.orange)
rs.setBundledOutput(bcaSide, colors.gray)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if inputc == '3' or "room 3" or "Room 3" or "room3" or "Room3" then
rs.setBundledOutput(bcbSide, colors.magenta)
rs.setBundledOutput(bcaSide, colors.cyan)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if inputc == '4' or "room 4" or "Room 4" or "room4" or "Room4" then
rs.setBundledOutput(bcbSide, colors.yellow)
rs.setBundledOutput(bcaSide, colors.purple)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if inputc == '5' or "room 5" or "Room 5" or "room5" or "Room5" then
rs.setBundledOutput(bcbSide, colors.lime)
rs.setBundledOutput(bcaSide, colors.blue)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
if inputc == '6' or "room 6" or "Room 6" or "room6" or "Room6" then
rs.setBundledOutput(bcbSide, colors.blue)
rs.setBundledOutput(bcaSide, colors.red)
sleep(1)
rs.setBundledOutput(bcbSide, 0)
rs.setBundledOutput(bcaSide, 0)
end
print("Please wait while we prepare your room card")
e = os.pullEvent("redstone")
if rs.testBundledInput(bcbSide, colors.pink) == true then
term.clear()
term.setCursorPos(1, 1)
print("Your card has arrived")
print("Enjoy your stay")
sleep(3)
os.shutdown()
end
end
if inputc == "no" or "No" or "N" or "n" then
print("Thank you for visiting the hotel")
sleep(2)
os.shutdown()
end
end
end
end
Edited by