Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Attack Turtle V0.1 by QQII
- --Functions
- local function clearSlot(slotNumber) --Attemps to clear the slot slotNumber
- turtle.select(slotNumber)
- if turtle.getItemCount(slotNumber) ~= 0 then
- if not turtle.dropDown() then
- print("ERROR: failure to clear slot number " .. slotNumber)
- end
- end
- end
- local function clearSlots() --Places all the items into the chest under the turtle
- for i = 1,16 do
- if turtle.getItemCount(i) ~= 0 then
- clearSlot(i)
- end
- end
- end
- --User Inputs
- print("The turtle will attack mobs above it.")
- print("It will place items in an inventory below it.")
- --Main Script
- while true do
- while not turtle.attackUp() do
- clearSlots()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement