Advertisement
Wassaa

wither

Jul 11th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.12 KB | None | 0 0
  1. function refuel()
  2.     for i = 1, 16 do -- loop through the slots
  3.       turtle.select(i) -- change to the slot
  4.       turtle.refuel()
  5.     end
  6. end
  7.  
  8. function fillSand()
  9.     local spaceSand = turtle.getItemSpace(1)
  10.     SandC=peripheral.wrap("right")
  11.     SandC.condenseItems()
  12.     SandC.pushItemIntoSlot("south", 1, spaceSand, 1)
  13. end
  14.    
  15. function fillSkull()
  16.     local spaceSkull = turtle.getItemSpace(2)
  17.     SkullC=peripheral.wrap("back")
  18.     SkullC.condenseItems()
  19.     SkullC.pushItemIntoSlot("west", 1, spaceSkull, 2)
  20. end
  21.  
  22. function fillFuel()
  23.     local spaceFuel = turtle.getItemSpace(3)
  24.     FuelC=peripheral.wrap("bottom")
  25.     FuelC.condenseItems()
  26.     FuelC.pushItemIntoSlot("up", 1, spaceFuel, 3)
  27. end
  28.  
  29. function getSand()
  30.     turtle.select(1)
  31. end
  32.  
  33. function getSkull()
  34.     turtle.select(2)
  35. end
  36.  
  37. function findSignal()
  38.     local signalChest = peripheral.wrap("front")
  39.     if signalChest.getStackInSlot(1) ~= nil then
  40.         print ("got signal, time to work")
  41.         return true
  42.     else
  43.         print("no signal, keep looking")
  44.         return false
  45.     end
  46. end
  47.  
  48. function readySetGo()
  49.     local signal = redstone.getInput("left")
  50.     if signal ~= true and findSignal() then
  51.         print ("lets go!")
  52.         buildWither()
  53.     else
  54.         print ("wither already spawned")
  55.     end
  56. end
  57.  
  58. function buildWither()
  59.     fillSand()
  60.     fillSkull()
  61.     fillFuel()
  62.     refuel()
  63.     getSand()
  64.     turtle.up()
  65.     turtle.up()
  66.     turtle.up()
  67.     turtle.up()
  68.     turtle.forward()
  69.     turtle.forward()
  70.     turtle.forward()
  71.     turtle.down()
  72.     turtle.down()
  73.     turtle.forward()
  74.     turtle.forward()
  75.     turtle.forward()
  76.     turtle.placeDown()
  77.     turtle.turnLeft()
  78.     turtle.place()
  79.     turtle.turnLeft()
  80.     turtle.turnLeft()
  81.     turtle.place()
  82.     turtle.up()
  83.     turtle.placeDown()
  84.     getSkull()
  85.     turtle.place()
  86.     turtle.turnLeft()
  87.     turtle.turnLeft()
  88.     turtle.place()
  89.     turtle.up()
  90.     turtle.placeDown()
  91.     turtle.turnLeft()
  92.     turtle.forward()
  93.     turtle.down()
  94.     turtle.down()
  95.     turtle.forward()
  96.     turtle.forward()
  97.     turtle.up()
  98.     turtle.up()
  99.     turtle.forward()
  100.     turtle.forward()
  101.     turtle.forward()
  102.     turtle.turnLeft()
  103.     turtle.turnLeft()
  104.     turtle.down()
  105.     turtle.down()
  106.     turtle.down()
  107.     turtle.down()
  108.     print ("wither done")
  109.     os.sleep(10)
  110. end
  111.  
  112. while true do
  113.     readySetGo()
  114.     os.sleep(5)
  115. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement