bigbadtom

Fill Wither

Oct 17th, 2021 (edited)
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.69 KB | None | 0 0
  1. local wither_item_count = ""
  2. local modem = peripheral.wrap("right")
  3. modem.open(1)
  4. print("modem open?")
  5. while true do
  6. turtle.select(1)
  7. local fuel_level = turtle.getFuelLevel()
  8.  
  9. if fuel_level < 1000 then
  10.     turtle.select(16)
  11.     while fuel_level < 1000 do
  12.     modem.transmit(1,1,"fuel level is below limit please put coal into slot 16 ${fuel_limit}")
  13.     turtle.refuel()
  14.     fuel_level = turtle.getFuelLevel()
  15.     end
  16. end
  17. turtle.turnLeft()
  18.  
  19.  turtle.suck(3)    
  20. wither_item_count = turtle.getItemCount(1)
  21. print(wither_item_count)
  22.  
  23. if wither_item_count < 3 then
  24.     modem.transmit(1,1, "there are not enough wither Skulls")
  25.     while wither_item_count < 3 do
  26.     turtle.suck(1)
  27.     wither_item_count = turtle.getItemCount(1)
  28.     end
  29. end
  30.    
  31. modem.transmit(1,1,"everything is going to plan i've got the skulls")    
  32.  
  33. --Grabbed skulls turning to soulsand chest
  34. turtle.turnRight()
  35. turtle.turnRight()
  36.  
  37. --Facing soulsand chest
  38. turtle.suck(4)
  39. soulsand_item_count = turtle.getItemCount(2)
  40. if soulsand_item_count < 4 then
  41.     modem.transmit(1,1, "There is not enough soul sand")
  42.         while soulsand_item_count < 4 do
  43.         turtle.suck(1)
  44.         soulsand_item_count = turtle.getItemCount(2)
  45.         end
  46. end
  47.        
  48. --collected the soul sand and facing forwards        
  49. modem.transmit(1,1,"everything is going to plan i've got the soulsand")
  50. turtle.turnLeft()
  51.  
  52. --time to move down to spawner
  53. modem.transmit(1,1,"trying to move to spawner")
  54. turtle.forward()
  55. turtle.forward()
  56.    
  57. local y = 0
  58.     while y < 65 do
  59.     turtle.down()
  60.     y = y + 1
  61.     end
  62. turtle.turnRight()
  63. local forward = 0
  64.     while forward < 23 do
  65.     turtle.forward()
  66.     forward = forward + 1
  67.     end
  68. turtle.turnLeft()
  69. turtle.forward()
  70. turtle.forward()
  71. turtle.forward()
  72. turtle.forward()
  73. modem.transmit(1,1,"made it to the skull chest")
  74. turtle.turnLeft()
  75. turtle.select(1)
  76. turtle.drop()
  77. modem.transmit(1,1,"dropped off Skulls")
  78. turtle.turnRight()
  79. turtle.forward()
  80. turtle.forward()
  81. turtle.turnLeft()
  82. modem.transmit(1,1,"made it to the soulsand chest")
  83. turtle.select(2)
  84. turtle.drop()
  85. modem.transmit(1,1,"dropped off soulsand")
  86. turtle.turnRight()
  87. modem.transmit(1,1,"returning to base")
  88. turtle.forward()
  89. turtle.turnLeft()
  90.  
  91. local forward2 = 0
  92.     while forward2 < 23 do
  93.     turtle.forward()
  94.     forward2 = forward2 + 1
  95.     end
  96. turtle.turnLeft()
  97. local forward3 = 0
  98.     while forward3 < 7 do
  99.     turtle.forward()
  100.     forward3 = forward3 + 1
  101.     end
  102. local up = 0
  103.     while up < 65 do
  104.     turtle.up()
  105.     up = up + 1
  106.     end
  107. turtle.forward()
  108. turtle.forward()
  109. turtle.turnLeft()
  110. turtle.turnLeft()
  111. turtle.select(1)
  112. modem.transmit(1,1,"i'm back and ready for more work")
  113.        
  114.    
  115. end
Add Comment
Please, Sign In to add comment