Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Brain by dispeller
- -- A bunch of useful turtle functions
- -- Like turtle.refuel except eats all fuel in slot
- PowerUp = function(fuelSlotNum)
- if turtle.getFuelLevel() ~= turtle.getFuelLimit() then
- for i=1,turtle.getItemCount(fuelSlotNum) do
- if turtle.getFuelLevel() ~= turtle.getFuelLimit() then
- turtle.refuel(fuelSlotNum)
- end
- end
- end
- print('[BRAIN]:POWER AT '.. 100*(turtle.getFuelLevel()/turtle.getFuelLimit())..'%' )
- end
- -- Search through every slot for specified item
- GetItemSlot = function(name)
- local found = false
- for i=1,16 do
- if (not found) and (turtle.getItemDetail(i).name == name) then
- found = i
- end
- end
- return found
- end
- -- Loops through every slot and selects the specified item
- SelectItem = function(name)
- return turtle.select(GetItemSlot(name))
- end
- --------------------------------------------------------------
- -- QUARY
- SelectItem('minecraft:iron_pickaxe')
- turtle.equipLeft()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement