Advertisement
VADemon

Simple attacker

Dec 3rd, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. chestDir = "dropDown" -- drop down into e.g. a chest
  2. print("Simple grinder turtle is working!")
  3.  
  4. function drop_all_items()
  5.     for i = 1, 15 do
  6.         if turtle.getItemCount(i)~=0 then
  7.             turtle.select(i)
  8.             turtle[chestDir]()
  9.         end
  10.     end
  11.    
  12.     turtle.select(1)
  13. end
  14.  
  15.  
  16. while true do -- always run the lines below
  17.     turtle.attack()
  18.     if turtle.getItemCount( 1 ) > 0 then
  19.         drop_all_items()
  20.     end
  21.  
  22.     sleep(.1) -- we are performance-friendly, the turtle waits for 0.1 second
  23. end -- end of loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement