emagiannu

WitherBoss Farm

Jul 16th, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. local side = "front"
  2.  
  3. local pSSDelay = 12 --PLACE SOUL SAND
  4. local pWSDelay = 3 --PLACE WITHER SKULLS
  5. local dWSDelay = 60 --DESTROY WITHER SKULLS
  6. local oDBDelay = 10 --OPEN DRAWBRIDEGES
  7.  
  8. local function reset()
  9.   print("Resetting")
  10.   rs.setOutput(side, false)
  11.   redstone.setBundledOutput(side, 0)
  12. end
  13.  
  14. local function pow(n)
  15.   if n == 0 then
  16.     return 1
  17.   elseif n == 1 then
  18.     return 2
  19.   else
  20.     return 2 * pow(n - 1)
  21.   end
  22. end
  23.  
  24. local function placeSoulSand()
  25.   print("Placing Soul Sand")
  26.   rs.setBundledOutput(side, pow(0))
  27.   sleep(pSSDelay)
  28.   reset()
  29. end
  30.  
  31. local function placeWitherSkulls()
  32.   print("Placing Wither Skulls")
  33.   rs.setBundledOutput(side , pow(1))
  34.   sleep(pWSDelay)
  35.   reset()
  36. end
  37.  
  38. local function destroyWitherSkulls()
  39.   print("Destroying Wither Skulls")
  40.   rs.setBundledOutput(side , pow(2))
  41.   sleep(dWSDelay)
  42.   reset()
  43. end
  44.  
  45. local function openDrawbridges() --REMEBER NOT GATE!!!
  46.   print("Opening Floor")
  47.   rs.setBundledOutput(side , pow(3))
  48.   sleep(oDBDelay)
  49.   reset()
  50. end
  51.  
  52.  
  53. --MAIN
  54. while true do
  55.   reset()
  56.   sleep(2)
  57.   print("Ready")
  58.   local event = os.pullEvent("redstone")
  59.   placeSoulSand()
  60.   placeWitherSkulls()
  61.   destroyWitherSkulls()
  62.   openDrawbridges()
  63.   print("Waiting 60 seconds")
  64.   sleep(58)
  65. end
Advertisement
Add Comment
Please, Sign In to add comment