Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- print( "Loading" )
- sleep( 2 )
- print( "----------------------" )
- print( "Done loading" )
- print( "Press E to continue" )
- local event, param = os.pullEvent( "char" )
- param = "e"
- if true then -- ....?
- print( "Choose a number between 1-5" )
- write( "Insert number: " )
- input = read()
- end
- door1 = "1"
- door2 = "2"
- door3 = "3"
- door4 = "4"
- door5 = "5"
- -- yes = "yes" USELESS VARS
- -- no = "no" <-----------
- if input == door1 then
- print( "1 is chosen" )
- print( "Door is opening" )
- rs.setBundledOutput( "back", colors.red )
- sleep( 5 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- -- end <- this "end" is not required till you are done using your elseifs and else, I have omited the rest.
- elseif input == door2 then
- print( "2 is chosen" )
- print( "Door is opening" )
- rs.setBundledOutput ( "back", colors.yellow )
- sleep( 5 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- elseif input == door3 then
- print( "3 is chosen" )
- print( "Door is opening" )
- rs.setBundledOutput( "back", colors.blue )
- sleep( 5 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- elseif input == door4 then
- print( "4 is chosen" )
- print( "Door is opening" )
- rs.setBundledOutput( "back", colors.lime )
- sleep( 5 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- elseif input == door5 then
- print( "5 is chosen" )
- print( "Door is opening" )
- rs.setBundledOutput( "back", colors.black )
- sleep( 5 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- else
- print( "Wrong door number, no door is opening!" )
- sleep( 3 )
- print( "Is this understood" )
- write( "yes or no: " )
- input = read()
- if input == "yes" then
- print( "Remember to use correct room number next time" )
- sleep( 3 )
- print( "Door selector is restarting! This will take a few seconds")
- sleep( 2 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- elseif input == "no" then
- print( "I'll take it as a yes" )
- sleep( 3 )
- print( "Door selector is restarting! This will take a few seconds")
- sleep( 2 )
- term.clear()
- term.setCursorPos( 1, 1 )
- shell.run( context )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment