Guest User

startup

a guest
Jun 4th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 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.  
  13.  
  14. while true do
  15.   x = rs.getInput("top")
  16.     if turtle.getItemCount(16) > 0 then
  17.     turtle.turnRight()
  18.     for n=2,16 do
  19.       turtle.select(n)
  20.       if turtle.compareTo(1) then
  21.         turtle.drop()
  22.       end
  23.     end
  24.     turtle.select(1)
  25.     turtle.drop(turtle.getItemCount(1)-1)
  26.     for n=2,16 do
  27.       turtle.select(n)
  28.       if not turtle.compareTo(1) then
  29.         turtle.drop()
  30.       end
  31.     end
  32.     turtle.select(1)
  33.     turtle.turnLeft()
  34.   end
  35.   turtle.attack()  
  36.   sleep(.1)
  37.   turtle.suck()  
  38.   sleep(.1)
  39. if x == true then
  40.   rs.setOutput("bottom",true)
  41.   sleep(.1)
  42.   rs.setOutput("bottom",false)
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment