Steven's ToolKit

Steven's ToolKit has mail-editing, mailing list, channel management, and simiple multi-descing capabilities. This is a parent-able object but is NOT a global. Help file included in the softcode (TK HELP).

Category: Other
Compatibility: PennMUSH, TinyMUX.

Instructions

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

MUSHCode for Steven's ToolKit

@@ Some general rules:
@@
@@ Any line which, like this, begins with @@, is a comment and should NOT
@@ be pasted into your MUSH
@@
@@ If you already have a global object like a WHO Machine, then you can
@@ just stick this code onto it instead of making up a whole new object
@@
@@ Commands:
@@ TK HELP -- provides online help for various commands on the toolkit
@@ VM-LIST * -- Various 'mailing list' command to maintain mail aliases
@@ VMAIL * -- Various commands for editing and CC'ing @mail before you
@@ send it.
@@ CHAN * -- Commands for turning channles on and off in bulk
@@ WARDROBE -- shows a list of saved descs
@@ <SAVE | WEAR | CHECK | CLEAR>DESC * -- saves, wears, clears, or checks
@@ stored @descs
@@
@@ Code details:
@@ The Toolkit is a versatile multi-purpose object that allows people to
@@ do simple multi-descing, manage channels in bulk, and use a mail system@
@@ with commands very similar to the various @mail and @malias commands of
@@ TinyMUX. Once you quote the code into a MUSH, the TK HELP command ought
@@ to be self-explanatory.
@@
@@ THIS IS NOT A GLOBAL OBJECT AND SHOULD NOT BE PLACED IN THE PARENT ROOM
@@ The Toolkit is designed to be used as a PERSONAL object. If you want
@@ everyone on the MUSH to be able to use these commands, you should do
@@ as we did on CM -- make it a parent-able object and let other people
@@ @parent to it.
@@
@@ IF you intend to make this a parent object, AFTER you create it, replace
@@ the CMD_TK_HELP attribute with the following, listed below (obviously,
@@ you should remove the leading @@'s first.
@@
@@ &CMD_TK_HELP ToolKit=$tk help: @pemit %#=[ansi(w,repeat(_,76))]%r[ansi(hwC,center(ToolKit HELP,76))]%rTheToolkit has various suites of commands designed to help with differentareas of MUSHing. Hopefully these commands will make your lifeeasier.%r%r[ljust(Topic,20)]Details%r[iter(lattr(me/tkhelp_*),[ljust(rest(##,_),20)][extract(v(help_details),#@,1,|)], ,%r)]%r%rFor detailed help on a topic, type [ansi(hr,TK HELP <topic>)]%r[ansi(hc,repeat(_,76))]
@@
@@
@@ Disclaimer: I don't really support this code in any way. It's not
@@ really coded like this at all on Champions MUSH... I had to simplify
@@ it to make it standardized to work anywhere. Because these commands
@@ already exist as globals on CM, I can't test them on a global object
@@ the way I probably should. All I can say is, use at your own risk. If
@@ you have problems you can email me, but I will not make any guarantees
@@ that I'll have time to help. I will if I can; if not... you're on
@@ your own.
@@
@@ Coded by Steven @ Champions MUSH
@@


@create ToolKit
@lock/Basic ToolKit==me
@set ToolKit = INHERIT
@set ToolKit = !NO_COMMAND
&CMD_VM-MAILTO ToolKit=$vm-mailto *=*: @switch/first hasattrval(me,pending_to)=1,{@pemit %#=VMAIL: You are already in the middle of a VMAIL message. Type VMAIL/ABORT to clear it and start a new one.},{@switch/first hasattr(me,malias_%0)=0,{@pemit %#=VMAIL: No such mail alias.},{&pending_to me=[v(malias_%0)]; &pending_subject me=%1; &pending_text me=; @pemit %#=VMAIL: Sending mail to the [ucstr(%0)] mailing list. Use VMAIL/ADD <text> or -<text> to add text. Use VMAIL/SEND or -- to send.}}
&CMD_DASH_DASH ToolKit=$--:@switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{think [setq(0,num(me))]%q0; @force %#=@mail [get(%q0/pending_to)]=[get(%q0/pending_subject)]/[get(%q0/pending_text)]; @wait 3={&pending_to me; &pending_text me; &pending_subject me; @pemit %#=VMAIL: Mail sent.}}
&CMD_VMAIL_SEND ToolKit=$vmail/send: @switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{think [setq(0,num(me))]%q0; @force %#=@mail [get(%q0/pending_to)]=[get(%q0/pending_subject)]/[get(%q0/pending_text)]; @wait 3={&pending_to me; &pending_text me; &pending_subject me; @pemit %#=VMAIL: Mail sent.}}
&CMD_VMAIL_CC ToolKit=$vmail/cc *:@switch/first strmatch([setq(0,pmatch(%0))]%q0,#-*)=1,{@pemit %#=VMAIL: No such player.},{@switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{&pending_to me=[setunion(v(pending_to),%q0)]; @pemit %#=[name(%q0)] added to the list of mail recipients.}}
&CMD_VMAIL_ABORT ToolKit=$vmail/abort: @switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{&pending_to me; &pending_text me; &pending_subject me; @pemit %#=VMAIL: Message aborted.}
&FUN_MAIL_DISPLAY ToolKit=[v(pending_text)]%r
&FUN_MAIL_FOOTER ToolKit=[repeat(-,76)]
&FUN_MAIL_HEADER ToolKit=[repeat(-,76)]%rFrom: %N%rTo: [iter(v(pending_to),%b[name(##)], ,\,)]%rSubject: [v(pending_subject)]%r[repeat(-,76)]%r
&CMD_VMAIL_PROOF ToolKit=$vmail/proof: @pemit %#=[ifelse(hasattrval(me,pending_to),[u(fun_mail_header)][u(fun_mail_display)][u(fun_mail_footer)],VMAIL: No mail message pending.)]
&CMD_VMAIL_EDIT ToolKit=$vmail/edit *=*: @switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{&pending_text me=[edit(v(pending_text),{%0},{%1})]; @wait 2={@pemit %#=VMAIL: Text edited. Message now reads:%r[v(pending_text)].}}
&CMD_VMAIL_ADD ToolKit=$vmail/add *: @switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{&pending_text me=[v(pending_text)]%b%0; @pemit %#=VMAIL: Text added to mail message.}
&CMD_DASH ToolKit=$-*: @switch/first strmatch(%0,-)=0,{@switch/first hasattrval(me,pending_to)=0,{@pemit %#=VMAIL: No mail message pending.},{&pending_text me=[v(pending_text)]%b%0; @pemit %#=VMAIL: Text added to mail message.}}
&ALREADY_PENDING ToolKit=VMAIL: You are already in the middle of a mail message. To clear the pending message type VMAIL/ABORT. To add another player to the list of people who will receive the pending message, type VMAIL/CC <player name>.
&CMD_VMAIL ToolKit=$vmail *=*: @switch/first strmatch([setq(0,pmatch(%0))]%q0,#-*)=1,{@pemit %#=VMAIL: No such player.},{@switch/first hasattrval(me/pending_to)=1,{@pemit %#=[u(already_pending)]},{&pending_to me=%q0; &pending_subject me=[mid(%1,0,28)]; &pending_text me=; @pemit %#=VMAIL: You begin a vmail message to [name(%q0)]. To add text type '-<text>'.}}
&CMD_VM-LIST_CLEAN ToolKit=$vm-list clean *: @switch/first hasattr(me,malias_%0)=0,{@pemit %#=VMAIL: No such mailing list alias. Type VM-LISTS for a list.},{&malias_%0 me=[squish(iter(v(malias_%0),if(hastype(##,player),##)))];@pemit %#=VMAIL: List [ucstr(%0)] cleaned of non-Player objects.}
&CMD_VM-LIST_SUB ToolKit=$vm-list sub *=*: @switch/first hasattr(me,malias_%0)=0,{@pemit %#=VMAIL: No such mail alias. Type VM-LISTS for a list.},{@switch/first strmatch([setq(0,pmatch(%1))]%q0,#-*)=1,{@pemit %#=VMAIL: No such player. If you want to clear garbage from a mailing list, use VM-LIST CLEAN.},{&malias_%0 me=[setdiff(v(malias_%0),%q0)]; @pemit %#=VMAIL: [name(%q0)] removed from the mailing list [ucstr(%0)].}}
&CMD_VM-LIST_DEL ToolKit=$vm-list delete *: @switch/first hasattr(me,malias_%0)=0,{@pemit %#=VMAIL: No such mail alias. Type VM-LISTS for a list.},{&malias_%0 me; @pemit %#=VMAIL: You delete the VMAIL mailing list named [ucstr(%0)].}
&FUN_SHOWLIST ToolKit=VMAIL: Alias %0 members:%b[iter(v(malias_%0),%b[name(##)], ,\,)]
&CMD_VM-LIST_ALIAS ToolKit=$vm-list show *: @pemit %#=[ifelse(hasattr(me,malias_%0),ulocal(fun_showlist,[ucstr(%0)]),VMAIL: No such mailing list alias.)]
&CMD_VM-LIST_ADD ToolKit=$vm-list add *=*: @switch/first strmatch([setq(0,pmatch(%1))]%q0,#-*)=1,{@pemit %#=VMAIL: Not a valid player. Sorry.},{@switch/first hasattr(me,malias_%0)=0,{@pemit %#=VMAIL: No such mailing list alias. Type VM-LISTS for a list of aliases.},{&malias_%0 me=[setunion(v(malias_%0),%q0)]; @pemit %#=You add [name(%q0)] to the list [ucstr(%0)].}}
&CMD_VM-LIST_START ToolKit=$vm-list start=*: @switch/first gt(words(%0),1)=1,{@pemit %#=VMAIL: Please only use one-word aliases for Mailing List names in VMAIL.},{@switch/first hasattr(me,malias_%0)=1,{@pemit %#=VMAIL: You already have a VM-LIST alias of that name.},{@pemit %#=VMAIL: You start a new VM-LIST alias named [ucstr(%0)]; &malias_%0 me=;}}
&CMD_VM-LISTS ToolKit=$vm-lists: @pemit %#=[u(header,VMAIL: Mailing Lists)]%r[iter(lattr(me/malias_*),[center(rest(##,_),76)], ,%r)]%r[ansi(hc,repeat(-,76))]
&MAILHELP_DETAILS ToolKit=Shows a list of all your mailing lists|Shows everyone on the maling list <alias>|Starts a mailing list named <alias>|Deletes the <alias> mailing list|Adds <name> to <alias> mailing list|Subtracts <name> from <alias> mailing list|Cleans non-player items and garbage from <alias>|Begins composing mail to <alias> with <subject>|Begins composing mail to <name> with <subject>|Appends <text> to the current mail message|Shorthand for VMAIL/ADD|Edits text in current message from <old> to <new>|Proofreads current mail message|Aborts current mail message|Adds <name> to the list of mail recipients|Sends current mail message|Shorthand for VMAIL/SEND
&MAILHELPS ToolKit=VM-LISTS|VM-LIST SHOW <alias>|VM-LIST START=<alias>|VM-LIST DELETE <alias>|VM-LIST ADD <alais>=<name>|VM-LIST SUB <alias>=<name>|VM-LIST CLEAN <alias>|VM-MAILTO <alias>=<subject>|VMAIL <name>=<subject>|VMAIL/ADD <text>|- <text>|VMAIL/EDIT <old>=<new>|VMAIL/PROOF|VMAIL/ABORT|VMAIL/CC <name>|VMAIL/SEND|--
&TKHELP_VMAIL ToolKit=VMAIL: Steven's Mail Editing Tools (These commands will allow you to maintain mailing lists, preview and edit mail before sending, etc).%r%r[iter(v(mailhelps),[ljust(##,27)] [extract(v(mailhelp_details),#@,1,|)],|,%r)]
&CMD_WEARDESC ToolKit=$weardesc *:@switch/first hasattr(me,ward_%0)=0,{@pemit %#=No such desc on your toolkit.},{@pemit %#=You wear the desc [ucstr(%0)].; @describe %#=[get(me/ward_%0)]}
&CMD_CLEARDESC ToolKit=$cleardesc *: @switch/first hasattr(me,ward_%0)=0,{@pemit %#=No such desc on your toolkit.},{@pemit %#=You clear the desc [ucstr(%0)] from your wardrobe; &ward_%0 me;}
&CMD_SAVEDESC ToolKit=$savedesc *: &ward_[setq(0,edit(%0,%b,_))]%q0 me=[get(%#/describe)]; @pemit %#=You save your current @desc as [ucstr(%q0)];
&CMD_CHECKDESC ToolKit=$checkdesc *: @pemit %#=[ifelse(hasattr(me,ward_%0),[ulocal(header,Wardrobe: Description %0)]%r[eval(me,ward_%0)]%r[ansi(hc,repeat(-,76))],No such Wardrobe desc set.)]
&HEADER ToolKit=[ansi(w,repeat(_,76))]%r[ansi(hwC,center(ToolKit %0,76))]%r
&CMD_WARDROBE ToolKit=$wardrobe: @pemit %#=[ansi(w,repeat(_,76))]%r[ansi(hwC,center(ToolKit Wardrobe,76))]%rYou have the following @descs stored on the Toolkit.%r%r[table(iter(lattr(me/ward_*),[rest(##,_)]),18,76)]%r%rTo check a desc listed, type CHECKDESC <name>.%rTo change your @desc to a desc listed, type WEARDESC <name>%r[ansi(hc,repeat(-,76))]
&DESCHELPS ToolKit=WARDROBE|SAVEDESC <descname>|WEARDESC <descname>|CHECKDESC <descname>|CLEARDESC <descname>
&DESCHELP_DETAILS ToolKit=Shows a list of saved descs|Saves your current @desc as <descname>|Changes your @desc to <descname>|Checks <descname> to see what it looks like|Erases desc <descname>
&TKHELP_WARDROBE ToolKit=Wardrobe Tools (These commands will alter your current description)%r%r[iter(v(deschelps),[ljust(##,30)] [extract(v(deschelp_details),#@,1,|)],|,%r)]
&TKHELP_CHANNELS ToolKit=Channel Tools (issue commands for all channels you are on at once)%r[iter(v(chanhelps),[ljust(##,20)] [extract(v(chanhelp_details),#@,1,|)],|,%r)]
&CMD_TK_HELP_TOPIC ToolKit=$tk help *: @pemit %#=[ifelse(hasattrp(me,tkhelp_%0),[ansi(w,repeat(_,76))]%r[ansi(hwC,center(ToolKit HELP,76))]%r[u(tkhelp_%0)]%r[ansi(hc,repeat(_,76))],No such TK HELP topic.)]
&HELP_DETAILS ToolKit=Mail-editing and mailing lists|Description-Altering tools|Channel command tools
&CMD_CHAN_MUTE ToolKit=$chan mute *: @switch/first strmatch(%0,no)=1,{@dolist channels(%#)={@force %#=@chan/mute ##=no}},{@switch/first strmatch(%0,yes)=1,{@dolist channels(%#)={@force %#=@chan/mute ##=yes}},{@pemit %#=Please set the channel mute to 'yes' or 'no.'}}
&CHANHELP_DETAILS ToolKit=Turns all "saved" channels on|Turns all channels off and saves them for later|Lists all Channels you are currently on|Toggles mute status (yes or no) for all channels
&CHANHELPS ToolKit=CHAN ON|CHAN OFF|CHAN LIST|CHAN MUTE <yes/no>
&CMD_TK_HELP ToolKit=$tk help: @pemit %#=[ansi(w,repeat(_,76))]%r[ansi(hwC,center(ToolKit HELP,76))]%rThe Toolkit has various suites of commands designed to help with different areas of MUSHing. Hopefully these commands will make your life easier.%r%r[ljust(Topic,20)]Details%r[iter(lattr(me/tkhelp_*),[ljust(rest(##,_),20)][extract(v(help_details),#@,1,|)], ,%r)]%r%rFor detailed help on a topic, type [ansi(hr,TK HELP <topic>)]%r[ansi(hc,repeat(_,76))]
@DESCRIBE ToolKit=This is a multi-functional toolkit that can do lots of things. It lets you manage your channels more easily, will do mass-mailings, mailing lists, and mail preview-editing, and has some simple but functional multi-descing abilities. More functions will be added over time. Coded by Steven. Report bugs by @mail. To setup your Toolkit:%r%r@create <object name>%r@set <object>=!no_command%r@set <object>=inherit%r@set <object>=safe%r@lock object==me%r@lock/use <object>==me%r@parent <object>=[num(me)]%r@desc <object>=<some cool description>
@ADESCRIBE ToolKit=@pemit %#=%rFor help, type [ansi(hr,TK HELP)]
&CMD_CHAN_LIST ToolKit=$chan list: @pemit %#=You are on the following channels:%b[iter(channels(%#),%b##, ,\,)]
&CMD_CHAN_ON ToolKit=$chan on: @switch/first hasattr(me,channels)=0,{@pemit %#=I don't see any channels turned off.},{@dolist [v(channels)]={@force %#=@chan/on ##}; @wait 3={&channels me;}}
&CMD_CHAN_OFF ToolKit=$chan off: &channels me=[channels(%#)]; @wait 2={@dolist [channels(%#)]={@force %#=@chan/off ##}}