OOC Friend Tracker

A multipager and lister that keeps track of friends and groups them accordingly. Can mp, +mail, etc groups of people. Also records 'true identity' (dbref # and descriptor) so you can keep track of people who change their @name often.

Author: Rinaen@AmberMUSH
Category: Other

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for OOC Friend Tracker

@create Rina's Device Master=10
@Desc Rina's Device Master=+mem/help -- multipager/lister%rdhelp -- @doing machine
&H_ADD Rina's Device Master=$+mem/add *=*:@switch num(*%0)=#-1,{@pemit %#=Nope, that's not a player name. Check your spelling.},{&g_[%1] me=setunion(v(g_%1),num(*%0));@pemit %#=`[name(num(*%0))]' added to group `[capstr(%1)]'.}
&H_REM Rina's Device Master=$+mem/rem *=*:@switch [setq(0,switch(mid(%0,0,1),#,%0,*%0))][member(v(g_%1),num(r(0)))]=0,{@pemit %#=Nope, that person isn't on the `[capstr(%1)]' list.},{&g_[%1] me=remove(v(g_%1),num(r(0)));@pemit %#=`[name(num(r(0)))]' removed from group `[capstr(%1)]'.;@switch words(v(g_%1))=0,{@pemit %#=Oh, and the group `[capstr(%1)]' is empty, so it's removed.}}
&H_LIST Rina's Device Master=$+mem/list *:@switch words(v(g_%0))=0,{@pemit %#=No such group as `[capstr(%0)]'!},{@pemit %#=Group [capstr(%0)]:%b%b%b[edit(sort(iter(v(g_%0),[name(##)][switch(hasflag(*##,connected),1,*)])),%b,\,%b)]}
&H_REMGROUP Rina's Device Master=$+mem/remgroup *:@switch words(v(g_%0))=0,{@pemit %#=No such group as `[capstr(%0)]'!},{&g_[%0] me;@pemit %#=Group `[capstr(%0)]' has been wiped out.}
&H_LISTALL Rina's Device Master=$+mem/list:@switch words(lattr(me/g_*))=0,{@pemit %#=Silly, you have no groups defined.},{@pemit %#=Groups:%b%b%b[edit([sort(iter([edit(iter(lattr(me/g_*),lcstr(##)),g_,)],capstr(##)))],%b,\,%b)]}
&H_HELP Rina's Device Master=$+mem/help:@pemit %#={Member of Group thingy commands:%r%r[ljust(+mem/help,30)]This screen. Whee!%r[ljust(+mem/list,30)]Lists all defined groups.%r[ljust(+mem/list <group>,30)]Lists all the members of the <group>.%r[ljust(+mem/listlong <group>,30)]As above, long format.%r[ljust(+mem/lc <group>,30)]Lists all connected members of <group>.%r[ljust(+mem/mp <group>=<message>,30)]Multipage to <group> the <message>.%r[space(30)]This command supports : and ; substitution.%r[ljust(+mem/mail <group>=<subject>,30)]Mail all members of <group> with <subject> as%r[space(30)]the subject of the message.%r[ljust(+mem/add <person>=<group>,30)]Adds <person> to the named <group>.%r[ljust(+mem/rem <person>=<group>,30)]Removes <person> from <group>. You may use%r[space(30)]a dbref# in place of the name.%r[ljust(+mem/remgroup <group>,30)]Removes <group> entirely.%r[ljust(+mem/true <name>=<ID>,30)]Stores <name>'s "true identity".%r[ljust(+mem/truelist,30)]Lists "true identities".}
&H_LIST_CONN Rina's Device Master=$+mem/lc *:@switch words(v(g_%0))=0,{@pemit %#=No such group as `[capstr(%0)]'!},{@switch words(filter(fn-online,v(g_%0)))=0,{@pemit %#=Nope, nobody from group `[capstr(%0)]' is online.},{@pemit %#=[u(fn-listconn,v(g_%0))]}}
&H_LIST_LONG Rina's Device Master=$+mem/listlong *:@switch words(v(g_%0))=0,{@pemit %#=No such group as `[capstr(%0)]'!},{@pemit %#=Group [capstr(%0)]:%r%r[ljust(Dbref#,8)][ljust(Name,20)][ljust(Connected Status,45)]%r[repeat(=,79)];@pemit %#=[iter(v(g_%0),%r[ljust(##,8)][ljust(name(##),20)][ljust(u(fn_list,##),45)])]}
&FN_LIST Rina's Device Master=[switch(hasflag(%0,connected),1,On since,0,Last connected at)]%b[get(%0/last)]
&H_PAGE Rina's Device Master=$+mem/mp *=*:@switch words(v(g_%0))=0,{@pemit %#=No such group as `[capstr(%0)]'!},{@switch words(filter(online,v(g_%0)))=0,{@pemit %#=Nope, nobody from group `[capstr(%0)]' is online.},{@fo owner(me)=mp [setq(0,[filter(online,v(g_%0))])][r(0)]=[escape(%1)]}}
&H_SETUP Rina's Device Master=$+setup device:@lock me=%#;lock/use me=%#;@set me=sticky;@set me=dark;@link me=%#;@set me=safe;@switch hasflag(me,inherit)=0,{@pemit %#=Whoops! This object needs the INHERIT flag to work properly. To accomplish this, type '@set [num(me)]=inherit', then type '+setup device' again.},{@pemit %#=All set! Type '+mem/help' or 'dhelp' for a command list.}
&H_MAIL Rina's Device Master=$+mem/mail *=*:@switch words(v(g_%0))=0,{pemit %#=No such group as `[capstr(%0)]'!},{@fo %#=+mail [iter(v(g_%0),name(##))]=%1}
&FN-ONLINE Rina's Device Master=hasflag(%0,connected)
&DO-ADD Rina's Device Master=$dadd *:@switch gt(strlen(%0),40)=1,@pemit %#={@doing is too long -- not saved. ([strlen(%0)] chars, 40 max)},{@switch words(v(doings_list),|)=0,&doings_list me=%0,{&doings_list me=[edit(v(doings_list),$,|%0)]};@pemit %#=@doing added.}
&DO-DEL Rina's Device Master=$ddel *:@switch [and(lte(%0,words(v(doings_list),|)),gt(%0,0))]=1,{&doings_list me=[ldelete(v(doings_list),%0,|)];@pemit %#=@doing deleted.},@pemit %#=That is not a number of a stored @doing.
&DO-SET Rina's Device Master=$dset *:@switch [and(lte(%0,words(v(doings_list),|)),gt(%0,0))]=1,{@fo %#=@doing [extract(v(doings_list),%0,1,|)]},@pemit %#=That is not the number of a stored @doing.
&DO-RAND Rina's Device Master=$drand:@fo [setq(0,extract(v(doings_list),add(rand(words(v(doings_list),|)),1),1,|))]%#=@doing %q0;@pemit %#=@doing set: %q0
&DO-LIST Rina's Device Master=$dlist:@pemit %#={Stored @doings:[iter(lnum(words(v(doings_list),|)),%r[add(##,1)].%b[extract(v(doings_list),add(##,1),1,|)])]}
&DO-HELP Rina's Device Master=$dhelp:@pemit %#=@doing commands:%r%rdlist: List stored @doings.%rdadd <text>: Add an @doing.%rddel #: Delete a stored @doing.%rdset #: Set your @doing to a stored one.%rdrand: Set your @doing randomly.
&H_TRUE Rina's Device Master=$+mem/true *=*:@switch num(*%0)=#-1,{@pemit %#=That's not a player name. Check your spelling.},{@switch [setq(0,switch(mid(%0,0,1),#,%0,*%0))][match(v(true),[num(%q0)]*)]=0,{&true me=[setunion(v(true),[num(%q0)]|%1)]},{&true me=[setq(1,ldelete(v(true),match(v(true),[num(%q0)]*)))][setunion(%q1,[num(%q0)]|%1)]};@pemit %#=[name(%q0)]'s "true identity" stored as `%1'.}
&H_TRUELIST Rina's Device Master=$+mem/truelist:@pemit %#=[ljust(Current Name,20)]True Identity%r[ljust(============,20)]=============[iter(v(true),%r[ljust([name(first(##,|))],20)][rest(##,|)])]
&FN-LISTCONN Rina's Device Master=[ljust(IC?,4)][ljust(Name,20)][ljust(Identity,12)][ljust(Location,30)][ljust(On For,7)]Idle%r~~~%b[repeat(~,19)]%b[repeat(~,11)]%b[repeat(~,29)]%b~~~~~~%b~~~~[setq(0,filter(fn-online,[iter(%0,first(##,|))]))][iter(%q0,%r[ljust(mid(switch(flags(##),*H*,OOC,IC),0,4),4)][ljust(mid(name(##),0,19),19)]%b[ljust(mid(u(fn-id,v(true),##),0,11),11)]%b[switch(loc(##),#-1,center(?,29),ljust(mid(name(loc(##)),0,29),29))]%b%b[setq(2,div(conn(##),3600))][setq(3,div(mod(conn(##),3600),60))][rjust(%q2,2,0)]:[rjust(%q3,2,0)]%b%b[switch(1,gt(idle(##),3600),trunc(div(idle(##),3600))h,gt(idle(##),60),trunc(div(idle(##),60))m,idle(##)s)])]%rThere are [words(%q0)] of [words(%0)] connected.
&FN-ID Rina's Device Master=rest(extract(%0,match(%0,%1*),1),|)
@set Rina's Device Master=DARK
@set Rina's Device Master=STICKY
@set Rina's Device Master=PARENT_OK
@set Rina's Device Master=HALTED
@set Rina's Device Master=SAFE