Leader Tool
Player ranking tool that allows you to create various ranks, assign players to those ranks, and view the assigned rankings.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Leader Tool
@create Leader Tool Parent
@lock Leader Tool Parent==me
@set Leader Tool Parent = !NO_COMMAND
&DESCRIBE Leader Tool Parent=Commands:[iter(lattr([switch(parent(me),#-1,num(me),parent(me))]/DOC_*),%r[setq(0,v(##))][ljust(before(%q0,|),20)] [after(%q0,|)])]
@set Leader Tool Parent/DESCRIBE=no_command visual public nearby
&DOC_ADDMEM Leader Tool Parent=+addmem <player>=<rank>|Make a player a member, with rank <rank>
&DOC_ADDRANK Leader Tool Parent=+addrank <rank>|Adds a membership rank
&DOC_DELMEM Leader Tool Parent=+delmem <player>|Remove a player from membership
&DOC_MEMBERS Leader Tool Parent=+members|List all members's names
&DOC_MEMBERSRANK Leader Tool Parent=+members/rank|List members by rank
&DOC_RANK Leader Tool Parent=+rank <player>=<rank>|Change a player's rank
&DOC_RANKS Leader Tool Parent=+ranks|List all ranks
&DO_ADDMEM Leader Tool Parent=$+addmem *=*: @select 0=[setq(0,pmatch(%0))][comp(%q0,#-1)],{@pemit %#=I don't know a player named %0.},[setr(1,u(ranknum,%1))],{ @pemit %#=I don't know that rank. Try +ranks },{&members_%q1 me=[setunion(v(members_%q1),%q0)];@pemit %#=[name(%q0)] is entered as rank [u(rankname,%q1)].}
&DO_ADDRANK Leader Tool Parent=$+addrank *:&ranks me=[switch(v(ranks),,%0,[v(ranks)]|%0)];@pemit %#={Rank '%0' added.}
&DO_DELMEM Leader Tool Parent=$+delmem *:@select 0=[setq(0,pmatch(%0))][u(ismember,%q0)],{@pemit %#=I don't know a member named %0.},{@wait me=@pemit %#=[name(%q0)] is no longer a member;@dol/notify [lnum(1,words(v(ranks),|))]=&members_## me=[setdiff(v(members_##),%q0)]}
&DO_MEMBERS Leader Tool Parent=$+members:@pemit %#=Members:%r[setq(0,edit(squish(iter(lnum(1,words(v(ranks),|)),v(members_##))),%b,|))][setq(1,munge(sort_alpha,iter(%q0,name(##),|,|),%q0,|))][setq(2,iter(%q1,name(##),|,|))][table(%q2,18,76,|)]
&DO_MEMBERS_RANK Leader Tool Parent=$+members/rank:@pemit %#=Members:[iter(lnum(1,words(v(ranks),|)),%r[ansi(h,u(rankname,##))]:[u(rank_table,##)])]
&DO_RANK Leader Tool Parent=$+rank *=*: @select 0=[setq(0,pmatch(%0))][u(ismember,%q0)],{@pemit %#=I don't know a member named %0.},[setr(1,u(ranknum,%1))],{ @pemit %#=I don't know that rank. Try +ranks },{@wait me={&members_%q1 me=[setunion(v(members_%q1),%q0)];@pemit %#=[name(%q0)] is entered as rank [u(rankname,%q1)].};@dol/notify [lnum(1,words(v(ranks),|))]=&members_## me=[setdiff(v(members_##),%q0)]}
&DO_RANKS Leader Tool Parent=$+ranks: @pemit %#=Ranks: [iter(v(ranks),%r%b%b##,|)]
&ISMEMBER Leader Tool Parent=[t(member(iter(lnum(1,words(v(ranks),|)),v(members_##)),%0))]
&RANKNAME Leader Tool Parent=[extract(v(ranks),%0,1,|)]
&RANKNUM Leader Tool Parent=[match(v(ranks),%0*,|)]
&RANK_TABLE Leader Tool Parent=[setq(0,munge(sort_alpha,iter(v(members_%0),name(##),%b,|),iter(v(members_%0),##,%b,|),|))][switch(%q0,,,%r[table(iter(%q0,name(##),|,|),18,76,|)])]
&SORT_ALPHA Leader Tool Parent=[sort(%0,a,|)]
look Leader Tool Parent
@lock Leader Tool Parent==me
@set Leader Tool Parent = !NO_COMMAND
&DESCRIBE Leader Tool Parent=Commands:[iter(lattr([switch(parent(me),#-1,num(me),parent(me))]/DOC_*),%r[setq(0,v(##))][ljust(before(%q0,|),20)] [after(%q0,|)])]
@set Leader Tool Parent/DESCRIBE=no_command visual public nearby
&DOC_ADDMEM Leader Tool Parent=+addmem <player>=<rank>|Make a player a member, with rank <rank>
&DOC_ADDRANK Leader Tool Parent=+addrank <rank>|Adds a membership rank
&DOC_DELMEM Leader Tool Parent=+delmem <player>|Remove a player from membership
&DOC_MEMBERS Leader Tool Parent=+members|List all members's names
&DOC_MEMBERSRANK Leader Tool Parent=+members/rank|List members by rank
&DOC_RANK Leader Tool Parent=+rank <player>=<rank>|Change a player's rank
&DOC_RANKS Leader Tool Parent=+ranks|List all ranks
&DO_ADDMEM Leader Tool Parent=$+addmem *=*: @select 0=[setq(0,pmatch(%0))][comp(%q0,#-1)],{@pemit %#=I don't know a player named %0.},[setr(1,u(ranknum,%1))],{ @pemit %#=I don't know that rank. Try +ranks },{&members_%q1 me=[setunion(v(members_%q1),%q0)];@pemit %#=[name(%q0)] is entered as rank [u(rankname,%q1)].}
&DO_ADDRANK Leader Tool Parent=$+addrank *:&ranks me=[switch(v(ranks),,%0,[v(ranks)]|%0)];@pemit %#={Rank '%0' added.}
&DO_DELMEM Leader Tool Parent=$+delmem *:@select 0=[setq(0,pmatch(%0))][u(ismember,%q0)],{@pemit %#=I don't know a member named %0.},{@wait me=@pemit %#=[name(%q0)] is no longer a member;@dol/notify [lnum(1,words(v(ranks),|))]=&members_## me=[setdiff(v(members_##),%q0)]}
&DO_MEMBERS Leader Tool Parent=$+members:@pemit %#=Members:%r[setq(0,edit(squish(iter(lnum(1,words(v(ranks),|)),v(members_##))),%b,|))][setq(1,munge(sort_alpha,iter(%q0,name(##),|,|),%q0,|))][setq(2,iter(%q1,name(##),|,|))][table(%q2,18,76,|)]
&DO_MEMBERS_RANK Leader Tool Parent=$+members/rank:@pemit %#=Members:[iter(lnum(1,words(v(ranks),|)),%r[ansi(h,u(rankname,##))]:[u(rank_table,##)])]
&DO_RANK Leader Tool Parent=$+rank *=*: @select 0=[setq(0,pmatch(%0))][u(ismember,%q0)],{@pemit %#=I don't know a member named %0.},[setr(1,u(ranknum,%1))],{ @pemit %#=I don't know that rank. Try +ranks },{@wait me={&members_%q1 me=[setunion(v(members_%q1),%q0)];@pemit %#=[name(%q0)] is entered as rank [u(rankname,%q1)].};@dol/notify [lnum(1,words(v(ranks),|))]=&members_## me=[setdiff(v(members_##),%q0)]}
&DO_RANKS Leader Tool Parent=$+ranks: @pemit %#=Ranks: [iter(v(ranks),%r%b%b##,|)]
&ISMEMBER Leader Tool Parent=[t(member(iter(lnum(1,words(v(ranks),|)),v(members_##)),%0))]
&RANKNAME Leader Tool Parent=[extract(v(ranks),%0,1,|)]
&RANKNUM Leader Tool Parent=[match(v(ranks),%0*,|)]
&RANK_TABLE Leader Tool Parent=[setq(0,munge(sort_alpha,iter(v(members_%0),name(##),%b,|),iter(v(members_%0),##,%b,|),|))][switch(%q0,,,%r[table(iter(%q0,name(##),|,|),18,76,|)])]
&SORT_ALPHA Leader Tool Parent=[sort(%0,a,|)]
look Leader Tool Parent