MuChT007

BlazeFarm V0.1

Feb 28th, 2021 (edited)
251
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Variables--
  2.  
  3. local rsOut = 0
  4. local rsOutSide = "top"
  5. local traps = {colors.orange,colors.purple}
  6. local doors = {colors.lime,colors.black}
  7. local crusher = colors.yellow
  8.  
  9. --Functions--
  10.  
  11. function crush(seconds)
  12.     rsOut = colors.combine(rsOut, crusher )
  13.     redstone.setBundledOutput(rsOutSide, rsOut)
  14.     term.clear()
  15.     term.setCursorPos(1,1)
  16.     term.write("Crushing Blazes")
  17.     sleep (seconds)
  18.     rsOut = colors.subtract(colors.combine(rsOut), crusher)
  19.     redstone.setBundledOutput(rsOutSide, rsOut)
  20.     term.clear()
  21. end
  22.  
  23. --Init--
  24. rsOut = colors.combine(rsOut, traps[1])
  25. redstone.setBundledOutput(rsOutSide, rsOut)
  26.  
  27. while true do
  28.     event = os.pullEvent("redstone")
  29.     if rs.getInput("back")then
  30.         rsOut = colors.combine(rsOut, traps[2], doors[1], doors[2]) -- Closing the second trap and the door
  31.         redstone.setBundledOutput(rsOutSide, rsOut)
  32.         sleep (2)
  33.         rsOut = colors.subtract(colors.combine(rsOut), traps[1]) -- Opening the first trap
  34.         redstone.setBundledOutput(rsOutSide, rsOut)
  35.         sleep (10)
  36.         rsOut = colors.combine(rsOut, traps[1]) -- Closing the first trap
  37.         redstone.setBundledOutput(rsOutSide, rsOut)
  38.         sleep (2)
  39.         rsOut = colors.subtract(colors.combine(rsOut), traps[2]) -- Opening the second trap
  40.         redstone.setBundledOutput(rsOutSide, rsOut)
  41.         sleep (10)
  42.         rsOut = colors.combine(rsOut, traps[2]) -- Closing the second trap
  43.         redstone.setBundledOutput(rsOutSide, rsOut)
  44.         sleep (2)
  45.         crush(8,9)
  46.         sleep (2)
  47.         rsOut = colors.subtract(colors.combine(rsOut), doors[1]) -- Opening half of the door
  48.         redstone.setBundledOutput(rsOutSide, rsOut)
  49.         sleep (10)
  50.     end
  51.    
  52.     rsOut = 0
  53.     rsOut = colors.combine(rsOut, traps[1])
  54.     redstone.setBundledOutput(rsOutSide, rsOut)
  55. end
RAW Paste Data