SRL Archive - SRL Bugs

LoggedIn Problems..


Heavenguard

2010-08-15 13:37:28


{*******************************************************************************
function LoggedIn: Boolean;
By: WT-Fakawi
Description: Returns True if Logged In.
*******************************************************************************}
function LoggedIn: Boolean;
var
cx, cy: Integer;
begin
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
end;

This function has a good chance that it will return a False even though the player is logged in. Im not saying that its bad, or that it sucks, but it should at least be failsafed to find more things rather then this single color in a box.

Shuttleu

2010-08-15 13:58:20

have you ever found it to return false when your logged in or for it to return true when your not?

it searches for a color only found in that box when your logged in, and it hasnt changed for years, so the chances that it will change or it will fail is very small

~shut

EvilChicken!

2010-08-15 15:03:28

From: Shuttleu
have you ever found it to return false when your logged in or for it to return true when your not?

it searches for a color only found in that box when your logged in, and it hasnt changed for years, so the chances that it will change or it will fail is very small

~shut


^this.
You see, it's vital that it's kept short and efficient, as it is one of SRL's most called functions.
(OF ALL TIME!!)

Heavenguard

2010-08-15 15:04:39

From: Shuttleu
have you ever found it to return false when your logged in or for it to return true when your not?

it searches for a color only found in that box when your logged in, and it hasnt changed for years, so the chances that it will change or it will fail is very small

~shut


Yes. I have never had an altercation when it would return true when im not logged in. However I have had Numerous altercations when it would return a False even when im logged in. For example, in my first script that i made, i made an AutoLogin function and it would simply check if the player is not logged in before starting, but LoggedIn would often give me a False even though I am Loggedin. Another time is today, im making my Alkharid Fisher, Cooker and Banker, but it gave me a False even though I was logged in and then attempted to switch to the next player.

Heres an example of when I had Yush_Dragon testing out the fishing part of my script this morning [He had the Debug constant on]. This was near the end of it.


[19:01:38] Player is using a Net.
[19:01:40] Net is in Inventory
[19:01:46] DDTM Walk Successful for PathNumb(1)
[19:01:50] Found Fishing Spot symbol on the minimap.
[19:01:52] Found no fish pool... Switching Pools...
[19:01:54] Found Fishing Spot symbol on the minimap.
[19:01:55] Length of BubblesTPA = 0
[19:01:55] Found no fish pool... Switching Pools...
[19:02:00] Found Fishing Spot symbol on the minimap.
[19:02:01] Length of BubblesTPA = 0
** Warning in CheckForFishingPool: Could not find a fishing pool, switching areas...**
[19:02:02] Found Fishing Spot symbol on the minimap.
[19:02:07] Length of BubblesTPA = 3
[19:02:07] Length of BubblesATPA = 1
[19:02:08] Found the fishing pool.
[19:02:08] Player found and click the fishing pool
**** leveled up
No Reflection update
No SRL update / Plugins update available!
** Warning in IsFishing: Player is not fishing, finding another pool...**
[19:04:21] Found no fish pool... Switching Pools...
[19:04:25] Found Fishing Spot symbol on the minimap.
[19:04:27] Length of BubblesTPA = 0
** Warning in CheckForFishingPool: Could not find a fishing pool, switching areas...**
[19:04:29] Found Fishing Spot symbol on the minimap.
** Warning in IsFishing: Player is not fishing, finding another pool...**
[19:04:49] Found no fish pool... Switching Pools...
[19:04:57] Found Fishing Spot symbol on the minimap.
[19:04:58] Length of BubblesTPA = 0
** Warning in CheckForFishingPool: Could not find a fishing pool, switching areas...**
[19:05:04] Found Fishing Spot symbol on the minimap.
** Warning in IsFishing: Player is not fishing, finding another pool...**
[19:05:25] Found no fish pool... Switching Pools...
[19:05:26] Found Fishing Spot symbol on the minimap.
[19:05:27] Length of BubblesTPA = 0
[19:05:27] Found no fish pool... Switching Pools...
[19:05:30] Found Fishing Spot symbol on the minimap.
[19:05:31] Length of BubblesTPA = 0
** Warning in CheckForFishingPool: Could not find a fishing pool, switching areas...**
[19:05:34] Found Fishing Spot symbol on the minimap.
** Warning in IsFishing: Player is not fishing, finding another pool...**
[19:06:02] Length of BubblesTPA = 59
[19:06:02] Length of BubblesATPA = 4
[19:06:03] Found the fishing pool.
[19:06:03] Player found and click the fishing pool
[19:06:22] DDTM Walk Successful for PathNumb(2)
[19:06:22] Found Banking Area using DTM for the dots.
[===================================================================================================================]
[ Nick | Active | Worked | Banked | Total Fish | Total EXP from Fishing | Shrimp | Anchovies | Sardines | Herring ]
[===================================================================================================================]
[ ush | True | 01:24:28 | 24 | 702 | 16200 | 396 | 306 | 0 | 0 ]
[===================================================================================================================]
NextPlayer
SwitchToPlayer(PlayerNo: 0, Active: False);
Status: /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
Status: | SRL Randoms Report |
Status: | [url]www.villavu.com[/url] |
Status: |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Status: | SRL Logs : 1 |
Status: \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Status: [=======================================================]
Status: [ Alkharid Fisher [Cooker In Progress] 0.02 ]
Status: [ by Heavenguard ]
Status: [=======================================================]
Status: [ Time Running : 1 Hours, 25 Minutes And 1 Seconds ]
Status: [ Total Players : 1 ]
Status: [ Players Active : 0 ]
Status: [ Current Player : 0 ]
Status: [ Total Fish Caught : 702 ]
Status: [ Total Fishing EXP : 16200 ]
Status: [ Banked : 24 ]
Status: [ Shrimps Caught : 396 ]
Status: [ Anchovies Caught : 306 ]
Status: [ Sardines Caught : 0 ]
Status: [ Herrings Caught : 0 ]
Status: [=======================================================]
Status: [ Alkharid Fisher [Cooker In Progress] 0.02 ]
Status: [=======================================================]
ALL PLAYERS INACTIVE, FISH LOOP FINISHED
Successfully executed.
-He had to do 50 loads.

It switched players because of this line only. NextPlayer is only called on this line in the script and is used to force a switch player if CurrentPlayer is logged out due to an error.

if not LoggedIn then NextPlayer(False);

Yush stated that he watched this script pretty much the whole time, and when it errored he was about to bank, and he did not error and logout. But the script just said NextPlayer and stopped due to no other players being in the array. LoggedIn returned a False even though he was logged in..

EvilChicken!

2010-08-15 15:15:47

By the way, as this is an issue with SRL, post it in this subforum next time. ;)

I'll need confirmation from more people about this.
Are you sure that you're running the RS client with max brightness, fixed screen size and on safe mode?

By the way, it would be nice if a mod could move it to the correct section.

Shuttleu

2010-08-15 15:17:23

well maybe we need to find another static part for it to find, however i have never had it give me a false-positive or false-negative

~shut

Heavenguard

2010-08-15 15:18:20

From: EvilChicken!
By the way, as this is an issue with SRL, post it in this subforum next time. ;)

I'll need confirmation from more people about this.
Are you sure that you're running the RS client with max brightness, fixed screen size and on safe mode?

By the way, it would be nice if a mod could move it to the correct section.


Ahh im so stupid im sorry, I was thinking I should have posted it there T.T, yes mod please move. As for the question, yeah I always need to run RS on those settings when im making a script to ensure im progressing in the right direction. You can try it out with a simple script if you want, just have it repeatedly tell you the Result of LoggedIn and see what you get.

Shuttleu

2010-08-15 15:20:25

From: Heavenguard
Ahh im so stupid im sorry, I was thinking I should have posted it there T.T, yes mod please move. As for the question, yeah I always need to run RS on those settings when im making a script to ensure im progressing in the right direction. You can try it out with a simple script if you want, just have it repeatedly tell you the Result of LoggedIn and see what you get.


was it smart or non-smart?

i want to test

~shut

Heavenguard

2010-08-15 15:29:46

From: Shuttleu
was it smart or non-smart?

i want to test

~shut


The error happens on both. For me it was on Non-Smart and Smart. For yush today it was on Smart.

Thanks to both of you =]

Shuttleu

2010-08-15 15:33:54

well i tested it
i ran this
program new;
{$i srl/srl.scar}

var
i: integer;

begin
while(True) do
begin
writeln('Try# '+IntToStr(i+1)+' Logged in status: '+BoolToStr(LoggedIn));
if (not(LoggedIn)) then
Break;
Inc(i);
end;
Readln('A:');
end.
it got over 20k and didnt return false, it only returned false when i rightclicked on the chatbox above the report abuse button, so maybe your script is clicking there…

~shut

Heavenguard

2010-08-15 15:40:24

From: Shuttleu
well i tested it
i ran this
program new;
{$i srl/srl.scar}

var
i: integer;

begin
while(True) do
begin
writeln('Try# '+IntToStr(i+1)+' Logged in status: '+BoolToStr(LoggedIn));
if (not(LoggedIn)) then
Break;
Inc(i);
end;
Readln('A:');
end.
it got over 20k and didnt return false, it only returned false when i rightclicked on the chatbox above the report abuse button, so maybe your script is clicking there…

~shut


Not at all, I have to ask Yush if his bankscreen was open, but i do not think it moved/rightclicked anywhere there. For me the RS screen can be the same as always and it would return false =/. Thats weird for me then.

-Yush confirmed that the character had just walked into the bank when this happened. Same thing is what my debug report shows.

Update: Ran the same thing you had Shuttle, it returned True for me as well…. I guess theres something im not seeing here. Ill just post this loop up and see if anyone can probably see an error.

{*******************************************************************************
Task Loops
*******************************************************************************}
{MAIN_LOOP_FISH: Completes each players fishing session}
procedure MAIN_LOOP_FISH;
var
CPlayer, Rounds, Stop : Integer;
begin
for CPlayer := 0 to PlayersActive do
begin
if not LoggedIn then LoginPlayer;
Stop := Players[CPlayer].Integers[1];
Wait(RandomRange(4000, 8000)); // Gives some time to load up.
for Rounds := 0 to Stop - 1 do
begin
SetRun(True);
ClickNorth(True);
GetToolsFromBank;
Universal_WalkPath(1);
FindFishingArea;
if Fish_FullInv then
ManageGlobalVariables('Fishing');
MakeCompass('N');
Universal_WalkPath(2);
FindBankingArea;
if Bank_Fish then
ManageGlobalVariables('Banking');
Player_Progress_Report;
if Rounds mod 2 = 0 then Global_Progress_Report;
if not LoggedIn then NextPlayer(False); // <------------BugLine // Gonna make it to Players[CPlayer].Active := False;
if AllPlayersInActive then
begin
Global_Progress_Report;
Writeln('ALL PLAYERS INACTIVE, FISH LOOP FINISHED');
Exit;
end;
end;
end;
end;

NCDS

2010-08-15 17:45:15

Do you perhaps use 'RandomRClick;' as antiban in your BankFish function? That may have covered up the ReportAbuse button causing LoggedIn to fail.

That's pretty much all that comes to mind right now.

Heavenguard

2010-08-15 17:55:36

From: NCDS
Do you perhaps use 'RandomRClick;' as antiban in your BankFish function? That may have covered up the ReportAbuse button causing LoggedIn to fail.

That's pretty much all that comes to mind right now.



case Random(300) of
1..4: RandomRClick;

<.< Its a really small chance of happening… and i mean realllyyy small chance of happening.

EvilChicken!

2010-08-15 18:11:56

I don't get it?

  if (Random(3) > 0) then
Inv := ChooseOption('xamine');
if (not Inv) then ChooseOption('ancel');
^from RandomRClick.

It will anyway remove the opened option menu in one way or another.
Maybe add a small wait of ~500ms after closing menu? Only thing I can come to think of.

mastaraymond

2010-08-18 06:16:21

Moved

BTW: Aren't you just Minimizing/Maximizing SMART? Or you're browser or anything alike? Because in that case Runescape will redraw itself resulting in a short-white-flash, making the script think you're logged out.

Heavenguard

2010-08-18 23:34:19

From: mastaraymond
Moved

BTW: Aren't you just Minimizing/Maximizing SMART? Or you're browser or anything alike? Because in that case Runescape will redraw itself resulting in a short-white-flash, making the script think you're logged out.


Thanks for moving =] Much Appreciated :D, gonna try my best to make a thread in the right section >.<

Nah, nothing like that happened either. It just logged out. You can leave this thread open i guess incase anyone gets any problems later on, as for now the problem has not occurred ever since. Thanks for everything =]

CX gamer

2010-08-19 07:09:02

From: EvilChicken!
I don't get it?

Code:
[LEFT]if (Random(3) > 0) then
Inv := ChooseOption('xamine');
if (not Inv) then ChooseOption('ancel');
[/LEFT]

^from RandomRClick.

It will anyway remove the opened option menu in one way or another.
Maybe add a small wait of ~500ms after closing menu? Only thing I can come to think of.

I think it's like this. Whenever that function is called, there is a 1.002% (3842/38352) it will be over that specific pixel. Not counting the chance of a long menu when there are a lot of players stacked.

Together with your 4/300 chance of calling this function for antiban, it's 0.01335% every time your antiban is called. Meaning that after 7491 antiban calls, you will have 50% chance of a false positive.:sasmokin: