Sir R. M8gic1an
2009-06-12 17:27:22
This is one of the most recently added features to SRL. After looking around at progress reports which were not so presentable, and spent a lot of time perfecting my own, I thought these functions would be useful. And so, i bring to you Reports.scar.
SRLProgressReport example
[php]
[================================]
[ RM Proggie 1.00 ]
[ by Rasta Magician ]
[================================]
[ TimeRunning : 67h, 58m, 34s ]
[ Total Fish : 56788 ]
[ Active Players : 7 ]
[================================]
[ RM Proggie 1.00 ]
[================================]
[/php]
SRLPlayerReport - short example
[php]
[=======================================================================================]
[ 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 ]
[=======================================================================================]
[/php]
SRLPlayerReport - long example
[php]
[=========================]
[ 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 ]
[=========================]
[/php]
Now, how to use them? -hang on to your seats, the parameters might sound complicated, but they are actually extremely simple.
First of all, you need to include Reports.scar
And now, onto the functions :)
ResultType
VarNames, VarValues:
[INDENT]VarNames stores the name of the variables you wish to use
VarValues stores the value of the variables
VarName: 'Time Running' ; VarValue: GetTimeRunning
They are both arrays, so you can use as many variables as you wish, and the VarNames have to be in the same order as the VarValues.
e.g. ['Time Running', 'Total Logs', 'Average Log Time'], [GetTimeRunning, TotalLogs, (TotalLogs/TimeRunning)]
VarValues is a TVariantArray, so you can use booleans, strings, integers and extendeds as you wish, no need to worry about making it all strings.[/INDENT]
This is how I called SRLProgressReport for the example:
And now onto SRLPlayerReport; The parameters are very similar, although different.
To use SRLPlayerReport you will have to familiarize yourself with the Player Array, if you do not know it, please have a look at it here.
SkillLevel: The skill you are leveling, you can check it's number in Players.scar; you can leave it as 0 if you do not intend to put it in the player report.
LongReport: True / False, you can check the above examples to know which one fits you best.
DefaultSettings: An Array of 6 booleans; this is the order:
[INDENT][Players.Worked, Players.Banked, Players.Level, Players.location, Players.Skill, Players.Random]
e.g. [True, True, False, True, False, False][/INDENT]
VarNames: Just like in SRLProgressReport, it has to follow the order of the variables. Booleans, Integers, Strings, Extendeds and it has to follow the order of each of those.
PlayerBooleans, PlayerIntegers, PlayerStrings, PlayerExtendeds:
[INDENT]These reffer to the index in the player array. For example, if you wished to use Players[].Booleans[0] and Players[].Booleans[5] your booleans' array would look like this: [0, 5] ; the same applies to the other.
e.g. [1], [5, 7], [3], []
This would use Players[].Booleans[1] , Players[].Integers[5], Players[].Integers[7] and Players.Strings[3][/INDENT]
Here is how i used it for the example:
As usual, for those who use the OpenSVN, this feature is already available :) for the rest, it should come in rev #34, whenever that comes out :p
Hope you enjoy these functions!
SRL Dev Team
SRLProgressReport example
[php]
[================================]
[ RM Proggie 1.00 ]
[ by Rasta Magician ]
[================================]
[ TimeRunning : 67h, 58m, 34s ]
[ Total Fish : 56788 ]
[ Active Players : 7 ]
[================================]
[ RM Proggie 1.00 ]
[================================]
[/php]
SRLPlayerReport - short example
[php]
[=======================================================================================]
[ 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 ]
[=======================================================================================]
[/php]
SRLPlayerReport - long example
[php]
[=========================]
[ 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 ]
[=========================]
[/php]
Now, how to use them? -hang on to your seats, the parameters might sound complicated, but they are actually extremely simple.
First of all, you need to include Reports.scar
{.include srl/srl/misc/Reports.scar}
And now, onto the functions :)
Function SRLProgressReport(
ResultType:integer; ScriptName, ScriptAuthor, ScriptVersion: String;
VarNames: TStringArray;
VarValues: TVariantArray
): Variant;
ResultType
- ResultDebugBox - prints proggie to Debug Box
- ResultReportBox - prints proggie to Report Box
- ResultString - returns a string as result (can be used for saving to file, etc)
VarNames, VarValues:
[INDENT]VarNames stores the name of the variables you wish to use
VarValues stores the value of the variables
VarName: 'Time Running' ; VarValue: GetTimeRunning
They are both arrays, so you can use as many variables as you wish, and the VarNames have to be in the same order as the VarValues.
e.g. ['Time Running', 'Total Logs', 'Average Log Time'], [GetTimeRunning, TotalLogs, (TotalLogs/TimeRunning)]
VarValues is a TVariantArray, so you can use booleans, strings, integers and extendeds as you wish, no need to worry about making it all strings.[/INDENT]
This is how I called SRLProgressReport for the example:
SRLProgressReport(
ResultDebugBox, 'RM Proggie', 'Rasta Magician', '1.00',
['TimeRunning', 'Total Fish', 'Active Players'],
['67h, 58m, 34s', 56788, 7 ]
);
And now onto SRLPlayerReport; The parameters are very similar, although different.
To use SRLPlayerReport you will have to familiarize yourself with the Player Array, if you do not know it, please have a look at it here.
function SRLPlayerReport(
ResultType, SkillLevel: Integer; LongReport:boolean;
DefaultSettings:TBooleanArray;
VarNames: TStringArray;
PlayerBooleans, PlayerIntegers, PlayerStrings, PlayerExtendeds: TIntegerArray
): Variant;
ResultType- ResultDebugBox - prints proggie to Debug Box
- ResultReportBox - prints proggie to Report Box
- ResultString - returns a string as result (can be used for saving to file, etc)
SkillLevel: The skill you are leveling, you can check it's number in Players.scar; you can leave it as 0 if you do not intend to put it in the player report.
LongReport: True / False, you can check the above examples to know which one fits you best.
DefaultSettings: An Array of 6 booleans; this is the order:
[INDENT][Players.Worked, Players.Banked, Players.Level, Players.location, Players.Skill, Players.Random]
e.g. [True, True, False, True, False, False][/INDENT]
VarNames: Just like in SRLProgressReport, it has to follow the order of the variables. Booleans, Integers, Strings, Extendeds and it has to follow the order of each of those.
PlayerBooleans, PlayerIntegers, PlayerStrings, PlayerExtendeds:
[INDENT]These reffer to the index in the player array. For example, if you wished to use Players[].Booleans[0] and Players[].Booleans[5] your booleans' array would look like this: [0, 5] ; the same applies to the other.
e.g. [1], [5, 7], [3], []
This would use Players[].Booleans[1] , Players[].Integers[5], Players[].Integers[7] and Players.Strings[3][/INDENT]
Here is how i used it for the example:
SRLPlayerReport(
ResultDebugBox, 0, False,
[True, True, False, True, False, False],
['fishes', 'Responses', 'FishType'],
[], [0, 1], [0], []
);
As usual, for those who use the OpenSVN, this feature is already available :) for the rest, it should come in rev #34, whenever that comes out :p
Hope you enjoy these functions!
SRL Dev Team
:)