SRL Archive - Help and Support

Switching GameTab function Wait Times


IronTeapot

2006-12-13 16:21:13

On line 124 of GameTab.Scar it says


Wait(300 + Random(300)); //DON'T CHANGE THIS.

How come?

Boreas

2006-12-13 16:55:58

Maybe its needed for the tab to load before using the tab. Like if you have a gametab(4); followed by a useitem(1);.

IronTeapot

2006-12-13 17:05:19

Humm… good thinking, it has to wait for it to turn red so it doesent keep checking and clicking while the game itself if changing it.

WT-Fakawi

2006-12-13 17:08:11

It had something to do with an old xxKanexx modification to gametab. And yes 300-600 msec it usually takes to build up the screen, only at frst load. There is room for improvement in everything :)

tarajunky

2006-12-13 17:37:35

About 6 months ago I suggested that we make these types of functions recursive, but it never really happened.

I thought it should look like this.


procedure Gametab(x)
begin
if not(LoggedIn) then exit;
if (TabExists(x)) then //Make sure it's actually there using getcolor
begin
if (AlreadySelected) then exit; //See if it's already selected using getcolor
Mouse(blah,blah,blah,blah);
Wait(blah blah);
if not(AlreadySelected) then GameTab(x);
end;
end;

The benefit of using this type of recursion here is that you will never miss a tab click (or selecting the right combat type, or setting your run on, etc). And I don't personally see any additional risk because if you somehow get stuck in a loop trying to select a missing Gametab you won't actually click it, and will just log out due to inactivity.

IronTeapot

2006-12-13 17:45:03

So since its not first load for me anymore, there is really no harm in lessening the time?

Yakman

2006-12-14 02:20:41

i dont think so, in the dev SRL its already commented out and it works fine, no reason you cant change it