Results 1 to 14 of 14

Thread: ChickenPlucker

  1. #1
    Join Date
    Oct 2008
    Location
    The Netherlands
    Posts
    74
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default ChickenPlucker

    Yes, i know the name sucks, if anyone has suggestions, please tell me but i could think of anything better -.-

    First of all i want to say that finaly back after 3 months, in the meanwhile i learned C# programming and im actualy realy good at it now i created 2d games, a 2d rpg engine with a realy cool map editor, a keylogger, my own chat server/clien, my own email receiver/sender/viewer (has trouble reading fully parsing a html decoded email though), my own webbrowser, which im using right now, a calculator, and way, way more

    //That^ got a little longer as expected, sorry, back to the script.

    The script attacks chickens and picks up their feathers, and repeats that.
    Even though it's still the Beta version, i've tested it and it works realy well.

    The only bug(s) i've found so far is that when you try to attack a chicken next to another fighting player/chicken, it has trouble noticing wether you're fighten it or not, and therfor it might count it as a kill why its not.

    The script is Non-Smart, but can be 'Converted' to Smart simply by removing 3 '//' at the specified places.

    Points that still require testing:
    Switching player when reached a 'limit' (Amount of kills, Feathers, Time..);

    TODO List:
    1: Add support for ranging(Check Arrows, Pick up arrows);
    2: Add the ability to gether and bury the bones;
    3: Add the ability to switch between chickens/goblins
    {
    Ex: Players[0].Integers[#] = 1; // 0 = Chickens, 1 = Goblins
    }
    4: Do the same for cows as with the goblins, but also add the ability to gether the hides;
    5: Add ability to eat (shouldnt realy be neccesary at these low level monsters, but would still be very nice i guess);
    6: Banking for cowhides or other stuff;
    7: DeathWalk to area of monster to fight(just in case)

    Code:
    SCAR Code:
    //WARNING: BETA VERSION. IT MIGHT STILL CONTAIN SOME BUGS.

    ///////////////////////////////////////////////////////////////////
    //                                                               //
    //  PPPPPP                                                       //
    //  PP   PP  HH   HH   OOOOOOO   EEEEEE  NNN   NN  II  XX   XX   //
    //  PPPPPP   HH   HH  OOO   OOO  EE      NNNN  NN  II   XX XX    //
    //  PP       HHHHHHH  OO     OO  EEEEEE  NN NN NN  II    XXX     //
    //  PP       HH   HH  OOO   OOO  EE      NN  NNNN  II   XX XX    //
    //  PP       HH   HH   OOOOOOO   EEEEEE  NN   NNN  II  XX   XX © //
    //                                                               //
    ///////////////////////////////////////////////////////////////////
    //                    ****  DISCRIPTION  ****                    //
    //  Something..................................................  //
    //  ...........................................................  //
    //  ...........................................................  //
    //  ...........................................................  //
    ///////////////////////////////////////////////////////////////////
    //               Script created by: Phoenix13NL                  //
    ///////////////////////////////////////////////////////////////////

    program ChickenFucker;
    {.include srl/srl/misc/smart.scar}
    //REMOVE THE '//' AT THE START OF THE ABOVE LINE TO ENABLE SMART, DO THE SAME AT BOTTOM OF SCRIPT! (1 of 3)

    {.include SRL/SRL.scar}

    Var x, y, World, KillCount, LastFeatherCount, FeatherCount, InvFeather : Integer;
      SaveProggy : Boolean;
     
    Const
    ChickenColor1 = 1055878;
    ChickenColor2 = 1652061;
    ChickenColor3 = 1586263;
    ChickenColor4 = 791907;
    ChickenColor5 = 1055619;
    ChickenColor6 = 726136;
    ChickenColor7 = 594016;
    ChickenColor8 = 528476;
    ChickenColor9 = 1055351;
    ChickenColor0 = 924015;
    FeatherColor1 = 403204;
    FeatherColor2 = 469253;
    FeatherColor3 = 402948;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;     //How many players?
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;      //Current player
      SaveProggy := True;

      Players[0].Name   := '';  //Username
      Players[0].Pass   := '';    //Password
      Players[0].Nick   := '';       //Nick (3-4 letters of your username)
      Players[0].Active := True;          //Is the player active?
      Players[0].Integers[3] := -1; //Chickens to kill before switching to next player, -1 for Unlimited.
      Players[0].Integers[4] := -1; //Feathers to pick before switching to next player, -1 for Unlimited.
      Players[0].Integers[5] := -1; //Go to next player after ... minutes, -1 for Unlimited.

      {Players[1].Name   := '';  //Username
      Players[1].Pass   := '';    //Password
      Players[1].Nick   := '';       //Nick (3-4 letters of your username)
      Players[1].Active := True;          //Is the player active?
      Players[1].Integers[3] := -1; //Chickens to kill before switching to next player, -1 for Unlimited.
      Players[1].Integers[4] := -1; //Feathers to pick before switching to next player, -1 for Unlimited.
      Players[1].Integers[5] := -1; //Go to next player after ... minutes, -1 for Unlimited.}


      {Players[2].Name   := '';  //Username
      Players[2].Pass   := '';    //Password
      Players[2].Nick   := '';       //Nick (3-4 letters of your username)
      Players[2].Active := True;          //Is the player active?
      Players[2].Integers[3] := -1; //Chickens to kill before switching to next player, -1 for Unlimited.
      Players[2].Integers[4] := -1; //Feathers to pick before switching to next player, -1 for Unlimited.
      Players[2].Integers[5] := -1; //Go to next player after ... minutes, -1 for Unlimited.}

     
      Mousespeed := 12;
      World := 94;                 //Smart world number
    end;

    procedure AntiRandoms;
    begin
      if not LoggedIn then Exit;
      FindNormalRandoms;
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then Exit;
      case random(10) of
        0: PickUpMouse;
        1: RandomMovement;
        2: RandomRClick;
        3: case random(4) of
          0: HoverSkill('Fishing', false);
          1: HoverSkill('Cooking', false);
          2: HoverSkill('Woodcutting', false);
          3: HoverSkill('Firemaking', false);
          end;
      end;
    end;

    Procedure PreparePlayer;
    var Count, i : Integer;
    begin
      Writeln('Procedure: PreparePlayer');
      Repeat
        Wait(1000);
        Inc(i);
        If i > 20 then Exit;
      Until LoggedIn;
      if not LoggedIn then Exit;
      InvFeather := DTMFromString('78DA6364656060106240038C482490E606120' +
           '204D480CC1025A0860748481050C301246408A86107120A04D4B0' +
           '10A1869508BBD808FB1D00D90F013F');
      Count := ItemAmount('inv', 'dtm', InvFeather, []);
      Players[CurrentPlayer].Integers[1] := Count;
      Players[CurrentPlayer].Integers[6] := GetSystemTime;
      LastFeatherCount := LastFeatherCount + FeatherCount;
      writeln(inttostr(count));
      SetRun(True);
      SetAngle(True);
    end;

    Function FindChicken : Boolean;
    begin
      if not LoggedIn then Exit;
      Result := FindObjCustom(x, y, ['Chicken', 'Chick'{:P}, 'icken'], [ChickenColor1, ChickenColor2,
        ChickenColor3, ChickenColor4, ChickenColor5, ChickenColor6, ChickenColor7, ChickenColor8, ChickenColor9, ChickenColor0], 5);
      if FindColorCircle(x, y, 65280, x, y, 5) or FindColorCircle(x, y, 255, x, y, 5) then
      begin
        Result := False;
      end;
    end;

    Function Fighting(Loops : Integer) : Boolean;
    Var c : integer;
    begin
      if not LoggedIn then Exit;
      Result := false;
      Repeat
        if FindColor(x, y, 65280, 259, 159, 289, 179) or FindColor(x, y, 255, 259, 159, 289, 179) then
        begin
          Result := true;
          break;
        end;
        Wait(500);
        Inc(c);
        if c > Loops then
        begin
          if FindColor(x, y, 65280, 229, 126, 267, 178) or FindColor(x, y, 255, 229, 126, 267, 178) then
          begin
            Result := true;
            break;
          end;
        break;
        end;
      Until false;
    end;

    Function AttackChicken : Boolean;
    begin
      if not LoggedIn then Exit;
      Mouse(x, y, 10, 10, false);
      Result := ChooseOption('ttack');
    end;

    Procedure WaitFightOver;
    begin
      if not LoggedIn then Exit;
      Repeat
        Wait(500 + Random(250));
      Until not Fighting(1);
    end;

    Procedure KillChickens;
    Var Killed : Boolean;
    StartTime, Elapsed : Integer;
    begin
      if not LoggedIn then Exit;
      Killed := false;
      StartTime := GetSystemTime;
      Repeat
        AntiRandoms;
        Elapsed := GetSystemTime - StartTime;
        if Elapsed > 10000 then
        begin
          exit;
        end;
        Repeat
          Wait(500 + Random(250));
          AntiRandoms;
        Until FindChicken;
        if AttackChicken then
        begin
          if Fighting(8) then
          begin
            WaitFightOver;
            Killed := true;
            Inc(KillCount);
            Inc(Players[CurrentPlayer].Integers[0]);
          end;
        end;
      Until Killed;
    end;

    Function FindFeather : Boolean;
    begin
      if not LoggedIn then Exit;
      Result := FindObjCustom(x, y, ['eather'], [FeatherColor1, FeatherColor2, FeatherColor3], 10);
    end;

    Function PickFeather : Boolean;
    begin
      if not LoggedIn then Exit;
      Mouse(x, y, 5, 5, false);
      Result := ChooseOption('eather');
    end;

    Function GetPlayerFeatherCount : Integer;
    Var Count : Integer;
    begin
      if not LoggedIn then Exit;
      Count := ItemAmount('inv', 'dtm', InvFeather, []);
      FeatherCount := Count - Players[CurrentPlayer].Integers[1];
      Players[CurrentPlayer].Integers[2] := FeatherCount;
      Result := FeatherCount;
    end;

    Procedure GrabFeathers;
    begin
      if not LoggedIn then Exit;
      if FindFeather then PickFeather;
    end;

    Procedure GrabAllFeathers;
    begin
      if not LoggedIn then Exit;
      Repeat
        GrabFeathers;
        Wait(1000 + Random(500));
      Until not FindFeather;
      GetPlayerFeatherCount;
    end;

    procedure SaveProgressReport;
    var
      List: TStringList;
      i: Integer;
    begin
      List := TStringList.Create;
      List.Add('//----------------------------------------\\');
      List.Add('||             ChickenPlucker             ||');
      List.Add('||----------------------------------------||');
      List.Add(Padr('||  Time Running: '+ TimeRunning, 42) + '||');
      List.Add(Padr('||  Chickens Killed: '+ IntToStr(KillCount), 42) + '||');
      List.Add(Padr('||  Feathers Picked: '+ IntToStr((LastFeatherCount + FeatherCount)), 42) + '||');
      List.Add('||----------------------------------------||');
      for i := 0 to HowManyPlayers - 1 do
      begin
        List.Add(Padr('||ID: '+ Players[i].Name+ ', Kills: '+ IntToStr(Players[i].Integers[0])+ ', Feathers: '+ IntToStr(Players[i].Integers[2]),42) + '||');
      end;
      List.Add('||----------------------------------------||');
      List.Add('\\----------------------------------------//');
      SaveToFile(List, AppPath + 'ProgressReport ' + TheDate(3) + '.txt');
    end;

    Procedure ReportProgress;
    var i : Integer;
    begin
      ClearDebug;
      Writeln('//------------------------------------------\\');
      Writeln('||              ChickenPlucker              ||');
      Writeln('||------------------------------------------||');
      Writeln(Padr('||  Time Running: '+ TimeRunning, 44) + '||');
      Writeln(Padr('||  Chickens Killed: '+ IntToStr(KillCount), 44) + '||');
      Writeln(Padr('||  Feathers Picked: '+ IntToStr((LastFeatherCount + FeatherCount)), 44) + '||');
      Writeln('||------------------------------------------||');
      for i := 0 To HowManyPlayers - 1 Do
      begin
      Writeln(Padr('||  '+ Players[i].Name+ ': Kills: '+ IntToStr(Players[i].Integers[0])+ ', Feathers: '+ IntToStr(Players[i].Integers[2]),44) + '||');
      end;
      Writeln('||------------------------------------------||');
      Writeln('\\------------------------------------------//');
      if SaveProggy Then SaveProgressReport;
    end;

    Function CheckLimit : Boolean;
    begin
      if Players[CurrentPlayer].Integers[3] > 0 then
      begin
        Result := Players[CurrentPlayer].Integers[0] > Players[CurrentPlayer].Integers[3];
      end;
      if Players[CurrentPlayer].Integers[4] > 0 then
      begin
        If not Result then Result := Players[CurrentPlayer].Integers[2] > Players[CurrentPlayer].Integers[4];
      end;
      if Players[CurrentPlayer].Integers[5] > 0 then
      begin
        If not Result then Result := (((GetSystemTime / 1000) / 60) > (((Players[CurrentPlayer].Integers[5] / 1000) / 60) - ((Players[CurrentPlayer].Integers[6] / 1000) / 60)));
      end;
    end;

    Procedure MainLoop;
    begin
      Repeat
        PreparePlayer;
        Repeat
          KillChickens;
          GrabAllFeathers;
          ReportProgress;
          if not LoggedIn then Break;
          if CheckLimit then break;
          AntiRandoms;
          AntiBan;
        Until False;
        NextPlayer(True);
      Until False;
    end;

    begin
      ClearDebug;
      DeclarePlayers;
      SmartSetupEx(World ,false, false, false);  //REMOVE THE '//' AT THE START OF THE LINE TO ENABLE SMART! (2 of 3)
      SetTargetDC(SmartGetDC);                   //REMOVE THE '//' AT THE START OF THE LINE TO ENABLE SMART! (3 of 3)
      SetupSRL;
      LampSkill := 'Rangin'; //Change into any skill you want.
      Logout;
      closefile(rewritefile('C:\WINDOWS\.jagex_cache_32\uid.dat',true));
      LoginPlayer;
      MainLoop;
    end.

    Here are some of my 'proggies'
    SCAR Code:
    //Short test,
    //------------------------------------------\\
    ||              ChickenPlucker              ||
    ||------------------------------------------||
    ||  Time Running: 20 Minutes and 7 Seconds  ||
    ||  Chickens Killed: 48                     ||
    ||  Feathers Picked: 300                    ||
    ||------------------------------------------||
    ||  w4rr1or 34: Kills: 48, Feathers: 300    ||
    ||------------------------------------------||
    \\------------------------------------------//

    //Long test  //Only met one random, and srl solved it succesfully :)
    //------------------------------------------\\
    ||              ChickenPlucker              ||
    ||------------------------------------------||
    ||  Time Running: 1 Hours, 40 Minutes and 33 Seconds||
    ||  Chickens Killed: 272                    ||
    ||  Feathers Picked: 1910                   ||
    ||------------------------------------------||
    ||  W4rr1or 34: Kills: 272, Feathers: 1910  ||
    ||------------------------------------------||
    \\------------------------------------------//
    Even though this is only a 300 lines script (for now) it took over 7 hours to create it :S and because i worked the whole night until 05:30 i only had 1.5 hours left to sleep and then wake up for school again realy, time flies when having fun at scripting

    Edit* dam, i just died using my script and lost 1.4K feathers, i dont know the reason though... .
    but the feathercount is still correct: -1120, i lost 1.4K, he has 280 in inventory by now.

    Another Edit* i finaly learned how reflection works, should i make one that finds monsters by reflection?

    please post your Tips/Bugs/Proggys

    ##
    Non longer being updated, stopped with RS and scriping and back into creating games , I was almost finished with a new cleaner version with reflection but im to lazy to finish it sorry, Nevertheless it should still work fine, have fun.
    ##
    Last edited by Phoenix13nl; 04-12-2009 at 03:49 PM.
    Busy working on realtime C# ray tracer

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    for the chicken colors, you can use an array

    testing it now ;D

    EDIT:

    eerrrr..

    SCAR Code:
    closefile(rewritefile('C:\WINDOWS\.jagex_cache_32\uid.dat',true));

    that = bad?

    EDIT: you should add a choice for levels to get and skills to train

    EDIT: >.<! accidently stopped it

    SCAR Code:
    //------------------------------------------\\
    ||              ChickenPlucker              ||
    ||------------------------------------------||
    ||  Time Running: 18 Minutes and 46 Seconds ||
    ||  Chickens Killed: 46                     ||
    ||  Feathers Picked: 385                    ||
    ||------------------------------------------||
    ||  99_: Kills: 46, Feathers: 385           ||
    ||------------------------------------------||
    \\------------------------------------------//

  3. #3
    Join Date
    Jan 2009
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    my personal best =[
    it dosn't solve niles =[

    //------------------------------------------\\
    || ChickenPlucker ||
    ||------------------------------------------||
    || Time Running: 22 Minutes and 32 Seconds ||
    || Chickens Killed: 47 ||
    || Feathers Picked: 0 ||
    ||------------------------------------------||
    || pingpongpow: Kills: 47, Feathers: 0 ||
    ||------------------------------------------||
    \\------------------------------------------//
    who ever said everything is possible never tried pushing backwards on a revolving door[BANANA]

  4. #4
    Join Date
    Oct 2008
    Location
    The Netherlands
    Posts
    74
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry about:
    closefile(rewritefile('C:\WINDOWS\.jagex_cache_32\ uid.dat',true));,
    ill also add a skill to train option like you said.

    i didint know it was bad, ill remove it now.

    and to ghfghf7,
    hmm, thats dissapointing the niles random should be solved by the FindNormalRandoms from srl, i wonder why it didint work...
    #EDIT# hmm, i took a look into the AntiRandoms folder and it seems not to contain anything for solving niles..

    and for picking 0 feathers, sometimes the color seems to be diffrent then from when playing last time, thats why i already have so many of the, and actualy added tolerance, you might want to change line 210 from:
    Result := FindObjCustom(x, y, ['eather'], [FeatherColor1, FeatherColor2, FeatherColor3], 10);
    to
    Result := FindObjCustom(x, y, ['eather'], [FeatherColor1, FeatherColor2, FeatherColor3], 15 {or 20 or something, just check when its working fine but dont go to high});

    i've also experienced another problem, fighting randoms, it cant spot them, when using reflection i can write something that does,...

    i think ill also make a Smart only version of the script so i can use reflection, for some improvements, if any if you has expiernce in how to find/pickup grounditems please tell me.
    Im starting right now.
    Busy working on realtime C# ray tracer

  5. #5
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by Phoenix13nl View Post
    i took a look into the AntiRandoms folder and it seems not to contain anything for solving niles..
    its called a certer...check again miles niles and giles...

  6. #6
    Join Date
    Aug 2007
    Location
    Norway
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Worked verry vel, then this came up and the script stopped(it didn't even log out)

    [Runtime Error] : Exception: Access violation at address 006165B1 in module 'scar.exe'. Read of address 00000000 in line 355 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar
    http://www.stats.srl-forums.com/sigs/3308.png


    Help me, and help yourself;D

    register here

  7. #7
    Join Date
    Apr 2007
    Location
    Estonia
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    //------------------------------------------\\
    || ChickenPlucker ||
    ||------------------------------------------||
    || Time Running: 24 Minutes and 41 Seconds ||
    || Chickens Killed: 45 ||
    || Feathers Picked: 1360 ||
    ||------------------------------------------||
    || neeger: Kills: 45, Feathers: 105 ||
    ||------------------------------------------||

    Bit slow, but nice and simple script :P
    ROCK IS NOT A DEVILS WORK, ITS MAGICAL AND RAD!

  8. #8
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cheatking View Post
    Worked verry vel, then this came up and the script stopped(it didn't even log out)

    [Runtime Error] : Exception: Access violation at address 006165B1 in module 'scar.exe'. Read of address 00000000 in line 355 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar
    is your declare players proc setup right?

  9. #9
    Join Date
    Jan 2008
    Location
    U.S.A
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    //------------------------------------------\\
    ||              ChickenPlucker              ||
    ||------------------------------------------||
    ||  Time Running: 2 Hours, 36 Minutes and 55 Seconds||
    ||  Chickens Killed: 386                    ||
    ||  Feathers Picked: 2540                   ||
    ||------------------------------------------||
    ||  Kills: 386, Feathers: 205       ||
    ||------------------------------------------||
    \\------------------------------------------//

    Really Good script, I encourage you to keep up with scripting I manually stopped, other wise I might have had a much longer progress report

    Suggestion:
    Allow us to Pick attack mode.
    Don't have the Progress report say our name.
    Clean up your main post, spelling errors and lots of of junk clutter up the page and put people off, Its kinda like owning a shop. haha!
    If you get really good maybe pick up raw chicken and cook it.
    Other than that great so far!
    Will test most scripts, offering members account to certain scripters! PM Me.
    Also need helping making a powerminer, Pst/Aim me!

  10. #10
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    reserved
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  11. #11
    Join Date
    Mar 2008
    Posts
    84
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey I've just tested ur script and it works so good.

    //------------------------------------------\\
    || ChickenPlucker ||
    ||------------------------------------------||
    || Time Running: 2 Hours, 52 Minutes and 29 Seconds||
    || Chickens Killed: 507 ||
    || Feathers Picked: 4275 ||
    ||------------------------------------------||
    || Kills: 507, Feathers: 1445 ||
    ||------------------------------------------||
    \\------------------------------------------//

  12. #12
    Join Date
    Oct 2008
    Location
    The Netherlands
    Posts
    74
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's great to hear sorry for not updating it anymore
    Busy working on realtime C# ray tracer

  13. #13
    Join Date
    Jul 2007
    Location
    Goodrich, by flint
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    //------------------------------------------\\
    || ChickenPlucker ||
    ||------------------------------------------||
    || Time Running: 3 Hours, 28 Minutes and 55 Seconds||
    || Chickens Killed: 380 ||
    || Feathers Picked: 2185 ||
    ||------------------------------------------||
    || rawr i pk1: Kills: 380, Feathers: 2185 ||
    ||------------------------------------------||

  14. #14
    Join Date
    Oct 2008
    Location
    The Netherlands
    Posts
    74
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool to see that people can actualy still use these scripts xD

    I wish I could make something usefull for people with programming instead of scipting though... I miss the scripting with joel, he should learn C# too and we start writing games together :P
    Busy working on realtime C# ray tracer

Thread Information

Users Browsing this Thread

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

Posting Permissions

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