Sayomie550

Untitled

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