Sayomie550

Untitled

Jan 10th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 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("Number of mobs stabbed: " ..stabbed)
  15.         print("------------------------------------")
  16.     end
  17.    
  18.     function attack()
  19.         if turtle.attack() then
  20.             stabbed = stabbed + 1
  21.         end
  22.     end
  23.    
  24.     function gather()
  25.         turtle.suck()
  26.         sleep(.1)
  27.     end
  28.    
  29.     function deposit()
  30.                 if turtle.getItemSpace(16) < 64 then
  31.                         slot = 2
  32.                         while slot < 17 do
  33.                             turtle.select(slot)
  34.                             if turtle.compareTo(1) = true then
  35.                                 turtle.dropDown()
  36.                             else
  37.                                 if turtle.dropUp() = false then
  38.                                     display()
  39.                                     print("Top Chest is full")
  40.                                     if turtle.dropLeft() = false then
  41.                                         display()
  42.                                         print("Top and Left Chests is full")
  43.                                         while turtle.dropRight() = false do
  44.                                             display()
  45.                                             print("All chests are full")
  46.                                             print("Currently in standby mode")
  47.                                             print("empty chests to continue operation")
  48.                                         end
  49.                                     end
  50.                                 end
  51.                             end
  52.                             slot = slot + 1
  53.                             sleep(.1)
  54.                         end
  55.                         turtle.select(2)
  56.                 end
  57.         end
  58.    
  59.     sleep(.1)
  60.     display()
  61.     attack()
  62.     gather()
  63.     deposit()
  64. end
Advertisement
Add Comment
Please, Sign In to add comment