Advertisement
PhilHibbs

cc_turtle_fight

Jan 28th, 2013
8,722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1. -- ****************************************************************************
  2. -- **                                                                        **
  3. -- **                                FIGHT                                   **
  4. -- **                                                                        **
  5. -- **  Attacks in front                                                      **
  6. -- **  Collects loot                                                         **
  7. -- **  Drops loot that matches Slot 1 into the chest on the left             **
  8. -- **  Drops loot that does not match Slot 1 into the chest on the right     **
  9. -- **                                                                        **
  10. -- ****************************************************************************
  11.  
  12. while true do
  13.   if turtle.getItemCount(16) > 0 then
  14.     turtle.turnLeft()
  15.     for n=2,16 do
  16.       turtle.select(n)
  17.       if turtle.compareTo(1) then
  18.         turtle.drop()
  19.       end
  20.     end
  21.     turtle.select(1)
  22.     turtle.drop(turtle.getItemCount(1)-1)
  23.     turtle.turnLeft()
  24.     turtle.turnLeft()
  25.     for n=2,16 do
  26.       turtle.select(n)
  27.       if not turtle.compareTo(1) then
  28.         turtle.drop()
  29.       end
  30.     end
  31.     turtle.select(1)
  32.     turtle.turnLeft()
  33.   end
  34.   turtle.attack()  
  35.   sleep(.1)
  36.   turtle.suck()  
  37.   sleep(.1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement