@ 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.