Xslymaster

CoDR

Jul 3rd, 2013
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.31 KB | None | 0 0
  1. -- Chest on Demand Revamped --
  2.  
  3. --Version information and legal stuff --
  4.  
  5. --[[ This is CoDR Version 0.4. This code is made by Zachary Knoblauch. You have the right to modify the code as you see fit. You cannot claim this code as your own.
  6. You may use this in your projects anyway you see fit. You may not re-upload this code.]]--
  7.  
  8.  
  9. -- local functions --
  10.  
  11. function roomFront()
  12.     rs.setOutput("right", true)
  13.     print("Please go to the front room and retreive or put your stuff in the chest.")
  14.     end
  15.  
  16. function roomBack()
  17.     rs.setOutput("left", true)
  18.     print("Please go to the back room and retreive or put your stuff in the chest.")
  19.     end
  20.  
  21. function roomStorage()
  22.     rs.setOutput("bottom", true)
  23.         print("Please go to the storage room and retreive or put your stuff away.")
  24.     end
  25.  
  26. function sendBack()
  27.  print("Select your choice")
  28.  sendbackBox()
  29.  local input = read()
  30.  while true do
  31.     sleep(0)
  32.     if input == "1" then
  33.         rs.setOutput("right", false)
  34.         sendbackBox()
  35.     elseif input == "2" then
  36.         rs.setOutput("left", false)
  37.         sendbackBox()
  38.     elseif input == "3" then
  39.         rs.setOutput("bottom", false)
  40.         sendbackBox()
  41.     end
  42. end
  43. end
  44.  
  45. function Quit()
  46.                 term.clear()
  47.                 term.setCursorPos(1,1)
  48.                 print("Thank you for using CoDR!")
  49.                 sleep(2)
  50.                 term.clear()
  51.                 os.reboot()
  52.             end
  53.  
  54.  
  55. function sendbackBox()
  56.  print("___________________________")
  57.  print("|Your choices             |")
  58.  print("| [1] Front Room = right  |")
  59.  print("| [2] Back Room = left    |")
  60.  print("| [3] Storage = down      |")
  61.  print("|_________________________|")
  62.  end
  63.  
  64. function printLogo()
  65.     term.clear()
  66.     term.setCursorPos(1,1)
  67.     term.setTextColor(colors.lime)
  68.     print(" ____,  ____,  ____,  ____, ")
  69.     print("(-/    (-/  \\ (-|  \\ (-|__) ")
  70.     print(" _\\__,  _\\__/, _|__/  _|  \\,")
  71.     print("(      (      (      (      ")
  72.     term.setTextColor(colors.white)
  73.     end
  74.  
  75. function printBox()
  76.     term.clear()
  77.     term.setCursorPos(1,1)
  78.     print("_____________________________________________")
  79.     print("|Please Select a room to send the chest to  |")
  80.     print("| [1] Front Room = right                    |")
  81.     print("|                                           |")
  82.     print("| [2] Back Room = left                      |")
  83.     print("|                                           |")
  84.     print("| [3] Storage = down                        |")
  85.     print("|                                           |")
  86.     print("| [4] Send Back                             |")
  87.                 print("|                                           |")
  88.     print("| [5] Quit                                  |")
  89.     print("|___________________________________________|")
  90.  end
  91.  
  92. -- Code --
  93.  
  94.  
  95. printLogo()
  96. sleep(1)
  97. print("Welcome to CoDR or Chest on Demand Revamped")
  98. sleep(2)
  99. term.clear()
  100. printBox()
  101. local input = read()
  102. while true do
  103.     sleep(0)
  104.     if input == "1" then
  105.         roomFront()
  106.                                 local input = read()
  107.         printBox()
  108.     elseif input == "2" then
  109.         roomBack()
  110.                                 local input = read()
  111.         printBox()
  112.     elseif input == "3" then
  113.         roomStorage()
  114.                                 local input = read()
  115.         printBox()
  116.     elseif input == "4" then
  117.         sendBack()
  118.                 elseif input == "5" then
  119.                                 Quit()
  120.     end
  121. end
Advertisement
Add Comment
Please, Sign In to add comment