SRL Archive - SRL Development and Help

reports.simba


Coh3n

2013-04-14 21:42:56

@Ollybest; mentioned on another thread (or on IRC) that people still use the SRL player reports in /misc/reports.simba, and that it would fit nicely in debug.simba. I agree, but don't particularly like how they're written. They are very long and tough to follow.

I was was hoping we could come up with some ideas of how to make them simpler. Maybe we should completely remove them? All opinions are welcome. :)

At the very least I think they should be split up + add a couple cool things:

  • scriptReport(); ~ The script progress (i.e. time running, players active, etc.).
  • playerReportShort();
  • playerReportLong();
  • progressReport(); ~ Prints all three of the above reports.
  • Option to save to file where file path is set by the scripter (can be saved to SRL-6/reports/ or SRL-6/logs/ by default).
  • Specify the border character. Right now it's always "[" and "]".
Any other ideas or opinions? If you think we should just remove it, please say so. :)

Cheers,
Cohen

Olly

2013-04-14 21:48:28

What would be the difference between playerReportShort & long?

I very much like the idea of having srl6/reports file to store them in, and i think we should keep them, there extremely useful.

Coh3n

2013-04-14 22:01:43

From: Ollybest
What would be the difference between playerReportShort & long?

I very much like the idea of having srl6/reports file to store them in, and i think we should keep them, there extremely useful.
The difference:


{ SRLPlayerReport - short example
[=======================================================================================]
[ Nick | Active | Worked | Banked | Loc | fishes | Responses | FishType ]
[=======================================================================================]
[ Rasta Magician | True | 20:10:56 | 43 | lumby | 26 | 162 | trout ]
[ Wizzup? | False | 25:25:53 | 83 | draynor | 99 | 190 | shrimps ]
[ WT-Fakawi | True | 11:37:37 | 55 | draynor | 68 | 122 | shrimps ]
[ Hobbit | False | 24:17:35 | 31 | lumby | 14 | 198 | trout ]
[ Nielsie95 | True | 21:04:37 | 24 | draynor | 2 | 192 | shrimps ]
[ ------------------------------------------------------------------------------------- ]
[ ZephyrsFury | False | 06:12:55 | 0 | draynor | 48 | 168 | shrimps ]
[ Boreas | True | 18:52:54 | 77 | lumby | 94 | 144 | trout ]
[ Sumilion | False | 15:39:55 | 70 | draynor | 82 | 137 | shrimps ]
[ The Claw | False | 17:44:36 | 24 | lumby | 9 | 153 | trout ]
[ Tarajunky | False | 14:31:38 | 18 | draynor | 97 | 146 | shrimps ]
[ ------------------------------------------------------------------------------------- ]
[ Ray | False | 27:11:36 | 94 | lumby | 43 | 122 | trout ]
[ Nava2 | False | 99:59:59 | 86145 | guild | 167854 | 9999785 | SHARK ]
[=======================================================================================]
}

{ SRLPlayerReport - long example
[=========================]
[ Rasta Magician ]
[ Active : True ]
[ Worked : 20h 10m 56s ]
[ Banked : 43 ]
[ Location : lumby ]
[ fishes : 26 ]
[ Responses : 162 ]
[ FishType : trout ]
[=========================]
[ Wizzup? ]
[ Active : False ]
[ Worked : 25h 25m 53s ]
[ Banked : 83 ]
[ Location : draynor ]
[ fishes : 99 ]
[ Responses : 190 ]
[ FishType : shrimps ]
[=========================]

masterBB

2013-04-21 15:06:31

I wasn't aware people were still using them? It is like one of those things which is actually fun to write, the proggie :P.

Coh3n

2013-04-21 15:19:15

From: masterBB
I wasn't aware people were still using them? It is like one of those things which is actually fun to write, the proggie :P.
I used to think that too. :p Now, though, I find it repetitive and boring. I'm sure there are people out there that would love this option. Plus, I think it's quite nice. This way no one has an excuse for not having a progress report.

Olly

2013-04-21 15:46:30

From: masterBB
I wasn't aware people were still using them? It is like one of those things which is actually fun to write, the proggie :P.


I use them all the time… also @Flight does that should change your mind. :)

Flight

2013-04-21 21:51:25

From: Ollybest
I use them all the time… also @Flight does that should change your mind. :)


Absolutely, they're organized and look quite nice already. I use them in all of my scripts, even those in the unreleased folder. I don't plan on parting from SRL's report system any time soon.

Coh3n

2013-04-21 22:05:37

