MrDj200

witherTurtle

Mar 31st, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. local rednetSide    = "right"
  2. local soulSand      = 1
  3. local witherHead    = 2
  4. local wireSide      = "back"
  5. local block         = 16
  6. ------------------------------------
  7.  
  8. rednet.open(rednetSide)
  9.  
  10. function forward(a)
  11.     for i=a, 1, -1 do
  12.         turtle.forward()
  13.     end
  14. end
  15.  
  16. function up(a)
  17.     for i=a, 1, -1 do
  18.         turtle.up()
  19.     end
  20. end
  21.  
  22. function wither()
  23.     up(1)
  24.     turtle.select(block)
  25.     turtle.dig()
  26.     turtle.select(soulSand)
  27.     forward(5)
  28.     up(1)
  29.     turtle.placeDown()
  30.     up(1)
  31.     turtle.placeDown()
  32.     turtle.turnLeft()
  33.     forward(1)
  34.     turtle.placeDown()
  35.     turtle.back()
  36.     turtle.back()
  37.     turtle.placeDown()
  38.     forward(1)
  39.     turtle.select(witherHead)
  40.     turtle.place()
  41.     turtle.turnLeft()
  42.     turtle.turnLeft()
  43.     turtle.place()
  44.     turtle.turnLeft()
  45.     turtle.back()
  46.     turtle.place()
  47.     turtle.turnLeft()
  48.     turtle.turnLeft()
  49.     turtle.down()
  50.     turtle.down()
  51.     forward(4)
  52.     turtle.turnLeft()
  53.     turtle.turnLeft()
  54.     turtle.select(block)
  55.     turtle.place()
  56.     turtle.down()
  57. end
  58.  
  59. function suck()
  60.     turtle.turnLeft()
  61.     turtle.select(soulSand)
  62.     turtle.suck()
  63.     turtle.turnLeft()
  64.     turtle.turnLeft()
  65.     turtle.select(witherHead)
  66.     turtle.suck()
  67.     turtle.select(soulSand)
  68.     turtle.turnLeft()
  69. end
  70.  
  71. function kill()
  72.     rs.setBundledOutput(wireSide, 1)
  73.     sleep(1)
  74.     rs.setBundledOutput(wireSide, 0)
  75. end
  76.  
  77. while true do
  78.     id, msg=rednet.receive()
  79.     if msg == "go" then
  80.         suck()
  81.         wither()
  82.         sleep(10)
  83.         kill()
  84.     end
  85. end
Advertisement
Add Comment
Please, Sign In to add comment