Sayomie550

Untitled

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