Harry
2008-05-11 21:27:42
I was really bored today, so I wrote this up. It is GameTab with a loooot more randomness, and it has never misclicked for me :) Try it out! Hopefully this can be added into SRL :D
Thanks for reading…
~ Harry
{*******************************************************************************
function GameTab(tabnumber: Integer): Boolean;
By: Mr. Clown
Description: Switches between tabs.
*******************************************************************************}
function GameTab(tabnumber: Integer): Boolean;
var
c,t,tx,ty: Integer;
begin
if ((Tabnumber < 1) or (TabNumber > 15)) then
begin
srl_Warn('GameTab', IntToStr(tabnumber) + ' is not a valid GameTab', warn_AllVersions);
Result := False;
Exit;
end;
if not TabExists(tabnumber) then
begin
srl_Warn('GameTab', IntToStr(tabnumber) + ' does not exist', warn_AllVersions);
Result := False;
Exit;
end;
if tabnumber <> GetCurrentTab then
case Tabnumber of
1: MouseBox(528,171,554,198,3);
2: MouseBox(564,171,589,198,3);
3: MouseBox(598,171,622,198,3);
4: MouseBox(630,171,653,198,3);
5: MouseBox(663,171,687,198,3);
6: MouseBox(696,171,720,198,3);
7: MouseBox(729,171,760,198,3);
8: MouseBox(564,469,590,499,3);
9: MouseBox(597,469,622,499,3);
10: MouseBox(629,469,656,499,3);
11: MouseBox(662,469,689,499,3);
12: MouseBox(696,469,721,499,3);
13: MouseBox(729,469,758,499,3);
14: MouseBox(743,3,762,23,3);
15: MouseBox(527,469,555,499,3);
end;
while not(GetCurrentTab = tabnumber) and (c < 4) do
Begin
GetMousePos(tx,ty);
Mouse(tx,ty,0,0,True); // MouseBox has already added randomness ;)
Inc(c);
Wait(Random(100));
end;
t := GetCurrentTab;
Result := (t = tabnumber);
if t <> Tabnumber then
srl_Warn('GameTab', 'Failed to switch to tab'+ IntToStr(tabnumber), warn_AllVersions);
end;Thanks for reading…
~ Harry