Advertisement
Guest User

startup

a guest
Dec 20th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.57 KB | None | 0 0
  1. --Variablen & Startcommand
  2. local monitor = peripheral.wrap("right")
  3. local x,y = monitor.getSize()
  4. monitor.clear()
  5. monitor.setCursorPos(1,y/2)
  6.  
  7. --Functions
  8.  
  9. function mn()
  10.   monitor.setBackgroundColor(1)
  11.   monitor.setTextColor(32768)
  12. end
  13.  
  14. function reload()
  15.   sleep(0.2)
  16.   monitor.clear()
  17.   monitor.setCursorPos(1,y/2)
  18.   mn()
  19. end
  20.  
  21. function load()
  22.   monitor.write("Fireworksystem from PWE_AQG")
  23.   sleep(5)
  24.   monitor.clear()
  25.   monitor.setCursorPos(1,y/2)
  26.   mn()
  27.   monitor.write("Loading ....")
  28.   sleep(7)
  29.   monitor.clear()
  30.   monitor.setCursorPos(1,y/2)
  31.   mn()  
  32.     loading()
  33.     loading()
  34. end
  35.  
  36. function loading()
  37.   monitor.write("Loading |")
  38.   reload()
  39.   monitor.write("Loading /")
  40.   reload()
  41.   monitor.write("Loading -")
  42.   reload()
  43.   monitor.write("Loading %")
  44.   reload()
  45.   monitor.write("Loading |")
  46.   reload()
  47.   monitor.write("Loading /")
  48.   reload()
  49.   monitor.write("Loading -")
  50.   reload()
  51.   monitor.write("Loading %")
  52.   reload()
  53. end
  54.  
  55.   function shut()
  56.     redstone.setOutput("left", true)
  57.     sleep(0.2)
  58.     redstone.setOutput("left", false)
  59.     sleep(0.2)
  60.   end
  61.  
  62.    start = "start"
  63.    green = "green"
  64.    blue = "blue"
  65.    white = "white"
  66.    show = "show"
  67.  
  68. --Mainpart
  69. while (true) do
  70.   mn()
  71.   load()
  72.   monitor.write("Please go to the Maincomputer!")
  73.   print("Welcome! Please insert 'start' to Start and wait 10sek")
  74.   local input = read()
  75.     sleep(10)
  76.     monitor.clear()
  77.     monitor.setCursorPos(1,y/2)
  78.     mn()
  79.     if start == input then
  80.       print("Chose a color! (green/blue/white/show) and wait 10sek")
  81.         local input2 = read()
  82.         sleep(10)
  83.         if green == input2 then
  84.           monitor.setBackgroundColor(32)
  85.           monitor.setTextColor(256)
  86.           redstone.setOutput("top", true)
  87.           sleep(0.2)
  88.           redstone.setOutput("top", false)
  89.           print("Start in 15sek")
  90.           monitor.write("Start in 15sek with green")
  91.           sleep(15)
  92.           shut()
  93.           os.reboot()
  94.         end
  95.         if blue == input2 then
  96.           monitor.setBackgroundColor(2048)
  97.           monitor.setTextColor(128)
  98.           redstone.setOutput("back", true)
  99.           sleep(0.2)
  100.           redstone.setOutput("back", false)
  101.           print("Start in 15sek")
  102.           monitor.write("Start in 15sek with blue")
  103.           sleep(15)
  104.           shut()
  105.           os.reboot()
  106.         end
  107.         if white == input2 then
  108.           monitor.setBackground(1)
  109.           monitor.setTextColor(256)
  110.           redstone.setOutput("bottom", true)
  111.           sleep(0.2)
  112.           redstone.setOutput("bottom", false)
  113.           print("Start in 15sek")
  114.           monitor.write("Start in 15sek with white")
  115.           sleep(15)
  116.           shut()
  117.           os.reboot()
  118.         end
  119.         if show == input2 then
  120.           monitor.setBackgroundColor(16)
  121.           monitor.setTextColor(16384)
  122.           redstone.setOutput("top", true)
  123.           sleep(0.4)
  124.           redstone.setOutput("top", false)
  125.           redstone.setOutput("back", true)
  126.           sleep(0.6)
  127.           redstone.setOutput("back", false)
  128.           redstone.setOutput("bottom", true)
  129.           sleep(0.2)
  130.           redstone.setOutput("bottom", false)
  131.           print("Start in 15sek")
  132.           monitor.write("Start in 15 sek with Show")
  133.           sleep(15)
  134.           shut()
  135.           shut()
  136.           shut()
  137.           shut()
  138.           shut()
  139.           shut()
  140.           shut()
  141.           shut()
  142.           os.reboot()
  143.         end
  144.     else
  145.       mn()
  146.       print("Please write start to Begin!")
  147.       sleep(5)
  148.       os.reboot()
  149.     end  
  150. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement