SRL Archive - SRL Bugs

GameTab(tab_Prayer) = no work


TomTuff

2011-03-13 21:33:57

Title says it all :L

Yago

2011-03-13 22:38:01

Try the number instead.

TomTuff

2011-03-13 22:38:47

the constant is a number, it would make no difference. GetCurrentGameTab results in 27 when on the prayer tab, which is the same as tab_Prayer, so it's not detecting it wrong, it's simply not clicking.

Yago

2011-03-13 22:39:54

Ok just checking if maybe the constant was wrong … I haven't tried the prayer tab myself in a while.

footballjds

2011-03-21 13:37:42

From: TomTuff
the constant is a number, it would make no difference. GetCurrentGameTab results in 27 when on the prayer tab, which is the same as tab_Prayer, so it's not detecting it wrong, it's simply not clicking.


BUMP

just almost started a thread with the same title. decided to search first ;)

GameTab(27);
GameTab(tab_Prayer);
DOESN"T WORK
all other gameTab's work…
Need an SRL fix ;)

Gu3st...

2011-03-21 14:38:14

If the people that report bugs also includes a fix for it, then the chances of it being fixed quickly increases greatly :)

Just sayin'

TomTuff

2011-03-21 20:35:54

From: Zyt3x
If the people that report bugs also includes a fix for it, then the chances of it being fixed quickly increases greatly :)

Just sayin'


Maybe if I knew what "mod" and "div" do :garfield:

Gu3st...

2011-03-21 20:39:12

5 div 2 = 2
5 mod 2 = 1

div is how many times it's possible to divide 5 by 2
mod gets what's left after you've done "5 div 2"

TomTuff

2011-03-21 21:03:22

the bug was in TabExists.

Patch:
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) + 536, ((Tab - 21) div 8 * 298) + 187);
if (Tab <> tab_Prayer) then
Result := FindColorTolerance(tP.X, tP.Y, 591881, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15)
else
Result := FindColorTolerance(tP.X, tP.Y, 16448761, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;

Gu3st...

2011-03-21 21:06:20

function TabExists2(Tab: Integer): Boolean;
var
tP: TPoint;
srcCol : Integer;
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;

case Tab of
tab_Prayer: srcCol := 16448761;
else
srcCol := 591881;
end;

tP := Point(((Tab - 21) mod 8 * 30) + 536, ((Tab - 21) div 8 * 298) + 187);
Result := FindColorTolerance(tP.X, tP.Y, srcCol, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;
:)

Harry

2011-03-21 21:19:59

From: Zyt3x
If the people that report bugs also includes a fix for it, then the chances of it being fixed quickly increases greatly :)

Just sayin'

I wish the same happened to me… :(

Train

2011-03-22 00:11:37

  if (Tab <> tab_Prayer) then
Result := FindColorTolerance(tP.X, tP.Y, 591881, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15)
else
Result := FindColorTolerance(tP.X, tP.Y, 16448761, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;

  case Tab of
tab_Prayer: srcCol := 591881;
else
srcCol := 16448761;
end;

Am I the only one that sees something wrong here? o.o

TomTuff

2011-03-22 00:27:29

From: Train
  if (Tab <> tab_Prayer) then
Result := FindColorTolerance(tP.X, tP.Y, 591881, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15)
else
Result := FindColorTolerance(tP.X, tP.Y, 16448761, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;

  case Tab of
tab_Prayer: srcCol := 591881;
else
srcCol := 16448761;
end;

Am I the only one that sees something wrong here? o.o


What? It's just two different ways to do the same thing.

Train

2011-03-22 00:30:24

  if (Tab <> tab_Prayer) then
Result := FindColorTolerance(tP.X, tP.Y, 591881, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15)
else
Result := FindColorTolerance(tP.X, tP.Y, 16448761, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;
If Tab is not equal to tab_Prayer, color is 591881.
Else (it's equal), color is 16448761.

  case Tab of
tab_Prayer: srcCol := 591881;
else
srcCol := 16448761;
end;
If Tab is equal to tab_Prayer, color is 591881.
Else, it's not equal, color is 16448761.

TomTuff

2011-03-22 00:37:37

From: Train
  if (Tab <> tab_Prayer) then
Result := FindColorTolerance(tP.X, tP.Y, 591881, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15)
else
Result := FindColorTolerance(tP.X, tP.Y, 16448761, tP.X - 12, tP.Y - 12, tP.X + 12, tP.Y + 12, 15);
end;
If Tab is not equal to tab_Prayer, color is 591881.
Else (it's equal), color is 16448761.

  case Tab of
tab_Prayer: srcCol := 591881;
else
srcCol := 16448761;
end;
If Tab is equal to tab_Prayer, color is 591881.
Else, it's not equal, color is 16448761.


I'm right he's wrong neener neener. Someone just commit it? lol

Gu3st...

2011-03-22 08:09:54

No actually, that was a mistake on my part

Thanks Train :)

Coh3n

2011-03-22 15:15:05

Committed.