Smeany

Untitled

Sep 4th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local robot = require("robot")
  2. local sides = require("sides")
  3. local component = require("component")
  4. local inv = component.inventory_controller
  5. local rs = component.redstone
  6.  
  7. function swingTiCo(x)
  8.   for i=1, x do
  9.     os.sleep(0.05)
  10.     robot.swing()
  11.   end
  12. end
  13.  
  14. function swing(x)
  15.   for i=1, x do
  16.     rs.setOutput(sides.top, 255)
  17.     os.sleep(0.05)
  18.     rs.setOutput(sides.top, 0)
  19.     robot.swing()
  20.   end
  21. end
  22.  
  23. function reload()
  24.   inv.equip()
  25.   inv.dropIntoSlot(0, 1)
  26.   os.sleep(120)
  27.   inv.suckFromSlot(0, 1)
  28.   inv.equip()
  29. end
  30.  
  31. while true do
  32.   swing(1000)
  33.   reload()
  34. end
Add Comment
Please, Sign In to add comment