Simba Code:
function FKeyGameTab(Tab: Integer): Boolean;
var
T, Key: Integer;
begin
case Tab of
tab_Inv: Key := VK_F1;
tab_Equip: Key := VK_F2;
tab_Prayer: Key := VK_F3;
tab_Magic: Key := VK_F4;
tab_Equip: Key := VK_F5;
else
begin
srl_Warn('FKeyGameTab', 'tab was not valid to fkey to. Using gametab instead.', warn_AllVersions);
Result := GameTab(Tab);
Exit;
end;
end;
T := GetSystemTime + 3000;
KeyDown(Key);
while not(Result) and (T <= GetSystemTime) do
begin
Wait(100 + Random(50));
Result := (GetCurrentTab = Tab);
end;
KeyUp(Key);
Wait(100 + Random(50));
end;
I've used this