SRL Archive - MSI Suggestions

TTrack - Success Tracker


Sir R. M8gic1an

2010-09-15 07:22:32

So I've been working on TrackObject, and I wanted to see how successful it was. And then it came to my mind that this could probably be used around MSI more often, be quite a nice feature and it would help us set a success target.


type
TTrack = record
Name: string;
Searches: integer;
Successes: integer;
end;

const
T_TrackObject = 0;

TRACK_ITEMS = 0;

var
Tracking: array[0..TRACK_ITEMS] of TTrack;

Procedure Track_Search(which: integer);
begin
Inc(Tracking[which].Searches)
end;

Procedure Track_Success(which: integer);
begin
Inc(Tracking[which].Successes);
end;

Procedure Track_Print(which: integer);
begin
writeln('~ Track Record');
writeln('~ ~ ' + Tracking[which].Name);
writeln('~ ~ Searches: ' + IntToStr(Tracking[which].Searches));
writeln('~ ~ Successes: ' + IntToStr(Tracking[which].Successes));
writeln('~ ~ Success %: ' + FloatToStr(Tracking[which].Successes * 100 / Tracking[which].Searches));
end;

Procedure Track_PrintAll;
var
i: integer;
begin
for i := TRACK_ITEMS DownTo 0 do
Track_Print(i);
end;

Of course what I had made for TrackObject was not this big, but I think this would be a better way to do it :)
And I am satisfied to say that my currect TrackObject is on 74%, but however I want it up at 85%.

What do you guys think?

~RM

Coh3n

2010-09-15 13:37:20

So it's just keeping track of how well it's working? Seems fine to me. :)

Sir R. M8gic1an

2010-09-17 05:05:25

Committed. Go ahead and use it on anything you want.


[00:35:05]: ~ Track Record
[00:35:05]: ~ ~ TrackObject
[00:35:05]: ~ ~ Searches: 90
[00:35:05]: ~ ~ Successes: 63
[00:35:05]: ~ ~ Success %: 70

~RM

Coh3n

2010-09-17 16:02:47

From: Sir R. Magician
Committed. Go ahead and use it on anything you want.


[00:35:05]: ~ Track Record
[00:35:05]: ~ ~ TrackObject
[00:35:05]: ~ ~ Searches: 90
[00:35:05]: ~ ~ Successes: 63
[00:35:05]: ~ ~ Success %: 70

~RM

Awesome, did you not have time for Script/Procedure headers, or did you just completely forget? :p

E: Also why not use MSI_Debugs? This just looks awful and confusing.

[0:02:53]: [ Ora ] -------------------- 9 objects found!
[0:02:54]: [ Ora ] -------------------- Track Object
[0:02:55]: ~ Track Record
[0:02:55]: ~ ~ TrackObject
[0:02:55]: ~ ~ Searches: 8
[0:02:55]: ~ ~ Successes: 8
[0:02:55]: ~ ~ Success %: 100
[0:02:55]: [ Ora ] -------------------- MSI_FindObjectsIn: True
[0:02:56]: [ Ora ] -------------------- MSI_WaitWhileMining
I said this on the other thread too, but an MSI_CloseHeader is getting missed somewhere, causing the debug level to steadily increase.

Sir R. M8gic1an

2010-09-19 07:00:28

I make it use MSI Debug, and I completely forgot about the headers :p

~RM