Great, I'll get working on this soon. :)

Hobbit

2013-04-22 00:16:17

I think renaming playerReportShort() to playerReportWide() or something along those lines would be good. When I see the distinction of long and short options I figure short would tell me overview stuff like script run time, total loads, number of logins, etc and long in addition to the short info will tell me about each player, time, active state, loads, etc.

Just my interpretations.

euphemism

2013-04-22 02:46:19

From: Hobbit
I think renaming playerReportShort() to playerReportWide() or something along those lines would be good. When I see the distinction of long and short options I figure short would tell me overview stuff like script run time, total loads, number of logins, etc and long in addition to the short info will tell me about each player, time, active state, loads, etc.

Just my interpretations.


Agreed, I said as much to Coh3n a little while back.

masterBB

2013-04-22 10:47:50

I just had this idea. Maybe we should add them to the players type. So:

Players.report();

I think it looks neat, on the otherhand I don't think it adds anything.

Coh3n

2013-04-22 11:50:58

Okay, I'll make sure to make the names more clear.

From: masterBB
I just had this idea. Maybe we should add them to the players type. So:

Players.report();

I think it looks neat, on the otherhand I don't think it adds anything.
I think that's pretty cool. It would make sense anyway. I actually like that. That way if, for whatever reason, someone wants to have multiple player arrays, they can.

Gu3st...

2013-04-25 18:44:28

Players.toString() and then Players.reportInfo(const reportStyle : TReport = REPORT_WIDE): overload; perhaps?
writeLn(Players.reportInfo());

Coh3n

2013-04-25 19:10:14

From: Zyt3x
Players.toString() and then Players.reportInfo(const reportStyle : TReport = REPORT_WIDE): overload; perhaps?
writeLn(Players.reportInfo());
I'd rather just see TPlayerArray.printReport(style: integer = REPORT_WIDE). No need to complicate things at all.

E: Could probably have TPlayer.printReport() to give that option (TPlayerArray.printReport would call this as well).

Gu3st...

2013-04-25 19:21:14

The problem is that it's not the TPlayer that is doing the writing, it's the TReport that is doing the writing.
You'd also have to include reports.simba into the players.simba file

Coh3n

2013-04-25 20:07:57

From: Zyt3x
The problem is that it's not the TPlayer that is doing the writing, it's the TReport that is doing the writing.
Yeah fair enough. We could do TPlayerArray.createReport which creates a progress report off of the TPlayerArray. I'm not really sure how a TReport type would work. I guess you could have TReport.saveToFile, .print. May not be a bad idea. Or even TReport.create(basedOn: TPlayerArray).

From: Zyt3x

You'd also have to include reports.simba into the players.simba file
reports.simba is only two functions, albeit pretty long. I'm not sure if they can be split up.

Gu3st...

2013-04-26 19:49:31

I can't really see TReport being that useful for anything, really; I just used it as a synonym for reports.simba

Coh3n

2013-04-27 10:57:18

From: Zyt3x
I can't really see TReport being that useful for anything, really; I just used it as a synonym for reports.simba
The only thing I can see it being useful for is to have a TReport.saveToFile procedure. It would also allow users the option to create multiple progress reports. Why they would want to do that, though, I'm not sure. And I think it could be included in the TPlayer type because the entire report is based off of a TPlayerArray. You could think of it like a TPlayerArray is creating a progress report of itself.

What would you guys rather see? All of it included in the TPlayer type, kept as is in a separate file, or made into a TReport type and kept in a separate file?

I think I prefer a TReport type, that way we can make it more customizable:

program new;

type
TReport = record
str: string;
tokenBorder, tokenInner: string;
title, author: string;
booleans, integers, etc. // whatever the other parameters are for the current reports.simba
// plus anything else to customize it
end;

procedure TReport.create();
begin
end;

procedure TReport.print(toLog: boolean; wide: boolean = false);
begin
end;

function TReport.saveToFile(fileName: string): boolean;
begin
end;

begin
end.


@Zyt3x; @masterBB; @euphemism; @Ollybest;

Olly

2013-04-27 11:15:23

I see no problem in that, iirc the current reports uses a TVariantArray for all the info.

also we should make a dedicated reports folder (srl6/reports/) and have that as the default filename/savepath for saveToFile.

Gu3st...

2013-04-27 14:01:23

I see, yeah, I like the TReport one

Coh3n

2013-09-25 20:22:04

Moving this to the public – we'd like to hear what you guys think should be added/removed/changed from SRL-5's reports.simba.