Results 1 to 10 of 10

Thread: FlagEx fix..?

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default FlagEx fix..?

    Well here's the current FlagEx:
    SCAR Code:
    {*******************************************************************************
    function FlagEx(Dist: Integer; RoadColorCheck: Boolean): Boolean;
    By: Wizzup? / WT-Fakawi / ZephyrsFury modified by N1ke!
    Description: Waits until Flag is within "Distance" distance.
    *******************************************************************************}

    function FlagEx(Dist: Integer; RoadColorCheck: Boolean): Boolean;
    var
      Tx, Ty, M, D1, D2: Integer;
    begin
      Result := False;
      M := GetSystemTime;
      while (FindColor(Tx, Ty, 3026478, MMX1, MMY1, MMX2, MMY2)) do
      begin
        D1 := Distance(Tx, Ty + 14, MMCX, MMCY);
        if (D1 <= Dist) then
        begin
          Result := True;
          Exit;
        end;
        If RoadColorCheck then
          RoadColorChecker;
        Wait(100);
        if (GetColor(6, 6) <> clWhite) then
          if (GetSystemTime - M > 5000) then
          begin
            if (D1 = D2) then Exit;
            D2 := D1;
            M := GetSystemTime;
          end;
        if (Random(20) = 0) then IdleTime(500, 1000, 0.01);
        if SRL_Procs[SRL_AntiBan] <> nil then
          SRL_Procs[SRL_AntiBan]();
      end;
      Wait(RandomRange(200, 400));
    end;

    and unless I'm missing something, I don't see a reason to make it wait 5 seconds before checking to see if you are moving or not. That just adds an un human like wait when your standing next to where you clicked but the flag doesn't go away.

    So:
    SCAR Code:
    {*******************************************************************************
    function FlagEx(Dist: Integer; RoadColorCheck: Boolean): Boolean;
    By: Wizzup? / WT-Fakawi / ZephyrsFury modified by N1ke!
    Description: Waits until Flag is within "Distance" distance.
    *******************************************************************************}

    function FlagEx(Dist: Integer; RoadColorCheck: Boolean): Boolean;
    var
      Tx, Ty, M, D1, D2: Integer;
    begin
      Result := False;
      M := GetSystemTime;
      while (FindColor(Tx, Ty, 3026478, MMX1, MMY1, MMX2, MMY2)) do
      begin
        D1 := Distance(Tx, Ty + 14, MMCX, MMCY);
        if (D1 <= Dist) then
        begin
          Result := True;
          Exit;
        end;
        If RoadColorCheck then
          RoadColorChecker;
        Wait(100);
        if (GetColor(6, 6) <> clWhite) then
          if (GetSystemTime - M > 1000) then
          begin
            if (D1 = D2) then Exit;
            D2 := D1;
            M := GetSystemTime;
          end;
        if (Random(20) = 0) then IdleTime(500, 1000, 0.01);
        if SRL_Procs[SRL_AntiBan] <> nil then
          SRL_Procs[SRL_AntiBan]();
      end;
      Wait(RandomRange(200, 400));
    end;

    That just seems a bit more logical to me, as far as AntiBan and speed of script go anyways. It could probably wait for even less than that honestly, but 1 second seems like a nice wait time.

    EDT: I only bring this up because I find that the following scenario happens quite frequently:
    Quote Originally Posted by NCDS
    You click to walk into the bank, but you click behind a bank booth. The flag appears behind the bank booth but you only walk to the front of it. So, the flag doesn't disappear and currently, FlagEx makes it wait 5+ more seconds before it realizes your not moving anymore. If it is changed to a 1 second wait (or around that) however, it will then find it almost immediately.
    Am I wrong
    Last edited by NCDS; 08-21-2009 at 04:47 PM.

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

    Default

    I'm pretty sure it's just because you can click and walk for a few seconds before needing to click again. There are places where you can walk for 10-15 seconds in one click, but there isn't/won't be a script there. (On the way to Barrows.. ) So 5 seconds is a reasonable time, in my mind.

  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by ian. View Post
    I'm pretty sure it's just because you can click and walk for a few seconds before needing to click again. There are places where you can walk for 10-15 seconds in one click, but there isn't/won't be a script there. (On the way to Barrows.. ) So 5 seconds is a reasonable time, in my mind.
    But it's in a loop anyways. From what I can see 5 seconds is the time it wait's before checking again to see if your walking. So what then if your walk only took 1 second, but the flag didnt go away because you clicked behind the wall of something. It would make you wait all that extra time. Were as if you only wait 1 second in between, it would be more responsive.

    See what I'm saying?

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

    Default

    Meh. I suppose. But I don't pay attention much when I walk. And a few seconds won't change much in the script. And what if it does happen to be like.. 15 seconds? Someone could open/close a door or something. Good find, but I don't think there's much need for it.

  5. #5
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by ian. View Post
    Meh. I suppose. But I don't pay attention much when I walk. And a few seconds won't change much in the script. And what if it does happen to be like.. 15 seconds? Someone could open/close a door or something. Good find, but I don't think there's much need for it.
    I really don't think you understand what I'm saying..

    All this changes is how fast it loops through the function. Clearly, by making it loop through the function faster, it becomes more responsive and human like.

    Scenario:
    You click to walk into the bank, but you click behind a bank booth. The flag appears behind the bank booth but you only walk to the front of it. So, the flag doesn't disappear and currently, FlagEx makes it wait 5+ more seconds before it realizes your not moving anymore. If it is changed to a 1 second wait (or around that) however, it will then find it almost immediately.
    Last edited by NCDS; 08-21-2009 at 04:23 PM.

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

    Default

    I know what you're saying. I just don't see how it'd make TOO much difference. Max of 4 second wait compared to yours, right? Or even more, it doesn't matter. Maybe they took a drink of water/ate/something. I'm not really trying to criticize you (sorry if it seems like it/I am.. I'm watching TV/texting/talking.. ), I'm just saying that it won't make much of a difference. Nice find, nonetheless. ^^

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    But we need a compromise between an efficient function and one that doesn't fail when RS lags even just a bit. 5 seconds seems like a good compromise.
    Last edited by ZephyrsFury; 08-21-2009 at 05:52 PM.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Ahh I see now. I wasn't factoring in any lag :/

    I often forget about that now since my new PC = lag free basically.


    Feel free to lock/delete thread.

  9. #9
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    If everyone thinks 5 seconds is too long I'm happy to reduce it. But making it too small will screw up things for people on slower internet or computers.

  10. #10
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    If everyone thinks 5 seconds is too long I'm happy to reduce it. But making it too small will screw up things for people on slower internet or computers.
    No, I agree with you

    5 seconds is a good time. It's 6:03 am for me right now though, I just didn't think about possible lag.

    I really only brought it up because I was trying to get max XP per hour on my new script

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
  •