Advertisement
Sylvester228

robot-breakBlock OC

Mar 7th, 2022
1,183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. local robot_api = require("robot")
  2. local component = require("component")
  3. local term = require("term")
  4.  
  5. function robot_breakBlock()
  6.   robot_api.swing()
  7.   robot_api.dropDown()
  8. end  
  9.  
  10. function start()
  11.   term.clear()
  12.   print("---------- is working -------")
  13.   robot_api.select(1)
  14.   component.inventory_controller.equip()
  15.   item = component.inventory_controller.getStackInInternalSlot(1)
  16.  
  17.   if item == nil then
  18.     print("Нету в слоте для инструментов!")
  19.   end
  20.  
  21.   if item.name ~= "minecraft:diamond_pickaxe" then
  22.     print("Нету в слоте для иструментов Алмазной кирки!")
  23.   end
  24.  
  25.   component.inventory_controller.equip()
  26.  
  27.   while true do
  28.     robot_breakBlock()
  29.     os.sleep(5)
  30.   end
  31. end
  32.  
  33. start()    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement