Sayomie550

Untitled

Jan 10th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. --[[
  2. Stab Bot 9000 V:1.0.1
  3. --Skeleton Edition--
  4. Slot 1 = Bows
  5. Slot 2 = Bones
  6. Slot 3 = Arrows
  7. --]]
  8. local stabbed = 0
  9. local arrows = 0
  10. local bones = 0
  11. local bows = 0
  12. local other = 0
  13.  
  14. while true do
  15.     function display()
  16.         term.clear()
  17.         term.setCursorPos(1,1)
  18.         print("Stab Bot 9000 V1.0.1")
  19.         print("------------------------------------")
  20.         print("Number of mobs stabbed: " ..stabbed)
  21.         print("Number of arrows gathered: " ..arrows)
  22.         print("Number of bones gathered: " ..bones)
  23.         print("Number of bows burnt: " ..bows)
  24.         print("Number of other items gathered: " ..other)
  25.         print("------------------------------------")
  26.     end
  27.    
  28.     function attack()
  29.         if turtle.attack() then
  30.             stabbed = stabbed + 1
  31.         end
  32.     end
  33.    
  34.     function gather()
  35.         turtle.suck()
  36.     end
  37.    
  38.     function deposit()
  39.         if turtle.getItemSpace(16) < 64 then
  40.             for inventory = 4, 16 do
  41.                 turtle.select(inventory)
  42.                 if turtle.compareTo(1) then
  43.                     turtle.dropDown()
  44.                     bows = bows + 1
  45.                 elseif turtle.compare(2) then
  46.                     turtle.dropUp()
  47.                     Bones = Bones + 1
  48.                 elseif turtle.compare(3) then
  49.                     turtle.turnRight()
  50.                     turtle.drop()
  51.                     arrows = arrows + 1
  52.                     turtle.turnLeft()
  53.                 else
  54.                     turtle.turnLeft()
  55.                     turtle.drop()
  56.                     other = other + 1
  57.                     turtle.turnRight()
  58.                 end
  59.             end
  60.         end
  61.     end
  62.    
  63.     sleep(.1)
  64.     display()
  65.     attack()
  66.     gather()
  67.     deposit()
  68. end
Advertisement
Add Comment
Please, Sign In to add comment