Sandstorm
2008-10-28 22:38:15
{*******************************************************************************
function GameTab(tabnumber: Integer): Boolean;
By: Starblaster100 - Edited by Sandstorm to use a random selection of hotkeys or mouse (1-7)
Description: Switches between tabs.
*******************************************************************************}
function GameTab(tabnumber: Integer): Boolean;
var
c, x: Integer;
Coords: TPoint;
begin
if ((Tabnumber < 1) or (TabNumber > 15)) then
begin
Result := False;
Exit;
end;
if not TabExists(tabnumber) then
begin
exit;
end else if (tabnumber <= 7) then
Case 2-random(2) of
1: begin
KeyDown(111+Tabnumber)
wait(30+random(40))
KeyUp(111+Tabnumber)
wait(300+random(250))
end;
2: begin
Coords := Point(540 + ((tabnumber -1) * 33), 185);
Mouse(Coords.x, Coords.y, 8, 8, true);
end;
end else if (tabnumber = 14) then
Coords := Point(752, 12)
else if (tabnumber = 15) then
Coords := Point(538, 485)
else
Coords := Point(540 + ((tabnumber mod 7) * 33), 485);
while not(GetCurrentTab = tabnumber) and (c < 4) do
Begin
Mouse(Coords.x, Coords.y, 8, 8, true);
Inc(c);
end;
Result := (GetCurrentTab = tabnumber);
end;
What it does:
Randomly chooses whether to use the mouse or a hotkey, then applies it's choice.
Advantages (This is MY opinion!):
Looks more like a human. I find a lot of people use hotkeys, and I personally do as well. I found in my clan that at least 50-75% used hotkeys.
Any feedback? Also, is there a way to time how long you hold a key down? I'd like to edit the waits :P.