Sayomie550

Untitled

Jan 10th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 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("------------------------------------")
  15.         print("Number of mobs stabbed: " ..stabbed)
  16.         print("------------------------------------")
  17.     end
  18.    
  19.     function attack()
  20.         if turtle.attack() then
  21.             stabbed = stabbed + 1
  22.         end
  23.     end
  24.    
  25.     function gather()
  26.         turtle.suck()
  27.         sleep(.1)
  28.     end
  29.    
  30.     function deposit()
  31.                 if turtle.getItemSpace(16) < 64 then
  32.                         slot = 2
  33.                         while slot < 17 do
  34.                             turtle.select(slot)
  35.                             if turtle.compareTo(1) then
  36.                                 turtle.dropDown()
  37.                             else
  38.                                 turtle.dropUp()
  39.                             end
  40.                             slot = slot + 1
  41.                             sleep(.1)
  42.                         end
  43.                         turtle.select(2)
  44.                 end
  45.         end
  46.    
  47.     sleep(.1)
  48.     display()
  49.     attack()
  50.     gather()
  51.     deposit()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment