Sayomie550

Untitled

Jan 9th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. local stabbed = 0
  2. local slot = 0
  3.  
  4. while true do
  5.  
  6.     function display()
  7.         term.clear()
  8.         term.setCursorPos(1,1)
  9.         print("Stab Bot 9000 V1.0.0")
  10.         print("Number of mobs stabbed: " ..stabbed)
  11.     end
  12.    
  13.     function attack()
  14.         turtle.attack()
  15.         sleep(.1)
  16.         if turtle.attack() then
  17.             stabbed = stabbed + 1
  18.         end
  19.     end
  20.    
  21.     function gather()
  22.         turtle.suck()
  23.         sleep(.1)
  24.     end
  25.    
  26.     function deposit()
  27.         if turtle.getItemCount(16) < 1 then
  28.             turtle.turnRight()
  29.             sleep(1)
  30.             yield(1)
  31.             turtle.select(1)
  32.             slot = 1
  33.             while slot > 16 do
  34.                 turtle.drop()
  35.                 sleep(1)
  36.                 while turtle.drop(false) do
  37.                     display()
  38.                     print("Chest is full empty to continue stabbing")
  39.                     sleep(5)
  40.                 end
  41.                 slot = slot + 1
  42.             end
  43.             turtle.select(1)
  44.             turtle.turnLeft()
  45.         end
  46.     end
  47.    
  48.     --display()
  49.     --attack()
  50.     --gather()
  51.     deposit()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment