jaimonkhan Newbie
Joined: 05 Aug 2019 Posts: 4
|
Posted: Wed Aug 07, 2019 1:01 pm
Master Crystal Log Analyzer!! |
hose who are or have been secretaries and/or GMs in Achaean magi guilds will know what this is about.
Instructions:
gcrys will start your GUILD CRYSTALS log going. Output lines are gagged by the two triggers. Add parameters just as you would to GUILD CRYSTALS to get previous days' reports. Keep hitting more until it is done (config pagelength to reduce this)
creport will print a pretty report of who's been doing what to your MC. If you gave parameters to gcrys then it will save the report to a file. On the creport output, RPF=Refines Per Fold, but it's an integer value, so do the math yourself. :p
Code:
#CLASS {SECURITY}
#ALIAS gcrys {
#var gPearlers {} _nodef Security
#var gFolds {} _nodef Security
#var gRefines {} _nodef Security
#if (%1&%2) {
#echo Getting complete crystal log for %2 days ago - please stand by.
#var cRptComplete {1} _nodef Security
} {
#echo Getting interim crystal report for today.
#var cRptComplete {0} _nodef Security
}
guild crystals %1 %2
}
#ALIAS creport {
#if (@cRptComplete=TRUE) {
#var crfName {mc-%replace( @cRptDt, '/', '-')} _nodef Security
#file 1 @crfName
#ERASE 1
#close 1
#file 1 @crfName
#echo Writing log to @crfName
#write 1 {%format( "&10s NAME PEARLS REFINES RPF", @cRptDt)}
#forall @gPearlers {
#var iName {%i} _nodef Security
#var iFolds {%item( @gFolds, %ismember( @iName, @gPearlers))} _nodef Security
#var iRefines {%item( @gRefines, %ismember( @iName, @gPearlers))} _nodef Security
#var iRPF {%eval( @iRefines/@iFolds)} _nodef Security
#write 1 {%format( "&20s &5.0n &5.0n &3.0n", @iName, @iFolds, @iRefines, @iRPF)}
}
#close 1
}
#echo ""
#echo %format( "&10s NAME PEARLS REFINES RPF", @cRptDt)
#forall @gPearlers {
#var iName {%i} _nodef Security
#var iFolds {%item( @gFolds, %ismember( @iName, @gPearlers))} _nodef Security
#var iRefines {%item( @gRefines, %ismember( @iName, @gPearlers))} _nodef Security
#var iRPF {%eval( @iRefines/@iFolds)} _nodef Security
#echo ~<color %if( @iRPF>5, red, %if( @iRPF>3, yellow, blue))~>%format( "&20s &5.0n &5.0n &3.0n", @iName, @iFolds, @iRefines, @iRPF)~</color>
}
}
#TRIGGER {(%d~/%d~/%d) (%d~:%d~:%d) - (%w) transformed a pearl for (%d) new facets.} {
#gag
#var cRptDt {%1} _nodef Security
#if (%numitems( @gpearlers) > 0) {#addItem gPearlers %3} {#var gPearlers {%3} _nodef Security}
#var pnum {%ismember( %3, @gPearlers)} _nodef Security
#var iFolds {[%item( @gFolds, @pnum)+1]} _nodef Security
#if (@pnum>%numitems( @gFolds)) {
#var gFolds {%additem( 1, @gFolds)} _nodef Security
#var gRefines {%additem( 0, @gRefines)} _nodef Security
} {#var gFolds {%replaceitem( @iFolds, @pnum, @gFolds)} _nodef Security}
}
#TRIGGER {(%d~/%d~/%d) (%d~:%d~:%d) - (%w) refined away 1 facet.} {
#gag
#if (%numitems( @gpearlers) > 0) {#addItem gPearlers %3} {#var gPearlers {%3} _nodef Security}
#var pnum {%ismember( %3, @gPearlers)} _nodef Security
#var iRefines {[%item( @gRefines, @pnum)+1]} _nodef Security
#if (@pnum>%numitems( @gRefines)) {
#var gRefines {%additem( 1, @gRefines)} _nodef Security
#var gFolds {%additem( 0, @gFolds)} _nodef Security
} {#var gRefines {%replaceitem( @iRefines, @pnum, @gRefines)} _nodef Security}
}
#CLASS 0
_________________ |
|