Guest User

Fixed formating for you.

a guest
Jul 26th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.84 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. print( "Loading"                )
  3. sleep( 2                        )
  4. print( "----------------------" )
  5. print( "Done loading"           )
  6. print( "Press E to continue"    )
  7. local event, param = os.pullEvent( "char" )
  8. param = "e"
  9. if true then -- ....?
  10.     print( "Choose a number between 1-5" )
  11.     write( "Insert number:  "            )
  12.     input = read()
  13. end
  14. door1 = "1"
  15. door2 = "2"
  16. door3 = "3"
  17. door4 = "4"
  18. door5 = "5"
  19. -- yes = "yes" USELESS VARS
  20. -- no = "no"   <-----------
  21.  
  22. if input == door1 then
  23.     print( "1 is chosen"     )
  24.     print( "Door is opening" )
  25.     rs.setBundledOutput( "back", colors.red )
  26.     sleep( 5 )
  27.     term.clear()
  28.     term.setCursorPos( 1, 1 )
  29.     shell.run( context )
  30. -- end <- this "end" is not required till you are done using your elseifs and else, I have omited the rest.
  31.  
  32. elseif input == door2 then
  33.     print( "2 is chosen"     )
  34.     print( "Door is opening" )
  35.     rs.setBundledOutput ( "back", colors.yellow )
  36.     sleep( 5 )
  37.     term.clear()
  38.     term.setCursorPos( 1, 1 )
  39.     shell.run( context )
  40.  
  41. elseif input == door3 then
  42.     print( "3 is chosen"     )
  43.     print( "Door is opening" )
  44.     rs.setBundledOutput( "back", colors.blue )
  45.     sleep( 5 )
  46.     term.clear()
  47.     term.setCursorPos( 1, 1 )
  48.     shell.run( context )
  49.  
  50. elseif input == door4 then
  51.     print( "4 is chosen"     )
  52.     print( "Door is opening" )
  53.     rs.setBundledOutput( "back", colors.lime )
  54.     sleep( 5 )
  55.     term.clear()
  56.     term.setCursorPos( 1, 1 )
  57.     shell.run( context )
  58.  
  59. elseif input == door5 then
  60.     print( "5 is chosen"     )
  61.     print( "Door is opening" )
  62.     rs.setBundledOutput( "back", colors.black )
  63.     sleep( 5 )
  64.     term.clear()
  65.     term.setCursorPos( 1, 1 )
  66.     shell.run( context )
  67.  
  68. else
  69.     print( "Wrong door number, no door is opening!" )
  70.     sleep( 3                                        )
  71.     print( "Is this understood"                     )
  72.     write( "yes or no: "                            )
  73.     input = read()
  74.  
  75.     if input == "yes" then
  76.         print( "Remember to use correct room number next time"            )
  77.         sleep( 3                                                          )
  78.         print( "Door selector is restarting! This will take a few seconds")
  79.         sleep( 2                                                          )
  80.         term.clear()
  81.         term.setCursorPos( 1, 1 )
  82.         shell.run( context )
  83.  
  84.     elseif input == "no" then
  85.         print( "I'll take it as a yes"                                    )
  86.         sleep( 3                                                          )
  87.         print( "Door selector is restarting! This will take a few seconds")
  88.         sleep( 2                                                          )
  89.         term.clear()
  90.         term.setCursorPos( 1, 1 )
  91.         shell.run( context )
  92.     end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment