Results 1 to 15 of 15

Thread: Chicken Fighter

  1. #1
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Chicken Fighter

    Here is my first script. It finds and fights a chicken, waits for 5 seconds and then looks for all feathers and bones on the ground and buries the bones. It works, but it is slow and inefficient. I will add stuff like antirandoms and progress reports and try to make it act less stupid later. Please post any comments and suggestions.

    EDIT: Forgot to mention, all the multiplayer code came straight from the_rs_monkey's woodcutting tutorial. Thanks for the great tutorial!

    SCAR Code:
    ////////////////////////////////////////////////////////////////////////////////
    //                            ChickenFighter.scar                             //
    ////////////////////////////////////////////////////////////////////////////////
    //  - Kills chickens                                                          //
    //  - Picks up feathers                                                       //
    //  - Picks up and buries bones                                               //
    //                                                                            //
    //  Instructions:                                                             //
    //    1. Drag crosshairs to client                                            //
    //    2. Pick a color on the chickens and edit the script variables           //
    //    3. Enter the number of players and information for each                 //
    ////////////////////////////////////////////////////////////////////////////////

    program ChickenFighter;

    // SRL Includes
    {.include SRL/SRL.scar}

    const
      ChickenColor = 6326691;         // Color of chicken to look for
      FeatherColor = 9737377;         // Color of feather to look for
      BoneColor = 12435141;           // Color of bone to look for
      KillsPerPlayer = 50;            // Number of chickens killed before switching
      WaitTime = 5000;                // Time to wait before attacking a new chicken

    var
      BoneDTM : Integer;
     
    // Shows title
    procedure ShowTitle;
    begin
      writeln('    ===========================================================');
      writeln('      __                           ___                         ');
      writeln('     /   |    *    |              |    *      |     |          ');
      writeln('    |    | _     _ |   _  | _     |__     __  | _  -+-  _  | _ ');
      writeln('    |    |/ \ | /  |/ /_\ |/ \    |    | /  \ |/ \  |  /_\ |/ \');
      writeln('     \__ |  | | \_ |\ \_  |  |    |    | \__| |  |  |  \_  |   ');
      writeln('                                            |                  ');
      writeln('        -Version 1.0-    By ElPolloFeo    \_/                  ');
      writeln('    ===========================================================');
    end;

    // Set up the players
    procedure DeclarePlayers;
    begin
      NumberOfPlayers(2);
      CurrentPlayer := 0;
     
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
     
      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := True;
    end;

    // Find all of the feathers on the ground
    procedure FindFeathers;
    var
      x, y : Integer;
    begin
      Flag;
      repeat
        if not FindObj(x, y, 'eather', FeatherColor, 0) then Exit;
        Mouse(x, y, 0, 0, True);
        Flag;
      until (False);
    end;

    // Find all of the bones on the ground and bury them
    procedure FindBones;
    var
      x, y : Integer;
      FoundAllBones : Boolean;
    begin
      Flag;
      FoundAllBones := False;
      repeat
        if not FindObj(x, y, 'ones', BoneColor, 0) then FoundAllBones := True;
        if not FoundAllBones then Mouse(x, y, 0, 0, True);
        Flag;
      until (FoundAllBones);
      repeat
        if not FindDTM(BoneDTM, x, y, 540, 180, 750, 480) then Exit;
        Mouse(x, y, 3, 3, True);
        Wait(2000);
      until (False);
    end;

    // Kill a chicken
    procedure KillChicken;
    var
      x, y : Integer;
    begin
      repeat
        Wait(100);
      until FindObj(x, y, 'hicken', ChickenColor, 0);
      Mouse(x, y, 1, 1, True);
      Wait(WaitTime);
    end;

    // Main program
    begin
      ShowTitle;
      SetupSRL;
      DeclarePlayers;
      if LoggedIn then Logout;
      LoginPlayer;
      BoneDTM := DTMFromString('78DA63CC616260E0606440067B366F626005D' +
           '23051C62CA01A465435CB66CD4455930E54C389AA664E5F1FAA9A' +
           '12A01A2E54352BE7CD4555538EE91E137D7D5435A94035CCA86A4' +
           '0B2286AF2806AD850D594E764A3AAC904AA11C46DCE7F20000065' +
           '0B1167');
      // Main Loop
      repeat
        KillChicken;
        FindFeathers;
        FindBones;
        Inc(Players[CurrentPlayer].Banked);
        if Players[CurrentPlayer].Banked mod KillsPerPlayer = 0 then
        begin
          NextPlayer(True);
        end;
        if not LoggedIn then NextPlayer(False);
      until False;
    end.

  2. #2
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    i like it looks good for first =) simple and nice but, get anti-BAN dawg!

  3. #3
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i like ur findobj's there all good and as p1nky said,... anti banns and randomsd r key so add them and maby some more failsafes and i can see u becoming good

    spaz

  4. #4
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the suggestions. I'll get working on antirandoms and antibans soon. Spaztaz666, failsafes are just code that makes sure the script is doing the right thing and won't freeze on doing something wrong, right?

    BTW I tried to follow the standards as much as possible, does anybody see anything wrong with it?

  5. #5
    Join Date
    Nov 2007
    Location
    Butte, Montana
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Seems to work great, only problem i saw was it being a tad slow and it didnt seem to get bones/feathers very often. i haven't ran it for a very long time. 10 mins maybe so maybe i should keep running it and see how well it does over a few hours with multiple players. good script though good work

  6. #6
    Join Date
    Nov 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice script.

  7. #7
    Join Date
    Sep 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cant locate the chicken

  8. #8
    Join Date
    Sep 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ooops never mind sorry guys
    forgot to pick the colors

    ran script for few min and detects chicken good(yeah finaly found chicken script that works)
    only problams i noticed is that it doesnt seem to detect the bones and feather well (maybe its the colors i picked) ill try to mess around wit that abit.

    will defintly b using this script 2nite
    will try to post my progress report

    and would also luv to see anti-radoms

    good work though

  9. #9
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the comments, everybody. I didn't really expect anybody to be using this script, because it is my first and not very good. Now that I see that people are using it I will add anti-randoms and try to fix picking up bones and feathers. I know that it doesn't pick them up very well, any suggestions on how to improve this? Thanks for reading.

  10. #10
    Join Date
    Dec 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what soes "nick" mean

  11. #11
    Join Date
    Dec 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what do i put in the nick spot? Players[0].Nick := '';

  12. #12
    Join Date
    Dec 2007
    Location
    Narnia
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great job! It was hilarious watching my main kill chickens.
    Who lives in a pineapple under the sea?

  13. #13
    Join Date
    Sep 2006
    Posts
    457
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    looks good but don't use Until. because it's not a very good failsafe. Just one more thing to make sure you don't get banned
    Finished my curser ---> it's in mage section.

  14. #14
    Join Date
    Dec 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice script worked pretty nicely for me
    870 feathers collected
    level 17-21 strength
    in and hour and a half
    didnt bury any bones though

  15. #15
    Join Date
    Dec 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ive been using this on and off last night and today. it works pretty nicely but it doesnt really bury bones
    total progress:
    strength 17-33
    feathers 7315(ive been banking them every now and then)
    bones burried 0
    raw chicken collected (but i dropped them) about 45
    other than the raw chickens and not burying bones its a pretty nice script
    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fighter
    By alias66 in forum OSR Help
    Replies: 10
    Last Post: 02-27-2009, 02:20 AM
  2. Replies: 3
    Last Post: 05-21-2007, 09:25 AM
  3. chicken fighter by whiteshadow
    By slacky001 in forum OSR Help
    Replies: 3
    Last Post: 01-07-2007, 12:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •