Advertisement
Guest User

comparetoCobbleAndDrop.lua

a guest
Feb 22nd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local robot = require("robot")
  2.  
  3. function invHelper.selectItemInInventory(item)
  4.   local flag = false
  5.   for i=1, 16, 1 do
  6.     if invHelper.getItemName(i) == item then
  7.       r.select(i)
  8.       flag = true
  9.       break
  10.     end
  11.   end
  12.   return flag
  13. end
  14.  
  15.  
  16. for i = 2,32,1 do
  17. robot.select(i)
  18.  
  19. invHelper.selectItemInInventory("minecraft:cobblestone")
  20. if robot.compareTo(1) == true then
  21.   robot.drop()
  22. end
  23.  
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement