Kudos

Coded in PennMUSH. Store in Master Room (#2).

@create Kudos Thing

@link Kudos Thing = #2

@set Kudos Thing = OPAQUE

@set Kudos Thing = WIZARD

&CMD_KUDOS Kudos Thing=$+kudos *:@switch [setq(0,pmatch(%0))][setq(1,get(%#/kudos_list))][not(orflags(%#,Wr))][orflags(%q0,Wr)][not(u(fn_isactivepc,%q0))][or(not(setr(2,match(%q1,%q0*,|))),gt(sub(secs,last(extract(%q1,%q2,1,|))),86400))]=0*,{@pemit %#=Only non-admin characters can use this command.},10*,{@pemit %#=That isn't an Admin character.},110*,{@pemit %#=So what exactly did that admin do for you lately? They haven't even been ONLINE in the past 30 days, let alone done anything for you. The command is +kudos, not +brownnose. Please don't abuse it.},1110,{@pemit %#=You have given kudos to this character already within the last 24 hours.},1111,{@pemit %#=You give Kudos to [name(%q0)].[set(%!,kudos_%q0:[inc(val(v(kudos_%q0)))])][if(not(%q2),set(%#,Kudos_list:[%q1]|%q0 [secs]),set(%#,Kudos_list:[replace(%q1,%q2,%q0 [secs],|)]))][set(%#/kudos_list,$icwm)]}

&CMD_KUDOS2 Kudos Thing=$+kudos:@pemit %#=%R[center(ansi(hb,Kudos),16)]%r[iter(revwords(sort(iter(lattr(/kudos*),get(/##) [name(edit(##,KUDOS_,,))],%b,|),n,|),|),%r[ansi(g,last(##))] - [first(##)],|)]%R%R[ansi(hw,+kudos )] to show your appreciation for an admin. You can do this for each admin once every 24 hours.

&CMD_KUDOS_WIPE Kudos Thing=$+kudos/wipe:th if(hasflag(%#,Wizard),[iter(lattr(%!/kudos*),wipe(%!/##))][pemit(%#,You reset the Kudos system.)],[pemit(%#,You must be an admin to use this command.)])

&FN_ISACTIVEPC Kudos Thing=[gte(sub(secs,convtime(get(%0/LAST))),2592000)]