Sayomie550

Untitled

Jan 10th, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 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 chest()
  31.         if turtle.dropUp() then
  32.         else
  33.             turtle.dropRight()
  34.         end
  35.     end
  36.    
  37.     function deposit()
  38.                 if turtle.getItemSpace(16) < 64 then
  39.                         slot = 2
  40.                         while slot < 17 do
  41.                             turtle.select(slot)
  42.                             if turtle.compareTo(1) then
  43.                                 turtle.dropDown()
  44.                             else
  45.                                 chest()
  46.                             end
  47.                             slot = slot + 1
  48.                             sleep(.1)
  49.                         end
  50.                         turtle.select(2)
  51.                 end
  52.         end
  53.    
  54.     sleep(.1)
  55.     display()
  56.     attack()
  57.     gather()
  58.     deposit()
  59. end
Advertisement
Add Comment
Please, Sign In to add comment