@@^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ SGP MOTD code and +3who patch Installer - 20 July 00 @@ @@ This is a quotable installer file that updates SGP code released to the SGP @@ website(http://sandbox.erisian.net/sgp/sgpindex.html) prior to 20 July 00. @@ Code taken from the SGP website and installed AFTER 20 July 00 will already @@ have these changes or will be covered by a subsequent set of bugfixes. @@ @@ DO NOT USE THIS FILE if you are installing SGP into a blank database. All @@ of these changes are included as part of the standard installers. @@ @@^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ This file fixes the following bugs: @@ @@ - +motd was a feature request made by Javelin and based on code provided by @@ David Ramsden @@ - The +3who patch is a fix to the rather horrid, non-functional code that @@ existed in prior releases. Thanks to Ian@BrazilMUX for the code. @@ - Updated +wizhelp and WIZLIST_COMMANDS to include help for +motd. @@ - Added +who * and updated +help accordingly. @@ - Corrected a typo in FN_ANDLIST @@ @@^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ All of these bugfixes can be applied to uncustomized SGP code without fear @@ of screwing up your globals. @@ All code ported cleanly to PennMUSH, TinyMUSH 2.2.x, and MUX 2.0 and worked @@ on the unmodified test servers. @@ Customized SGP code may need to be edited by hand. @@ @@^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ Using this file: @@ @@ ALL code in this file is uncommented and will quote to the game with your @@ MUSH client's uploading commands. In MUX the additional code for +wizhelp @@ modficiations will be superfluous and will emit the usual error messages, @@ which can be safely ignored. MUX users should reload the staffhelp.txt file @@ to their game/text directory, taking the time to CAREFULLY preserve any @@ changes, such as the addition of help for bulletin boards and other add-on @@ systems. @@ @@ If the +help data object has been removed from the master room, you will @@ need to substitute the DBREF of the object for the name of the object. @@ @@ Quote this file into the game in the master room for the changes to take @@ effect. Otherwise, change the names of the objects with the DBREF of the @@ object as it exists in your game. @@ @@ Make sure you run a test of the affected code and report any problems to the @@ SGP bug page. We like to get things fixed as soon as possible. @@ @@^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @pemit me=Beginning installation of +motd commands...Moment. &CMD-MOTD_SET SGP - Wizard Globals=$+motd/set *=*:@switch/first 1={match(%0,general)},{&MOTD-GEN_LIST [v(db)]=[setunion(u(v(db)/MOTD-GEN_LIST),secs())];&MOTD-[secs()] [v(db)]=%1;@motd [iter(u(v(db)/MOTD-GEN_LIST),%r[u(v(db)/MOTD-##)]%r)];@pemit/list lwho()=GAME: [name(%#)] has set a new MOTD.},{match(%0,wizard)},{&MOTD-WIZ_LIST [v(db)]=[setunion(u(v(db)/MOTD-WIZ_LIST),secs())];&MOTD-[secs()] [v(db)]=%1;@motd/wizard [iter(u(v(db)/MOTD-WIZ_LIST),%r[u(v(db)/MOTD-##)]%r)];@pemit %#=GAME: You set a new Wizard MOTD.},{match(%0,full)},{&MOTD-FULL [v(db)]=%1;@motd/full %1;@pemit %#=GAME: You set a new Full MOTD.},{match(%0,down)},{&MOTD-DOWN [v(db)]=%1;@motd/down %1;@pemit %#=GAME: You set a new Down MOTD.},{@pemit %#=ERROR: '%0' is not a valid MOTD type.} &CMD-MOTD_DEL SGP - Wizard Globals=$+motd/del *=*:@switch/first 0={strmatch(general wizard down full 0,*%0 *)},{@pemit %#=ERROR: '%0' is not a valid MOTD type.},{not(and(match(%0,general),lte(%1,words(u(v(db)/MOTD-GEN_LIST)))))},{&MOTD-GEN_LIST [v(db)]=[setdiff(u(v(db)/MOTD-GEN_LIST),setq(1,extract(u(v(db)/MOTD-GEN_LIST),%1,1))%q1)];&MOTD-%q1 [v(db)];@motd [iter( u(v(db)/MOTD-GEN_LIST),%r[u(v(db)/MOTD-##)]%r)];@pemit %#=GAME: You remove a MOTD.},{not(and(match(%0,wizard),lte(%1,words(u(v(db)/MOTD-WIZ_LIST)))))},{&MOTD-WIZ_LIST [v(db)]=[setdiff(u(v(db)/MOTD-WIZ_LIST),setq(1,extract(u(v(db)/MOTD-WIZ_LIST),%1,1))%q1)];&MOTD-%q1 [v(db)];@motd/wizard [iter( u(v(db)/MOTD-WIZ_LIST),%r[u(v(db)/MOTD-##)]%r)];@pemit %#=GAME: You remove a MOTD.}, {not(and(match(%0,down),match(%1,1)))},{@wipe [v(db)]/MOTD-DOWN;@motd/down ;@pemit %#=GAME: You remove a MOTD.},{not(and( match(%0,full), match(%1,1)))},{@wipe [v(db)]/MOTD-FULL;@motd/full ;@pemit %#=GAME: You remove a MOTD.},{@pemit %#=ERROR: Invalid MOTD number.} &CMD-MOTD_LIST SGP - Wizard Globals=$+motd/list:@pemit %#=[center(Currently Set MOTD,78,=)]%rGeneral:[iter(u(v(db)/MOTD-GEN_LIST),%r[member(u(v(db)/MOTD-GEN_LIST),##)]>%b[u(v(db)/MOTD-##)]%r)]%rWizard:[iter(u(v(db)/MOTD-WIZ_LIST),%r[member(u(v(db)/MOTD-WIZ_LIST),##)]>%b[u(v(db)/MOTD-##)]%r)]%rFull:%r[u(v(db)/MOTD-FULL)]%r%rDown:%r[u(v(db)/MOTD-DOWN)]%r[u(v(db)/footer)] &CMD-MOTD_RESET SGP - Wizard Globals=$+motd/reset:@motd [iter(u(v(db)/MOTD-GEN_LIST),%r[u(v(db)/MOTD-##)]%r)];@motd/wizard [iter(u(v(db)/MOTD-WIZ_LIST),%r[u(v(db)/MOTD-##)]%r)];@motd/down [u(v(db)/MOTD-DOWN)];@motd/full [u(v(db)/MOTD-FULL)];@pemit %#=GAME: MOTD's reset. @startup SGP - Wizard Globals=+motd/reset @@ @@ +help files for +motd @@ @pemit me=Adding wizhelp for +motd commands....Moment. &WIZHELP_+MOTD Help Data=[repeat(-,78)]%R+motd%R%R[space(2)]SYNTAX: +motd/list%R[space(10)]+motd/set =%R[space(10)]+motd/del =%R[space(10)]+motd/reset[space(3)]%R%R[space(2)]This code allows for easier manipulation of the @motd command and the use of %R[space(2)]softcoded MOTD to create semi-permanent MOTD.[space(2)]%R[space(2)]%R[space(2)]The first command lists the stored MOTD messages in order from oldest to %R[space(2)]newest, by MOTD type.[space(2)]The types listed are: general, wizard, down, and %R[space(2)]full.[space(2)]%R[space(2)]%R[space(2)]The second command sets an MOTD attribute to the global parent.[space(2)]You select %R[space(2)]the type from the above list and set the message of your choosing.[space(2)]%R[space(2)]%t%R[space(2)]> +motd/set general=This is an MOTD.%R%R[space(2)]The third command removes a selected MOTD # from a given MOTD listing.[space(2)]In %R[space(2)]the above example, the message number is 1 in the general list. %R%R[space(2)]> +motd/del general=1 %R[space(2)]%R[space(2)]The last command resets the +motd system so that the game will read the %R[space(2)]MOTDs appropriately.[space(2)]This code is called as part of the @startup for the %R[space(2)]object.%R[repeat(-,78)] @@ @@ Edit to the WIZLIST_COMMANDS attrubute required for +motd to show up properly @@ in the +wizhelp listing for Penn and Tiny 2.2. @@ @pemit me=Editting WIZLIST_COMMANDS on the +help data object to add +motd listing. Check to make sure the '|+motd' appended properly. @edit SGP- Help Data/WIZLIST_COMMANDS=$,|+motd @@ @@ +3who patch to the main globals object. @@ @pemit me=Patching +3who...Moment. &CMD-PLUS-3WHO SGP - Main Globals=$+3who:@pemit %#=setq(0,v(db))[setq(7,0)][u(v(db)/header)]%B[repeat(|NAME[space(9)]On for Idle,3)]|%r%b|----------- ------- ----|----------- ------- ----|----------- ------- ----[setq(1,0)][setq(8,iter(lwho(),switch(hasflag(##,dark),1,,setq(9,%q9[setq(1,add(%q1,1))][switch(mod(%q1,3),1,|%r%b)]|[ljust(mid(name(##),0,12),12)][u(%q0/twodigconn,conn(##))][rjust(mid(u(%q0/idletime,idle(##)),0,5),5)]))[setq(7,add(%q7,1))]))]%q9%r%b|[repeat(-,74)]|%r%b%b%q7 players connected.%R[u(v(db)/footer)] &TWODIGCONN SGP - Global Parent Object=switch(1,lt(%0,60),rjust(7,%0s),lt(%0,3600),rjust(div(%0,60)m,3)[rjust(mod(%0s,60),4)],lt(%0,86400),rjust(div(%0,3600)h,3)[rjust(div(mod(%0,3600),60)m,4)],rjust(div(%0,86400)d,3)[rjust(div(mod(%0,3600),3600)h,4)]) &IDLETIME SGP - Global Parent Object=switch(1,lt(%0,60),%0s,lt(%0,3600),div(%0,60)m,lt(%0,86400),div(%0,3600)h,div(%0,86400)d) @pemit me=Adding +who *...Moment. &CMD-PLUS-WHO-SORTED #59=$+who *: @pemit %#=[u(v(db)/header)][ljust(Player,15,)] [ljust(Sex,3)] [ljust(Alias,5)][rjust(Idle,6)] [ljust(mid(Location,0,28),28,)] [ljust(dbref,6)]%R[u(v(db)/footer)][setq(1, iter(lwho(),switch(strmatch(name(##),%0*),0,,##)))][iter(sortby(v(db)/namesort,%q1),switch(and(hasflag(##,dark),not(isstaff(%#))),1,,%R[ljust(name(##),15,.)] [ljust(mid(u(##/sex),0,1),3)] [ljust(mid(u(##/alias),0,5),5)][rjust(mid(u(v(db)/secs2hrs,idle(##)),0,6),6)] [ljust(switch(and(or(hasflag(##,unfindable),hasflag(loc(##),unfindable)),not(or(hasflag(%#,wizard),hasflag(%#,immortal)))),1,,mid(name(room(##)),0,28)),28,.)] [ljust(switch(or(isstaff(%#),and(hasflag(loc(##),JUMP_OK),not(hasflag(##,UNFINDABLE)),not(hasflag(loc(##),UNFINDABLE)))),0,,mid(room(##),0,5)),6,.)][ljust(switch(1,ostaff(##),Staff),6)]))]%r[u(v(db)/footer)]%RThere are [words(sortby(v(db)/cansee,lwho()))] players connected%R[u(v(db)/footer)] &NAMESORT SGP - Global Parent Object=[comp(name(%0),name(%1))] &HELP_+WHO SGP - Help Data=[repeat(-,78)]%R+who%R%R[space(2)]SYNTAX: +who%R[space(10)]+who %R%R[space(2)]This command displays Player, Gender, Alias, Idletime, Location, dbref of %R[space(2)]location if findable and set JUMP_OK, and if the player is also staff.%R%R[space(2)]The second version of this command accepts an argument and allow you to see%R[space(2)]only connected players who match the argument given, such as looking for all%R[space(2)]players whose names start with an 'm'.%R%R[space(2)]The staff version of this code shows DARK staff, location, and dbref of %R[space(2)]locations.%R[repeat(-,78)] @pemit me=Patching FN_ANDLIST...Moment. &FN_ANDLIST SGP - Global Functions=iter(ldelete(%0,words(%0,%1),%1),##%,,%1) and [last(%0,%1)] @pemit me=Patching Complete!