Guest User

Untitled

a guest
Feb 27th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local p = peripheral.wrap("left")
  2. local ent = rs.getInput("bottom")
  3. local entColors = { colors.purple, colors.green, colors.brown, colors.blue, colors.red, colors.cyan, colors.lightgrey, colors.grey, colors.pink }
  4. local killCount = 1
  5. local panic = false
  6.  
  7. local function engage()
  8.    while not panic do
  9.    os.pullEvent("redstone")
  10.       while rs.getInput("back") == true do
  11.          rs.setOutput("top", true)
  12.          local function mobloop()
  13.             if killCount == 1 then
  14.                p.setBundledOutput(entColors[killCount])
  15.                killCount = + 1
  16.             end
  17.          end
  18.       end
  19.    end
  20. end
  21.  
  22. local function reset()
  23.    while true do
  24.    os.pullEvent("redstone")
  25.       while rs.getInput("right") == true do
  26.          panic = true
  27.       end
  28.    end
  29. end
  30.  
  31. while true do
  32.    parallel.waitForAny(engage, reset)
  33.    if panic then
  34.       rs.setOutput("top", false)
  35.       os.reboot()
  36.    end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment