Results 1 to 17 of 17

Thread: FindColorSkipBoxArrayTolerance

  1. #1
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default FindColorSkipBoxArrayTolerance

    i am using the FindColorSkipBoxArrayTolerance in one of my functions and i was wondering if w/ srl4 does that not work annymore cuz i cant find it in the color.scar file anymore, and also if that is so what should i replace that with to be just as good as it? i was wondering this b/c i will log in and then my mouse just goes to the upper left corner of the rs screen and i was wondering if this was the reason or if someone knows the reason for that it would be great also!!

    and also why i have your attention can someone tell me why my mouse clicks 4 times when it finds the color

    SCAR Code:
    {Thanks to Smartzkid for all the help and looking over of my script}

    program HSAutoFighter;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}

    var
      Killed: integer;

    var
      BoneBMP: integer;

    var
      x, y: integer;

    const
      Color1 = 13094607;//1st color of monster
      Color2 = 4803408;
      Color3 = 6057843;
      MonsterName = 'Guard';
      ToKill = 25;

    //Declares How Many Players//
    procedure DeclarePlayers;
    begin
      HowManyPlayers  := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :=''; //Character name
      Players[0].Pass :=''; //Character PAss
      Players[0].Nick :=''; //Nickname 3 Letter of char name
      Players[0].Active:=True;

      WriteLn('Using '+ IntToStr(HowManyPlayers) +' Players');
    end;

    procedure HyperSecretTAG;
    begin
      ClearDebug;
      Writeln(' _   _                       _____                    _  ');
      Writeln('| | | |                     /  ___|                  | | ');
      Writeln('| |_| |_   _ _ __   ___ _ __\ `--.  ___  ___ _ __ ___| |_');
      Writeln('|  _  | | | | ''_ \ / _ \ ''__|`--. \/ _ \/ __| ''__/ _ \ __|');
      Writeln('| | | | |_| | |_) |  __/ |  /\__/ /  __/ (__| | |  __/ |_ ');
      Writeln('\_| |_/\__, | .__/ \___|_|  \____/ \___|\___|_|  \___|\__|');
      Writeln('        __/ | |                                           ');
      Writeln('       |___/|_|                                           ');
      Writeln('HyperSecret''s AutoFighter!');
    end;


    procedure LoadBMP;
    begin
        BoneBMP := BitmapFromString(1, 10, 'C0B7B6A89DFFAEA2FFC9C2FFCF' +
           'C9C9D1CBCBCCC5C4E2DDDEC5BDBDB5AAA9');
    end;

    function HSBone(var HsX, HsY :integer; Name1, Name2: String; HsBMP, HsX1, HsY1, HsX2, HsY2: integer): Boolean; //refered to fawaki's post
    var
      HsAcc, HsRef: Extended;
      HsXT, HsYT, Tries, Tol: Integer;
    begin
      HsRef := 0.9;
      Tol := 0;
      for Tries := 1 to 5 do
      begin
        FindDeformedBitmapToleranceIn(HsBMP, HsXT, HsYT, HsX1, HsY1, HsX2, HsY2, Tol, 2, True, HsAcc);
        if (HsAcc >= HsRef) then
        begin
          MMouse(HsXT, HsYT, 0, 0);
          if (IsUpText(Name1) or IsUpText(Name2)) then
          begin
            HsX := HsXT
            HsY := HsYT;
            result := true;
            Exit;
          end;
        end;
      end;
    end;

    procedure HSPickBone;
    begin
      if(HSBone(x, y, 'Bon', 'one', BoneBMP, MSX1, MSY1, MSX2, MSY2))then
      begin
        Mouse(x, y, 0, 0, false)
        Wait(50 + random(50));
        ChooseOption('Bone');
        Wait(50 + random(100));
      end;
    end;


    function HSFighting(Name: string; color, maxtol, maxtime: integer): boolean;
    var
      box: TBoxArray;
      tolerance, time, HSx, HSy: integer;
    begin
      result := false;
      MarkTime(time);
      repeat
        if(FindColorSkipBoxArrayTolerance(HSx, HSy, color, msx1, msy1, msx2, msy2, tolerance, box)) then
        begin
          MMouse(x, y, 3, 3);
          wait(50 + random(250));
          if(IsUpText(Name))then
          begin
            result := true;
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, true);
          end else
          begin
            SetLength(box, Length(box) + 1);
            box[Length(box) - 1].X1 := x - 15;
            box[Length(box) - 1].Y1 := y - 15;
            box[Length(box) - 1].X2 := x + 15;
            box[Length(box) - 1].Y2 := y + 15;
          end;
        end else
          tolerance := tolerance + 1;
        wait(50);
      until(tolerance > maxtol) or (TimeFromMark(time) > maxtime);
    end;

    procedure HSAttack;
    var
      MonsterColors: array[0..2] of integer;
      i: Integer;
      TimeToKill: Integer;

    begin
      MonsterColors[0] := color1;
      MonsterColors[1] := color2;
      MonsterColors[2] := color3;

      MarkTime(TimeToKill);
      Killed := 0;
      repeat
        HighestAngle;
        for i := 0 to 2 do
        begin
          if(HSFighting(MonsterName, MonsterColors[i], 15, 2500))then
          begin
            OutFight;
            Killed := Killed + 1;
          end;
        end;
        wait(10);
      until (Killed >= ToKill) or (TimeFromMark(TimeToKill) > 300000+random(30000));
    end;

    procedure SetUp;
    begin
      SetupSRL;
      HyperSecretTAG;
      DeclarePlayers;
      if(not(loggedin))then LoginPlayer;
    end;


    begin
      SetUp;
      HSAttack;
    end.

    also can u check and see if my bone function is good, i dont have it going yet as you can see but does it look good?

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  2. #2
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    FindColorSkipBoxArrayTolerance is an inbuilt SCAR function, so regardless of the version of SRL it should still work. It works fine in one of my scripts that I'm making still

  3. #3
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    k i got it to attack now, but could someone till tell me why it clicks four times when it attacks? i would like to fix that b/c it will click that many times and miss b/c of it or end up trying to attack 2 monsters

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  4. #4
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Hmm really weird. But I prefer making fighting scripts right click and then choose option. By that you can avoid misclicking.

  5. #5
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    alright ill do it that way then, thx

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  6. #6
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    left your name and pass in it i think.

  7. #7
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    In HSFighting,

    SCAR Code:
    if(IsUpText(Name))then
          begin
            result := true;
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, true);
          end else

    to

    SCAR Code:
    if(IsUpText(Name))then
          begin
            result := true;
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, true);
            Exit;
          end else
    Interested in C# and Electrical Engineering? This might interest you.

  8. #8
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    damnit, i know its my fault, but F*** YOU to whoever took all my stuff off my acc

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  9. #9
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    i swear i tried to change it but when i got there i was too late sorry i couldn't help any more

  10. #10
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    thx man its ok, i just had a quick blow it pisses my off that ppl would do that on here but those ppl are just *** but thx again for trying

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  11. #11
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    ok i hope you didnt lose anything too valueable.

  12. #12
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    lol depends to some people not but to me it was everything

    2-3 sets of rune including full armour, kites, 2hs, battles, scims, about 2 mill cash, 1-2k lobs somewhere in there, and a couple 1000 iron ore and some other random things

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  13. #13
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    man im sorry i wish i could have been there sooner and whoever did it should burn in hell because people come here asking for help and it was most likely a leecher who comes here and takes free scripts and doesn't do anything.

  14. #14
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    i should prolly be put on the noob list for this one

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  15. #15
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    i should prolly be put on the noob list for this one
    Hm, I don't think so :S .. You should be allowed to be pissed off when shit like this happens. So you lost like 2-3m or something? That's rough. But I assume you got your account back, as you know stuff was stolen, so atleast you didn't "lose everything"

  16. #16
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    yea i guess in that aspect i still got my main

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  17. #17
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    well u can always auto 2-3m back

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
  •