Sayomie550

Untitled

Jan 10th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 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.         --]]
  26.         print(..stabbed " Mobs stabbed")
  27.         print(..arrows " Arrows gathered"
  28.         print(..bones " Bones gathered"
  29.         print(..bows " Bows burnt"
  30.         print(..other " Other items gathered"
  31.         print("------------------------------------")
  32.        
  33.        
  34.     end
  35.    
  36.     function attack()
  37.         if turtle.attack() then
  38.             stabbed = stabbed + 1
  39.         end
  40.     end
  41.    
  42.     function gather()
  43.         turtle.suck()
  44.     end
  45.    
  46.     function deposit()
  47.         if turtle.getItemSpace(16) < 64 then
  48.             for inventory = 4, 16 do
  49.                 turtle.select(inventory)
  50.                 if turtle.compareTo(1) then
  51.                     bows = bows + turtle.getItemCount(inventory)
  52.                     turtle.dropDown()
  53.                 elseif turtle.compareTo(2) then
  54.                     bones = bones + turtle.getItemCount(inventory)
  55.                     turtle.dropUp()
  56.                 elseif turtle.compareTo(3) then
  57.                     turtle.turnRight()
  58.                     arrows = arrows + turtle.getItemCount(inventory)
  59.                     turtle.drop()
  60.                     turtle.turnLeft()
  61.                 else
  62.                     turtle.turnLeft()
  63.                     other = other + turtle.getItemCount(inventory)
  64.                     turtle.drop()
  65.                     turtle.turnRight()
  66.                 end
  67.             end
  68.         end
  69.         turtle.select(4)
  70.     end
  71.    
  72.     sleep(.1)
  73.     display()
  74.     attack()
  75.     gather()
  76.     deposit()
  77. end
Advertisement
Add Comment
Please, Sign In to add comment