SRL Archive - SRL Archives

GameTab.scar -> GetGameTabCount


HyperSecret

2008-09-04 19:52:26

Well I am using this function for counting GameTabs for antirandoms. NoGameTab kept failing because on free-to-play there is an empty gametab for summoning for pay-to-play.


function GetGameTabCount: Integer;
var
i: Integer;
begin
Result := 0;
for i := 1 to 15 do
if TabExists(i) then Inc(Result);
end;

Nava2

2008-09-05 08:08:19

function TabCount: Byte;

var
i: Byte;

begin
Result := 0;
for i := 1 to 15 do
if TabExists(i) then Inc(Result);
end;

Sorry, I'm a prissy sob for standards.

Bobarkinator

2008-09-05 08:14:15

This is exactly what we don't need. 3 people editing the same function and not changing the functionality at all…

EvilChicken!

2008-09-05 08:49:12

Fine, I'll delete my post.
Bob, I changed the integers to bytes, keeping in mind that there are no more than 15 tabs.
I also added Result := 0 at the start, to reset the result.

All Nava2 did was to add a space.

Bobarkinator

2008-09-08 22:42:49

From: EvilChicken!
Fine, I'll delete my post.
Bob, I changed the integers to bytes, keeping in mind that there are no more than 15 tabs.
I also added Result := 0 at the start, to reset the result.

All Nava2 did was to add a space.


Have you ever tested the speed difference between an integer and a byte? Looks to me after 10,000 times it's 1 ms difference

Gu3st...

2008-09-09 01:56:33

From: Bobarkinator
Have you ever tested the speed difference between an integer and a byte? Looks to me after 10,000 times it's 1 ms difference



Omg that is soo much! if you do it 10,000,000 then it would be 1 sec!!!
Sarcasm…:rolleyes:

Good script, it IS useful.

Wizzup?

2008-09-09 02:19:37

The only thing that needs editing is Initializing the Result, Hyper. The rest is fine. :)