SRL Archive - SRL Bugs

Tab 21 & 27


RISK

2011-12-08 07:55:30

Is it just me or are these broken?
Using this:
program new;
{$i SRL/SRL.scar}

procedure Test;
var
I : Integer;
begin
for I := 21 to 37 do
begin
if (TabExists(I)) then
GameTab(I);
end;
end;

begin
SetupSRL;
ActivateClient;
Wait(1500);
Test;
end.

grats

2011-12-08 08:03:54

GameTab(21); works fine in my script

prayer tab right?

RISK

2011-12-08 08:04:54

21 = Combat and 27 = prayer. They refuse to work for me for some reason.

From: grats
GameTab(21); works fine in my script

prayer tab right?

grats

2011-12-08 08:07:54

oh yea my bad, I use both those in my script (strange that the only two I use in my script are the ones that give you problems)

I don't have it check if the tab exists though, maybe tab exists is having problems with the combat & prayer tabs?


try without the if statement

RISK

2011-12-08 08:09:38

Well try running this and see if it works for you, please:
program new;
{$i SRL/SRL.scar}

procedure Test;
var
I : Integer;
begin
for I := 21 to 37 do
begin
if (GameTab(I)) then
begin
WriteLn('Tab ' + ToStr(I) + ' exists.');
end else
WriteLn('Tab ' + ToStr(I) + ' does not exist.');

Wait(150);
end;
end;

begin
SetupSRL;
ActivateClient;
Wait(1500);
Test;
end.

Set your client to Runescape, of course. Also see if you have the latest SRL, please.

grats

2011-12-08 08:11:22

yea worked fine for me, all the way through the tabs



SRL Compiled in 62 msec
Tab 21 exists.
Tab 22 exists.
Tab 23 exists.
Tab 24 exists.
Tab 25 exists.
Tab 26 exists.
Tab 27 does not exist.
Tab 28 exists.
Tab 29 does not exist.
Tab 30 exists.
Tab 31 exists.
Tab 32 exists.
Tab 33 exists.
Tab 34 exists.
Tab 35 exists.
Tab 36 exists.
Tab 37 exists.
Successfully executed.

it clicked all the tabs though

RISK

2011-12-08 08:14:28

I probably need to add a small wait at the end of the for loop.

Is your SRL updated?

grats

2011-12-08 08:15:14

From: RISK
I probably need to add a small wait at the end of the for loop.

Is your SRL updated?


yea all my stuff is fully updated

RISK

2011-12-08 08:30:06

How strange… What's your TabExists like? If you don't mind. Here's mine:
function TabExists(Tab: Integer): Boolean;
var
tP: TPoint;
begin
Result := false;
if (not loggedIn) then
exit;

if (tab < 20) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not using the new constants! Please upgrade your script.', warn_AllVersions);
Exit;
end;

if (not(InRange(Tab, Tab_Combat, Tab_LogOut))) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not a valid tab number.', warn_AllVersions);
Exit;
end;

if (Tab = tab_LogOut) then
begin
Result := (GetColor(746, 0) = 65536);
Exit;
end;

tP := Point(((Tab - 21) mod 8 * 30) + 537, ((Tab - 21) div 8 * 298) + 186);
Result := CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10) < 81; // the count when no icons are overlapping the GameTab.
end;

grats

2011-12-08 08:32:39

{*******************************************************************************
function TabExists(Tab: Integer): Boolean;
By: ZephyrsFury & IceFire908; fixed by Zyt3x
Description: Returns True if the Tab exists.
*******************************************************************************}
function TabExists(Tab: Integer): Boolean;
var
tP: TPoint;
begin
Result := false;
if (not loggedIn) then
exit;

if (tab < 20) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not using the new constants! Please upgrade your script.', warn_AllVersions);
Exit;
end;

if (not(InRange(Tab, Tab_Combat, Tab_LogOut))) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not a valid tab number.', warn_AllVersions);
Exit;
end;

if (Tab = tab_LogOut) then
begin
Result := (GetColor(746, 0) = 65536);
Exit;
end;

