Advertisement
Romanok2805

kill.lua

Sep 17th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1.  
  2. local r = require("robot")
  3. local inv = require("component").inventory_controller
  4. local sizeInventory = r.inventorySize()
  5.  
  6. while true do
  7.   if r.count(sizeInventory) == 0 and r.count(sizeInventory - 1) == 0 and r.count(sizeInventory - 2) == 0 and r.count(sizeInventory - 3) == 0 then
  8.     local i = 0
  9.     repeat
  10.       if r.swing() then
  11.         i = i + 1
  12.       end
  13.     until i ~= 100
  14.   else
  15.     for i = 1, sizeInventory do
  16.       r.select(i)
  17.       if r.count() ~= 0 then
  18.         local item = inv.getStackInInternalSlot().name
  19.         if item == "minecraft:skull" or item == "minecraft:coal" then
  20.           r.dropUp()
  21.         else
  22.           r.dropDown()
  23.         end
  24.       end
  25.     end
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement