User:Eochaid

From LiberationMUSH Wiki

Pick a random player

&cmd.random.player me=$+name/random:th The name drawn from the hat is: [cname(randextract(setdiff(lcon(%l/connect),u(var.names.ignored))))]
&cmd.random.remove me=$+name/include *:@dolist/inline/delimit %; %0={&var.name.ignored me=[setdiff(u(var.names.ignored),num(trim(##)))]}
&cmd.random.ignore me=$+name/exclude *:@dolist/inline/delimit %; %0={&var.names.ignored me=[setunion(u(var.names.ignored),num(trim(##)))]}
&cmd.random.clear me=$+name/clear:&var.names.ignored me=

Dreaming Code

How to set a player bit's dreaming desc. This is no longer needed for places and the fix for players will be rolled out eventually.

&faedesc me=<your desc text goes here>
&dreamingdesc me=%x0x2e[wrap(u(faedesc),74)]%xn

Breaking this down:

The first line sets an arbitrary value called faedesc on on the room. This allows commas without having to worry about the comma breaking the wrap function.

The %x0x2e is a color choice. If you type +palette, you'll see the full range of colors. You can pick your own.

The stuff within the square brackets is softcode that gets the value of the faedesc value and wraps it to a column 78 characters wide, which is the server default.

%xn then sets the color to normal so that the autumn description is not also the color of your faedesc.

Have fun out there Dreambeings.

Emit and Pose

&CMD.POSE me=$+pose *:@emit [setq(n,[u(color.normal)])][setq(h,[u(color.highlight)])]%qn%t%n [subeval(%0,,1)]
@set me/CMD.POSE = no_parse
&CMD.EMIT me=$+emit *:@emit [setq(n,[u(color.normal)])][setq(h,[u(color.highlight)])]%qn%t[subeval(%0,,1)]
@set me/CMD.EMIT = no_parse
&color.normal me=%x0x28
&color.highlight me=%x0x77

Then, instead of using %xh to highlight text and %xn to make it normal again; you use %qh to highlight it and %qn to make it normal again.

Fae Views Code

This emulates +view with one exception. It does not show that there are fae views automatically. You should place a line to the effect of There are +faeviews here at the end of your dreamingdesc.

&CMD.FAEVIEW here=$^\+(\?\:faeview|faeviews)?( .+)?$:@ifelse t(%1)={th [setq(raw_view,trim(%1))][setq(view,faeview_[edit(r(raw_view),%b,_)])];@assert [hasattr(%l/[r(view)])]=@pemit %#=No view %xh%xg[r(raw_view)]%xn found here.;@pemit %#=[center(%b%xh[name(%l)]%xn's %xh%xg[r(raw_view)]%xn view%b,78,=)]%r[u(r(view))]%r[repeat(=,78)]},@pemit %#=[center(%b%xh[name(%l)]%xn's +faeviews%b,78,=)]%r[iter(lattr(me/faeview_*),[u(fnc.clean_view_name,edit(##,FAEVIEW_,))],%b,%r)]%r[repeat(=,78)]
@set here/CMD.FAEVIEW = regexp
&FAEVIEW_TEST_UNDERSCORE here=Testing underscores
&FNC.CLEAN_VIEW_NAME here=[iter(%0,capstr(lcstr(##)),_,%b)]
@set here=!no_command

Once this is done, adding a fae view is as simple as

&faeview_name_of_view here=<view text>

Login code

The following code will show you your events, outstanding requests, and the Changeling Directors Announcement board when you log in.

@Aconnect me=+events;+request;+bbread 34