tP := Point(((Tab - 21) mod 8 * 30) + 537, ((Tab - 21) div 8 * 298) + 186);
Result := CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10) < 81; // the count when no icons are overlapping the GameTab.
end;


both identical

Gu3st...

2011-12-08 08:45:46

Could you add this at the end of the function and test it again?
WriteLn(CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10));

RISK

2011-12-08 08:50:35

Compiled successfully in 562 ms.
SRL Compiled in 15 msec
92
Tab 21 does not exist.
7
Tab 22 exists.
43
Tab 23 exists.
54
Tab 24 exists.
51
Tab 25 exists.
78
Tab 26 exists.
81
Tab 27 does not exist.
43
Tab 28 exists.
81
Tab 29 does not exist.
55
Tab 30 exists.
65
Tab 31 exists.
66
Tab 32 exists.
61
Tab 33 exists.
42
Tab 34 exists.
53
Tab 35 exists.
74
Tab 36 exists.
Tab 37 exists.
Successfully executed.

Added the WriteLn as you requested.

grats

2011-12-08 08:50:37

From: Zyt3x
Could you add this at the end of the function and test it again?
WriteLn(CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10));


Compiled successfully in 1155 ms.
SRL Compiled in 47 msec
56
Tab 21 exists.
53
Tab 22 exists.
45
Tab 23 exists.
54
Tab 24 exists.
51
Tab 25 exists.
78
Tab 26 exists.
81
Tab 27 does not exist.
43
Tab 28 exists.
81
Tab 29 does not exist.
55
Tab 30 exists.
65
Tab 31 exists.
66
Tab 32 exists.
61
Tab 33 exists.
42
Tab 34 exists.
53
Tab 35 exists.
74
Tab 36 exists.
Tab 37 exists.
Successfully executed.

Gu3st...

2011-12-08 09:13:05

Easy fix, change "< 81" to "<= 81".

RISK, are you sure all your settings are correct? Highest brightness, fixed size and 32-bit color? If you are 100% sure about those things, then maybe JaGeX has started dynamically changing tab colors too, now….

Could you guys do some testing? reload RuneScape, reload worlds and so on, see if the color changes (or the number before "tab X exists.")
I'm at school atm so I can't test.. :/

RISK

2011-12-08 09:16:57

Here's my settings:

I'll gladly test it, hold on.

E: First world I go to, it decides to work:
Compiled successfully in 546 ms.
SRL Compiled in 16 msec
56
Tab 21 exists.
53
Tab 22 exists.
45
Tab 23 exists.
54
Tab 24 exists.
51
Tab 25 exists.
78
Tab 26 exists.
81
Tab 27 exists.
66
Tab 28 exists.
81
Tab 29 does not exist.
55
Tab 30 exists.
65
Tab 31 exists.
66
Tab 32 exists.
61
Tab 33 exists.
42
Tab 34 exists.
53
Tab 35 exists.
74
Tab 36 exists.
Tab 37 exists.
Successfully executed.

E2: I changed my max screen size to "Any" before I tested and it worked… Maybe it really was my settings? If so, I'm sorry. :duh:

E3: I tried it on a different character and it gave me this:
Compiled successfully in 546 ms.
SRL Compiled in 16 msec
92
Tab 21 does not exist.
7
Tab 22 exists.
43
Tab 23 exists.
54
Tab 24 exists.
51
Tab 25 exists.
78
Tab 26 exists.
81
Tab 27 exists.
66
Tab 28 exists.
81
Tab 29 does not exist.
55
Tab 30 exists.
65
Tab 31 exists.
66
Tab 32 exists.
61
Tab 33 exists.
42
Tab 34 exists.
53
Tab 35 exists.
74
Tab 36 exists.
Tab 37 exists.
Successfully executed.

From: Zyt3x
Easy fix, change "< 81" to "<= 81".

RISK, are you sure all your settings are correct? Highest brightness, fixed size and 32-bit color? If you are 100% sure about those things, then maybe JaGeX has started dynamically changing tab colors too, now….

Could you guys do some testing? reload RuneScape, reload worlds and so on, see if the color changes (or the number before "tab X exists.")
I'm at school atm so I can't test.. :/

grats

2011-12-08 09:24:48

identical settings except my max size is 800x600 though, only difference

works the same for me on all worlds, gotta go to work gl trying to figure this out, might be able to sneak in while at work

RISK

2011-12-08 09:30:45

Interest piece of information… The character it works on has been made for a while and has skills trained. The character it does not work on has not been trained and was made under 2 hours ago for HLR.

Maybe that has something to do with it?

Gu3st...

2011-12-08 09:32:48

It doesn't really look dynamic to me, but I'm worried about that
"92
Tab 21 does not exist." …

Was there any difference between the tabs? Maybe we only have to change the colorcount number…

RISK

2011-12-08 09:36:08

Trained account's tabs:

Non-trained account's tabs:

It looks like the glow from the task list tab is confusing it.

E: Actually the trained account's whole tab interface looks darker than the non-trained account's. Or maybe it's my half-asleep imagination.

Wyn

2011-12-08 10:05:23

From: RISK
Trained account's tabs:
[picture was here]

Non-trained account's tabs:
[picture was here]

It looks like the glow from the task list tab is confusing it.

E: Actually the trained account's whole tab interface looks darker than the non-trained account's. Or maybe it's my half-asleep imagination.


Compared the brightest shade of yellow of the clan icon with both pictures….No change.

Gu3st...

2011-12-08 10:12:39

From: RISK
E: Actually the trained account's whole tab interface looks darker than the non-trained account's. Or maybe it's my half-asleep imagination.
Yes, I see this too.

We'll have to re-do TabExists() (and perhaps some other functions)
Unfortunately I do not have any time to do this at all until ~Tuesday next week (5 days from now) :/

You could try to fix them yourself? :) You'd get your name in the include and most importantly you'll get more respect from the higher boards ;)

RISK

2011-12-08 10:56:57

Sure, I'll have a go! Seems like a fun challenge! :)

TabExists fix:

{*******************************************************************************
function TabExists(Tab: Integer): Boolean;
By: ZephyrsFury & IceFire908; fixed by Zyt3x; fixed again by RISK
Description: Returns True if the Tab exists.
*******************************************************************************}
function TabExists(Tab: Integer): Boolean;
var
tP: TPoint;
begin
Result := false;
if (not loggedIn) then
exit;

if (tab < 20) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not using the new constants! Please upgrade your script.', warn_AllVersions);
Exit;
end;

if (not(InRange(Tab, Tab_Combat, Tab_LogOut))) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not a valid tab number.', warn_AllVersions);
Exit;
end;

if (Tab = tab_LogOut) then
begin
Result := (GetColor(746, 0) = 65536);
Exit;
end;

tP := Point(((Tab - 21) mod 8 * 30) + 537, ((Tab - 21) div 8 * 298) + 186);
Result := CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10) <= 92; // the count when no icons are overlapping the GameTab.
end;

Compiled successfully in 531 ms.
SRL Compiled in 16 msec
Tab 21 exists.
Tab 22 exists.
Tab 23 exists.
Tab 24 exists.
Tab 25 exists.
Tab 26 exists.
Tab 27 exists.
Tab 28 exists.
Tab 29 exists.
Tab 30 exists.
Tab 31 exists.
Tab 32 exists.
Tab 33 exists.
Tab 34 exists.
Tab 35 exists.
Tab 36 exists.
Tab 37 exists.
Successfully executed.

Kyle Undefined

2011-12-08 11:03:04

Good work RISK :)

RISK

2011-12-08 11:22:27

Thank you, sir. :) It means a lot.

Gu3st...

2011-12-08 12:36:41

Have you tested this on tabs where there is no icon?
I found the number 81 (The number that were there before) by counting the pixels of that color with that tolerance when no icons were on top of it. I.E that number will always be lower when an icon is on top of it so that why the < 81 is there.

So just increasing that number will often give false positives, which we do not want

Coh3n

2011-12-08 13:10:14

RISK, nice job. :) Can you post the .diff please?

RISK

2011-12-08 18:06:17

@ Zyt3x : You were right. It did provide false-positives when there were no tabs. I'm sorry for that.

@ Coh3n : I am embarrassed to say this, but I do not know what a .diff is. Could you explain it, please?

Here's fix #2:
{*******************************************************************************
function TabExists(Tab: Integer): Boolean;
By: ZephyrsFury & IceFire908; fixed by Zyt3x; fixed again by RISK
Description: Returns True if the Tab exists.
*******************************************************************************}
function TabExists(Tab: Integer): Boolean;
var
dif: Integer;
tP: TPoint;
begin
Result := false;
if (not loggedIn) then
exit;

if (tab < 20) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not using the new constants! Please upgrade your script.', warn_AllVersions);
Exit;
end;

if (not(InRange(Tab, Tab_Combat, Tab_LogOut))) then
begin
SRL_Warn('TabExists', 'Tab ' + IntToStr(Tab) + ' is not a valid tab number.', warn_AllVersions);
Exit;
end;

if (Tab = tab_LogOut) then
begin
Result := (GetColor(746, 0) = 65536);
Exit;
end;

if (Tab = 21) or (Tab = 23) then
begin
dif := 92;
end else
dif := 81;

tP := Point(((Tab - 21) mod 8 * 30) + 537, ((Tab - 21) div 8 * 298) + 186);
Result := CountColorTolerance(5597817, tp.x-12, tp.y-12, tp.x+12, tp.y+12, 10) <= dif; // the count when no icons are overlapping the GameTab.
end;

E: I imagine that's a very "Hacky" fix it for it, but I was not able to find a color that worked properly for both the non-trained and the trained accounts.

Coh3n

2011-12-08 18:24:51

A .diff is a file that shows the differences between one version and another. I usually get them from TortoiseGit/SVN, but I'm guessing you use the updater to get SRL files? I can just plug it into my repository to see the diff, no big deal. :)

Thanks for the fix, but I'm still confused as to why this was only happening to you. Grats said everything worked fine for him? Or did it not work sometimes when you reloaded the client?

RISK

2011-12-08 18:26:45

Don't commit that fix, please. I'm still playing around with it.
Yeah, I use the updater to get the files.

It was only happening to me because I had a skill level under about 60, it would make the "Task list" glow, I think and confuse it. Littma was experiencing the same issue on their own new character.

From: Coh3n
A .diff is a file that shows the differences between one version and another. I usually get them from TortoiseGit/SVN, but I'm guessing you use the updater to get SRL files? I can just plug it into my repository to see the diff, no big deal. :)

Thanks for the fix, but I'm still confused as to why this was only happening to you. Grats said everything worked fine for him? Or did it not work sometimes when you reloaded the client?

Coh3n

2011-12-08 18:29:38

Ohh the task list is always illuminated on low level players? Didn't know that.

RISK

2011-12-08 18:44:59

I'm not sure how you'd detect if the illuminated task list tab exists or not without remaking the whole TabExists function.

Coh3n

2011-12-08 20:35:59

There's no way to "de-illuminate" it? Lol.

RISK

2011-12-08 20:38:47

The only way to "de-illuminate" it is to get a total level over 60 or so. I don't know the exact level, but. I think the whole function will have to be rewritten.

Coh3n

2011-12-08 21:04:58

I'm sure it can be done. ;)

Kyle Undefined

2012-01-13 16:27:03

Sorry for the bump, but I think they changed this illumination effect of the tab. I have no accounts under 60 total levels to test this on so I created a new one, no skills trained and it doesn't have this illuminated tab.

I've reloaded the client, switched browsers, and still nothing. RISK, maybe test this again on the account that was doing this?

Narcle

2012-01-13 16:29:22

I did update TabExists since this.

Kyle Undefined

2012-01-13 16:30:21

But the tab isn't illuminated on the new account, wasn't that the issue that was messing up the "TabExists"?