MeXaN1cK

k

Aug 8th, 2016 (edited)
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local cmp = require("component")
  2. local inv = cmp.inventory_controller
  3. local r = require("robot")
  4. local s = require("sides")
  5.  
  6.  
  7.  
  8. function ch()
  9.     d = r.durability()
  10.     if d>=0.001 and d<0.03 then
  11.         inv.equip()
  12.         r.dropDown()
  13.         os.sleep(15)
  14.         r.turnLeft()
  15.         r.suck()
  16.         r.turnRight()
  17.         inv.equip()
  18.     end
  19. end
  20.  
  21. function ch_inv()
  22.     local slots = r.inventorySize()
  23.     local slot = inv.getStackInInternalSlot(slots)
  24.     if slot ~= nil then
  25.         if slot["size"] >= 32 then
  26.             for i=2, slots do
  27.                 r.select(i)
  28.                 r.dropUp()
  29.             end
  30.         end
  31.     end
  32.     r.select(1)
  33. end
  34.  
  35. while true do
  36.     ch()
  37.     for i=1,32 do
  38.         r.place()
  39.         r.swing()
  40.     end
  41.     ch_inv()
  42.     print(r.level())
  43. end
Add Comment
Please, Sign In to add comment