NCDS
2011-01-03 19:13:43
Forgot about this for a few days :redface:
Discussion: http://villavu.com/forum/showthread.php?p=763818#post763818
Lazy Note: This will essentially compensate for black screen causing problems for people at login.
I've had this as my LoggedIn function since I originally posted it, no problems.
Also, if this is to be used, someone may want to add an Exit; depending on how you want it to Result, figured I would leave that up to dev's though.
Discussion: http://villavu.com/forum/showthread.php?p=763818#post763818
Lazy Note: This will essentially compensate for black screen causing problems for people at login.
From: NCDS
It seems that the screen loads in sort of 4 boxes that fill the main screen. Either way, if the center of the MS is loaded, the game probably is too.
This little bit here just checks a 40x40px box around MSCx, MSCy, and checks if there are more than 20 occurrences of color '0' (The black of the unloaded RS client). If so, it continues to wait up to 5 seconds.
As you can see it still sets the final Result depending on the original color check.
Side note: I know the explanation probably wasn't necessary, but I felt like I should.
function LoggedIn: Boolean;
var
cx, cy, t: Integer;
begin
t := GetSystemTime + 5000;
while (not (Result)) and (t > GetSystemTime) do
begin
Result := (CountColor(0, MSCx - 20, MSCy - 20, MSCx + 20, MSCy + 20) < 20);
Wait(3);
end;
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
end;
Tested and it worked perfectly fine, though I wasn't really having the problem before, only sometimes.
There may be other ways you would find to be 'better' than this, but I don't see why it wouldn't work.
anyway, let me know your thoughts.
I've had this as my LoggedIn function since I originally posted it, no problems.
Also, if this is to be used, someone may want to add an Exit; depending on how you want it to Result, figured I would leave that up to dev's though.