Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local atk=false
- local cycle=0
- local function dump()
- for i=1,16 do
- if(turtle.getItemCount(i)>0) then
- turtle.select(i)
- turtle.drop()
- end
- end
- turtle.select(1)
- end
- while true do
- if redstone.getInput("back") then
- if not atk then
- print("attacking")
- atk=true
- end
- for i=1,4 do turtle.attack() end
- cycle=cycle+1;
- cycle=cycle%8
- if(cycle ==0) then dump() end
- else
- if(atk) then
- print("sleeping")
- dump()
- atk=false
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement