Results 1 to 10 of 10

Thread: Lag

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Lag

    I'm trying to have my script detect lag when it first logs in, but i an't seem to make it accurate. here's the procedure:
    SCAR Code:
    procedure HandleLag;
    begin
      if not GetColor(179, 129) = 0 then Exit;
      repeat
        if (GetColor(179, 129) = 0) then Wait(500+random(500));
      until(not GetColor(109, 192) = 0);
    end;
    Right now, it looks for black in the top left corner, where the Loading bar would appear. But it continues to "detect" lag when the game is fully loaded. Can anybody help me with this?
    Last edited by DeSnob; 08-12-2009 at 10:52 PM.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In your until the coordinates for the black dot are different.

    SCAR Code:
    procedure HandleLag;
    begin
      if not GetColor(179, 129) = 0 then Exit;
      repeat
        if (GetColor(179, 129) = 0) then Wait(500+random(500));
      until(not GetColor(109, 192) = 0);
    end;

    Should be:

    SCAR Code:
    procedure HandleLag;
    begin
      if not GetColor(179, 129) = 0 then Exit;
      repeat
        if (GetColor(179, 129) = 0) then Wait(500+random(500));
      until(not GetColor(179, 129) = 0);
    end;

    This is kind of a dangerous way to detect the loading box anyways. What if there is a black color there on the screen? It would think that this was the lag box.

    What I did a long time ago when they came out with the lag thing (over 2 years ago) was get the coordinates around the box, then count the colors in it:

    SCAR Code:
    function Loading: Boolean;
    var TPA: TPointArray;
      LoadingTime: Integer;
    begin
      if(not(LoggedIn))then Exit;
      FindColorsSpiralTolerance(x,y,TPA,0,7,7,204,34,0);
      Result := GetArrayLength(TPA) = 5291;
    end;

    Use:

    SCAR Code:
    while(Loading)do wait(1);

    There might not be exactly 5291 black colors in the rectangle now and those may not be the correct coordinates. But it worked fine back then.
    Last edited by JAD; 08-12-2009 at 11:14 PM.

  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    It didn't make a difference.

  4. #4
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    It didn't make a difference.
    I edited my post with my version of doing it. It may be because there is a black color there even when it's not loading.

  5. #5
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Unfortunately, it didn't work. I guess I'll just use a Wait function.

  6. #6
    Join Date
    Jun 2007
    Location
    US
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe find the white border as well as black coords inside? Assuming Jagex doesn't mess with the position of the box (or at least leaves it in only a few spots), then you could check that way. Or, try using a DTM?

  7. #7
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I don't think i can trust DTMs, which is why i never used them in the first place. But I'll take a look into it. I have another error to fix.

  8. #8
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    I don't think i can trust DTMs, which is why i never used them in the first place. But I'll take a look into it. I have another error to fix.
    Why can't you trust DTMs? If you took some points of the border and a few inside it would work just as good as counting the amount of black pixels in the box. If you can't trust them because you aren't good at making them or something, post a screen shot of the loading screen and I can help you make one.

  9. #9
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    Why can't you trust DTMs? If you took some points of the border and a few inside it would work just as good as counting the amount of black pixels in the box. If you can't trust them because you aren't good at making them or something, post a screen shot of the loading screen and I can help you make one.
    I can make them, i have in the past. And i will make the DTM in a while, I'm just working out my script at the moment.

  10. #10
    Join Date
    May 2008
    Location
    Oregon, USA
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    A color likely is not best because there is black color in runescape itself. I would recomend using a DTM or set of colors to detect the box. - i hate spongebob

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
  •