Ok - so this code is for an entry door that remains locked until the player acknowledges all questions. The problem is as i am testing each phase either yes or no, to make sure it works alright.
Everything does, except for the first question: "Understand the rules?" If N is chosen, it restarts the program, rather than immediately going to the appropriate elseif line.
I absolutely have no idea whats wrong, as everything else works perfectly.
Heres the code: (EDITED: Colour coded each section)
while true do
term.clear()
term.setCursorPos(1, 1)
print("Welcome to the Aubi-Minecraft Hardcore Server")
print("****************************************************")
sleep(5)term.clear()
term.setCursorPos(1, 1)
print("Before you proceed")
print("please answer the following questions")
print("****************************************************")
sleep(5)
term.clear()
term.setCursorPos(1, 1)
This last end is apparently needed to close the "while" statement at the top.
Everything does, except for the first question: "Understand the rules?" If N is chosen, it restarts the program, rather than immediately going to the appropriate elseif line.
I absolutely have no idea whats wrong, as everything else works perfectly.
Heres the code: (EDITED: Colour coded each section)
while true do
term.clear()
term.setCursorPos(1, 1)
print("Welcome to the Aubi-Minecraft Hardcore Server")
print("****************************************************")
sleep(5)term.clear()
term.setCursorPos(1, 1)
print("Before you proceed")
print("please answer the following questions")
print("****************************************************")
sleep(5)
term.clear()
term.setCursorPos(1, 1)
- print("I hereby acknowledge that I have read and understood the server rules")
- print("**************************************************")
- sleep(5)
- print("Type Y or N")
- input = read()
- if input == "Y" then
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Do you understand the Sacrificial Tax Honour System?")
- print("*********************************************")
- sleep(5)
- print("Type Y or N")
- input = read()
- if input == "Y" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Please respect other players and their work")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("The Admins are always watching. BEHAVE or BE BANNED!")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Please wait while the system unlocks the door.")
- redstone.setOutput("left", true)
- print("LEAVE NOW")
- sleep(5)
- redstone.setOutput("left", false)
- elseif input == "N" then
- term.clear()
- term.setCursorPos(1, 1)
- print("In the event of your untimely demise through stupidity or laziness")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("the following process MUST occur without fail!")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Make your way to the Crimson Reflection, the diamond over the lava pit.")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter the diamond, and drop your item of highest value into the pit")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Head back to the Wall of Shame, and place a plaque with your name and item sacrificed.")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Do you understand? Type Y or N")
- input = read()
- if input == "Y" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Please respect other players and their work")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("The Admins are always watching. BEHAVE or BE BANNED!")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Please wait while the system unlocks the door.")
- redstone.setOutput("left", true)
- print("LEAVE NOW")
- sleep(5)
- redstone.setOutput("left", false)
- elseif input == "N" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Seriously? tough Shit. GAME ON!")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("You have 5 seconds to get through the door")
- redstone.setOutput("left", true)
- print("LEAVE NOW")
- sleep(5)
- redstone.setOutput("left", false)
- elseif input == "N" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Access Denied")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Please exit and read the server rules")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("If you don't know where they are , you don't belong here")
- sleep(5)
- term.clear()
- term.setCursorPos(1, 1)
- print("Goodbye.")
- sleep(5)
- os.shutdown()
- end
- end
- end
This last end is apparently needed to close the "while" statement at the top.