User:Nerdvana

From City of Hope MUSH
Revision as of 16:39, 21 August 2020 by Nerdvana (talk | contribs) (→‎Code)
Jump to navigation Jump to search

Code

As I code things I'll include them here if they are minor, if they are major I'll make separate pages for them.

LATTR commands

These commands list the attributes on any object you can control/examine. The first lists any/all attributes on such an object by attribute name, the second does the same but displays name and a single line of the attribute's value, and the third lists any $-command attributes on the object that meet the wild card called on and displays the whole attribute for that command attribute.

&CMD-LATTR me=$.lattr *:@pemit %#=[case(lattr(%0),#-1,You are not allowed to evaluate that object.,{%xh%xb[repeat(-,79)] %r%r%xgAttribute Listing for %xw[name(objeval(%#,num(first(%0,/))))]%xy([num(objeval(%#,num(first(%0,/))))][flags(objeval(%#,num(first(%0,/))))])%xn %r%r[switch(words(%0,/),1,columns(sort(lattr(objeval(%#,num(first(%0,/))))),25),2,columns(sort(lattr(objeval(%#,[num(first(%0,/))]/[rest(%0,/)]))),25))] %r%xh%xb[repeat(-,79)]})]%xn

&CMD-LATTR1 me=$.lattr1 *:@switch [setr(0,locate(%#,before(%0,/),*))]=#-1,{@pemit %#=Item '%0' not found.},#-2,{@pemit %#=Multiple items match '%0'. Please be more specific.},{@pemit %#=[repeat(%xc-%xn,78)]%R[center(Attributes on [fullname(%q0)],78)]%R[repeat(%xc-%xn,78)];@pemit %#=[list(lattr(%q0),[ljust(##,20)][left(get(%q0/##),58)])][repeat(%xc-%xn,78)]}

&CMD-LATTRCMDS me=$.lattrcmds *:@switch [setr(0,locate(%#,before(%0,/),*))]=#-1,{@pemit %#=Item '%0' not found.},#-2,{@pemit %#=Multiple items match '%0'. Please be more specific.},{@pemit %#=[repeat(%xc-%xn,78)]%R[center(Commands on [fullname(%q0)]\(%q0[flags(%q0)]\),78)]%R[repeat(%xc-%xn,78)]%R;@pemit %#=[list(lattrcmds(%0),[ljust(before(after(get(%q0/##),$),:),20)][wrap(after(get(%q0/##),:),58,,,,20)])]%R[repeat(%xc-%xn,78)]}

Modified @adesc

The following code makes it so that you do not trigger your own Adesc when you look at yourself (overriding the default Player @adesc) and displays the looker's name with their @moniker.

@adesc me=@break strmatch(%#,%!)=think [moniker(%#)] just looked at you.

Personal Descer

I have uploaded my own descer code. There's enough to it that I've made a separate page for it here.

Helpful Links

Descing