Results 1 to 15 of 15

Thread: SetFightMode(4) chooses (3).

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default SetFightMode(4) chooses (3).



    Clicks the 3rd box (lunge) when I requested 4th (block). Don't know what the issue is or if it's a PEBKAC or a bug, but just thought I'd throw it out there..


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    I fixed this long time ago, but I saw some discussion on some other thread, and someone "fixed" it again, maybe this is result of that?
    There used to be something meaningful here.

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    I modified it, then cohen went back to change the GetColor. I feel that the color isn't constant or anything, needs a permanent fix

  4. #4
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    .. but Fre had already fixed it?
    Why did someone modify it again?

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    The colour in the edit I posted in Fawki's thread in Members was constant.
    Simba Code:
    {function SetFightMode(oFightMode: Integer): Boolean;
    By: Nielsie95 & Nava2, fixed by Quickmarch, fixed by Rich
    Description: Sets fight mode.  Returns false if failed to set desired mode.
    *******************************************************************************}

    function SetFightMode(oFightMode: Integer): Boolean;
    var
      i, x, y: Integer;
      b: TBox;
      cmbBoxes: TBoxArray;
    begin
      Result := False;
      if not(Loggedin)then Exit;
      GameTab(tab_Combat);
      Wait(200 + Random(100));

      cmbBoxes := [IntToBox(575, 255, 630, 290), IntToBox(660, 255, 710, 290),
                   IntToBox(575, 310, 630, 345), IntToBox(660, 310, 710, 345)];
      b := cmbBoxes[oFightMode - 1];
      if (not(GetColor(657, 345) = 5791325)) and (oFightMode = 4) then
        b := cmbBoxes[2];
      i := 0;
      while (i < 4) do
      begin
        Result := FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2);
        if (Result) then Exit;
        Mouse(RandomRange(b.x1, b.x2), RandomRange(b.y1, b.y2), 0, 0, True);
        Wait(500 + Random(300));
        Inc(i);
      end;
    end;
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Rich View Post
    The colour in the edit I posted in Fawki's thread in Members was constant.
    Simba Code:
    {function SetFightMode(oFightMode: Integer): Boolean;
    By: Nielsie95 & Nava2, fixed by Quickmarch, fixed by Rich
    Description: Sets fight mode.  Returns false if failed to set desired mode.
    *******************************************************************************}

    function SetFightMode(oFightMode: Integer): Boolean;
    var
      i, x, y: Integer;
      b: TBox;
      cmbBoxes: TBoxArray;
    begin
      Result := False;
      if not(Loggedin)then Exit;
      GameTab(tab_Combat);
      Wait(200 + Random(100));

      cmbBoxes := [IntToBox(575, 255, 630, 290), IntToBox(660, 255, 710, 290),
                   IntToBox(575, 310, 630, 345), IntToBox(660, 310, 710, 345)];
      b := cmbBoxes[oFightMode - 1];
      if (not(GetColor(657, 345) = 5791325)) and (oFightMode = 4) then
        b := cmbBoxes[2];
      i := 0;
      while (i < 4) do
      begin
        Result := FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2);
        if (Result) then Exit;
        Mouse(RandomRange(b.x1, b.x2), RandomRange(b.y1, b.y2), 0, 0, True);
        Wait(500 + Random(300));
        Inc(i);
      end;
    end;
    Tell me if it works

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Problem still occurs with R1ch's function for me

    Simba Code:
    function SetFightMode(FightMode : Integer): Boolean;
    var
      Boxes : TBoxArray;
      Box : TBox;
      X, Y, I : Integer;
    begin
      Result := False;
      if not LoggedIn then Exit;

      GameTab(tab_Combat);
      Boxes := [IntToBox(567, 250, 636, 295), IntToBox(651, 250, 818, 295),
                IntToBox(567, 303, 636, 348), IntToBox(651, 303, 818, 348)];
      Box   := Boxes[FightMode-1];

      if FightMode = 4 then
        if GetColor(657, 345) <> 5791325 then
          Box := Boxes[2];

      for I := 0 to 3 do
      begin
        Result := FindColorTolerance(X, Y, 2106252, Box.X1, Box.Y1, Box.X2, Box.Y2, 10);
        if Result then Break;
        Mouse(RandomRange(Box.x1, Box.x2), RandomRange(Box.y1, Box.y2), 0, 0, True);
        WriteLn(CountColorTolerance(2106252, Box.X1, Box.Y1, Box.X2, Box.Y2, 10));
        Wait(500+Random(300));
      end;
    end;
    Works for me
    Last edited by Zyt3x; 02-28-2011 at 06:39 PM.

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    ^ That doesn't work for me. =\ Why is this part even in the function?
    Simba Code:
    if (not(GetColor(662, 336) = 1974407)) and (oFightMode = 4) then
      b := cmbBoxes[2];

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    ^ That doesn't work for me. =\ Why is this part even in the function?
    Simba Code:
    if (not(GetColor(662, 336) = 1974407)) and (oFightMode = 4) then
      b := cmbBoxes[2];
    I think it's when a person chooses the 4th box and if there isn't one, it will resort to the third box.
    I don't think its needed if it does indeed do that.

  10. #10
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Naum View Post
    I think it's when a person chooses the 4th box and if there isn't one, it will resort to the third box.
    I don't think its needed if it does indeed do that.
    Ah okay. I'll work on this now then, thanks.

    E: Fixed. Instead of getting rid of that part, I have it check for the text color instead. Does anyone know if there's a weapon that doesn't have "Block" as the defence attack style? If there is, may have to change it to a FindColor rather than GetColor.
    Last edited by Coh3n; 03-02-2011 at 07:12 PM.

  11. #11
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Ah okay. I'll work on this now then, thanks.

    E: Fixed. Instead of getting rid of that part, I have it check for the text color instead. Does anyone know if there's a weapon that doesn't have "Block" as the defence attack style? If there is, may have to change it to a FindColor rather than GetColor.
    Every weapon has a defence training option, but some weapons (ranged weapons) don't say "Block," it's "Long range" or something (in case that matters).

  12. #12
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Every weapon has a defence training option, but some weapons (ranged weapons) don't say "Block," it's "Long range" or something (in case that matters).
    Ranged weapons only have 3 options though.

  13. #13
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Echo_ View Post
    Ranged weapons only have 3 options though.
    Yeah so for that instance it wouldn't matter. I did test with a range weapon, though, in case anyone was wondering.

  14. #14
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I prefer findcolor, GetColor can easily break from a single pixel shift..
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  15. #15
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    I prefer findcolor, GetColor can easily break from a single pixel shift..
    Yeah, and in this situation there's no chance for false positives/negatives.

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
  •