SRL Archive - SRL Archives

procedure OpenTabByKey(WhichTab: Integer);


JAD

2007-06-26 14:40:05


{*****************************************************************
procedure OpenTabByKey(WhichTab: Integer);
By: JAD
Description: Opens tab by pressing the hot keys. Just pick the
tab number like you would for GameTab. 14 is to set run.
*****************************************************************}

procedure OpenTabByKey(WhichTab: Integer);
var TheKey: Integer;
begin
if(not(LoggedIn))then
Exit;
TheKey := 0;
case WhichTab of
1: TheKey := 112;
2: TheKey := 113;
3: TheKey := 114; //quest
4: TheKey := 27;
5: TheKey := 115;
6: TheKey := 116;
7: TheKey := 117;
8: TheKey := 119; //friends
9: TheKey := 120;
11: TheKey := 121;
12: TheKey := 122; //options
13: TheKey := 123;
14: TheKey := 17;
end;
if(TheKey = 0)then
Exit;
if(TheKey = 17)then
begin
KeyDown(17);
wait(120+random(100));
KeyUp(17);
wait(100+random(50));
Exit;
end;
if(TabExists(WhichTab))then
begin
KeyDown(TheKey)
wait(120+random(100));
KeyUp(TheKey);
wait(100+random(50));
end;
end;

Try it out! :)

Enjoy! :)

~JAD.

the scar noob

2007-06-26 14:45:22

lol, what's the purpose of this? :)

Sumilion

2007-06-26 14:46:42

Opening a GameTab through the new hotkeys.

the scar noob

2007-06-26 14:51:17

From: Sumilion
Opening a GameTab through the new hotkeys.


yea i know but whynot just using GameTab(numer); ?
btw what about those new hotkeys?

Wizzup?

2007-06-26 14:56:15

I made this already. :p

You need more failsafes!
If tabexists! If LoggedIn!

JAD

2007-06-26 15:48:33

From: Wizzup?
I made this already. :p

You need more failsafes!
If tabexists! If LoggedIn!


Lol, ok :p I made it in 2 minutes and was rushing cause I needed to get off :p

Edit: There, added :p

And where did you post yours Wizzup? ?

Janilabo

2007-06-26 15:53:18

+ JAD, you wouldn't anyways need this part:

  if(TheKey = 0)then
Exit;

as you could just do this:

case WhichTab of
// stuff here..
else
Exit;
end

just easier way. :stirthepot:

JAD

2007-06-26 15:55:24

From: LaBo
+ JAD, you wouldn't anyways need this part:

  if(TheKey = 0)then
Exit;

as you could just do this:

case WhichTab of
// stuff here..
else
Exit;
end

just easier way. :stirthepot:


I know :p I thought my way was more cool and unique :)

But you're right, I could have done that. The first idea for making it exit if you picked the wrong tab was that so that's why I did it :) Thanks though.

Janilabo

2007-06-26 15:57:38

Ahhhh, I see.. :p

No problemos :)

Starblaster100

2007-06-26 17:49:11

[php]
{*****************************************************************
procedure OpenTabByKey(WhichTab: Integer);
By: JAD
Description: Opens tab by pressing the hot keys. Just pick the
tab number like you would for GameTab. 14 is to set run.
*****************************************************************}

procedure OpenTabByKey(WhichTab: Integer);
var
TheKey: Integer;
begin
if(not(LoggedIn))then Exit;
case WhichTab of
1: TheKey := 112;
2: TheKey := 113;
3: TheKey := 114; //quest
4: TheKey := 27;
5: TheKey := 115;
6: TheKey := 116;
7: TheKey := 117;
8: TheKey := 119; //friends
9: TheKey := 120;
11: TheKey := 121;
12: TheKey := 122; //options
13: TheKey := 123;
14: TheKey := 17;
else Exit;
end;
if(TabExists(WhichTab)) or (TheKey = 17) then
begin
KeyDown(TheKey)
wait(120+random(100));
KeyUp(TheKey);
wait(100+random(50));
end;
end;
[/php]

Bit more optimized for you.

JAD

2007-06-26 18:01:25

From: Starblaster100
[php]
{*****************************************************************
procedure OpenTabByKey(WhichTab: Integer);
By: JAD
Description: Opens tab by pressing the hot keys. Just pick the
tab number like you would for GameTab. 14 is to set run.
*****************************************************************}

procedure OpenTabByKey(WhichTab: Integer);
var
TheKey: Integer;
begin
if(not(LoggedIn))then Exit;
case WhichTab of
1: TheKey := 112;
2: TheKey := 113;
3: TheKey := 114; //quest
4: TheKey := 27;
5: TheKey := 115;
6: TheKey := 116;
7: TheKey := 117;
8: TheKey := 119; //friends
9: TheKey := 120;
11: TheKey := 121;
12: TheKey := 122; //options
13: TheKey := 123;
14: TheKey := 17;
else Exit;
end;
if(TabExists(WhichTab)) or (TheKey = 17) then
begin
KeyDown(TheKey)
wait(120+random(100));
KeyUp(TheKey);
wait(100+random(50));
end;
end;
[/php]

Bit more optimized for you.


Whoops :) Didn't think to do that with the TabExists or TheKey = 17, thanks :D