Gu3st...
2011-03-27 07:45:44
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-14, tp.y-17, tp.x+14, tp.y+14, 10) < 104; // the count is 104 when no icons are overlapping the GameTab.
end;@@ -116,11 +116,8 @@
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);
+ tP := Point(((Tab - 21) mod 8 * 30) + 537, ((Tab - 21) div 8 * 298) + 186);
+ Result := CountColorTolerance(5597817, tp.x-14, tp.y-17, tp.x+14, tp.y+14, 10) < 104;
end;
{*******************************************************************************
This fix was necessary because TabExists didn't work properly on the prayer tab (we had a "if tab = tab_Prayer then" which really isn't the best solution) and didn't work when the tab existed but was highlighted (http://img546.imageshack.us/i/192848543.png/)