Sayomie550

Untitled

Jan 10th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 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.                     bows = bows + turtle.getItemCount(inventory)
  44.                     turtle.dropDown()
  45.                 elseif turtle.compareTo(2) then
  46.                     bones = bones + turtle.getItemCount(inventory)
  47.                     turtle.dropUp()
  48.                 elseif turtle.compareTo(3) then
  49.                     turtle.turnRight()
  50.                     arrows = arrows + turtle.getItemCount(inventory)
  51.                     turtle.drop()
  52.                     turtle.turnLeft()
  53.                 else
  54.                     turtle.turnLeft()
  55.                     other = other + turtle.getItemCount(inventory)
  56.                     turtle.drop()
  57.                     turtle.turnRight()
  58.                 end
  59.             end
  60.         end
  61.         turtle.select(4)
  62.     end
  63.    
  64.     sleep(.1)
  65.     display()
  66.     attack()
  67.     gather()
  68.     deposit()
  69. end
Advertisement
Add Comment
Please, Sign In to add comment