Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = require("component")
- local r = require("robot")
- local inv = c.inventory_controller
- local whiteList = {
- 'exnihilo:dust',
- 'minecraft:dirt',
- 'minecraft:soul_sand',
- 'minecraft:gravel',
- 'minecraft:sand',
- 'exnihilo:exnihilo.gravel_nether',
- 'exnihilo:exnihilo.gravel_ender',
- 'minecraft:stone',
- 'TConstruct:slime.gel',
- 'ExtraItilities:cabblestone_compressed',
- 'excompressum:compressed_dust'
- }
- function check(ItemId)
- for _, v in pairs(whiteList) do
- if v == itemId then
- return true
- end
- end
- return false
- end
- function findItm()
- for i=1,r.inventorySize() do
- slot = inv.getStackInInternalSlot(i)
- if slot and check(inv.getStackInInternalSlot(i).name) then
- r.select(i)
- inv.equip()
- return
- end
- end
- end
- function main()
- while true do
- _,tools = r.durability()
- if tools == 'no tool equipped' then
- findItm()
- end
- for i=1,10 do
- r.use(3)
- os.sleep()
- end
- end
- end
- while true do
- Main()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement