ZMud Scripts

From LSWiki

Jump to: navigation, search

This is a place for people to post and share ZMud Scripts that might be of interest to others.

Simple Chat Capture

This script will properly capture long multi-line OOC channel chats to a seperate window. In order for this to work properly, you must execute the command:

switch depiction Quote Channel Text

so that OOC channel chats are bounded by double quotation marks.

Just copy and paste this into your command line, no spaces, and it should work:

#TRIGGER {(*)~[OOC (%w) (*)~]$} {#CAP Chats}
#TRIGGER {(*)~[OOC (%w)~] ~"(*)} {
  #CAP Chats
  #C+ Chats
#TRIGGER {^Capture text OFF$} {#GAG}
#TRIGGER {^Capture text ON$} {#GAG}
#TRIGGER {~"$} {#C-}


Alright, this is something I used when I played on another mud. It's a combonation/modification of a tf speedwalk script one player there used for directions (Conglomo), and the zMud way of doing things a seperate player used (Endy), with some of my own twists. The idea is this: You use a variable (in this case named "dirs", inside the class "Speedwalks") to hold a list of area names and directions to get to each area. You can then type

goto <area>

and walk there. You need to make this variable yourself. It should be of type "Data Record" should contain a list that looks something like this:

lhareaname | go xxn, xxw, xxwhatever
areanamelh | go xxwhateverbackwards, xxe, xxs

with one for each area you'd like to speedwalk to. It should be located in the "Speedwalks" class. I like using lh[] as the central location for my directions. In order to return from the area you walked to, you need to go to the same exact spot your directions walked you to when arriving, then type:

goto lh

Here's the class itself:

#CLASS {Speedwalks}
 #ALIAS goto {#IF (%1 == "lh") {Speedwalks/current_run = @Speedwalks/current_area;
  #ADD Speedwalks/current_run lh;
  #EXEC %db( @Speedwalks/dirs, @current_run)} {Speedwalks/current_run = lh%1;Speedwalks/current_area = %1;
  #EXEC %db( @Speedwalks/dirs, @current_run)}}
 #ALIAS showdirs {%2 From LH~[~], %1~: %db( @Speedwalks/dirs, lh%1)}
 #VAR current_run {}
 #VAR current_area {}

Also, there is a command (showdirs) that you can use to give directions from lh[] to someone. You use it like this:

showdirs area channel
example: showdirs sanctuary ooc

I'm considering changing this to be intelligent, in that it will track your location and be able to extrapolate directions using basic math on the fly to go from place to place without using losthaven as a central spot to pass through, but am still thinking it through. Elegance is often in simplicity, and that might end up a little complex, with some gotchas for non-passable barriers. Anyways, enjoy the dumb version!

Graphical Gauges

This is more an example of how to do it than anything else, because I'm sure many people have sbars setup the way they prefer already. Here goes:

First, my sbar:

{{black}HP:}{{red}%hp/%mhp} {{black}CHST:}{{red}%chst/%mchst} {{black}HD:}{{red}%head/%mhead} {{black}SP:}{{blue}%sp/%msp} 
{{black}END:}{{green}%end/%mend} {{black}SPD:}{{cyan}%spd} {{black}C:}{{yellow}%cash/%mcash} {{black}TNL: %nexp} {{black}
E:}%hlth {{black}A:}{{white}%arean}{{black}>>}

Next, my gauge class, with a trigger pulling values from this sbar directly into variables, and the gauges themselves:

#CLASS {Gauges}
 #TRIGGER {HP:&hp/&maxhp CHST:&chst/&maxchst HD:&head/&maxhead SP:&sp/&maxsp END:&end/&maxend SPD:&spd C:&money/&maxmoney TNL:        
 xpleft E:&EnemyShape A:(*)>>} {#IF (@EnemyShape =~ "None") {EnemyHP = 0};#IF (@EnemyShape =~ "in good shape") {EnemyHP = 100};#IF 
 (@EnemyShape =~ "slightly hurt") {EnemyHP = 83};#IF (@EnemyShape =~ "somewhat hurt") {EnemyHP = 66};#IF (@EnemyShape =~ "in bad 
 shape") {@EnemyHP = 49};#IF (@EnemyShape =~ "in very bad shape") {EnemyHP = 32};#IF (@EnemyShape =~ "at death's door") {EnemyHP = 
 #BUTTON 1 {HP:@hp/@maxhp} {} {} {} {@hp} {} {} {Size} {180} {22} {Pos} {1} {2} {32847} {} {Gauge||13|@maxhp|@maxhp/25|0} {} "" 
 {Explore} {} {} {2}
 #BUTTON 2 {SP:@sp/@maxsp} {} {} {} {@sp} {} {} {Size} {180} {22} {} {} {} {32799} {} {Gauge||11|@maxsp|@maxsp/10|0} {} ""  
 {Explore} {} {} {2}
 #BUTTON 3 {END:@end/@maxend} {} {} {} {@end} {} {} {Size} {180} {22} {} {} {} {47} {} {Gauge||10|@maxend|@maxend/25|0} {} "" 
 {Explore} {} {} {2}
 #BUTTON 4 {Enemy: @EnemyShape} {} {} {} {@EnemyHP} {} {} {Size} {180} {22} {} {} {} {95} {} {Gauge||13|100|10|0} {} "" {Explore} 
 {} {} {3}

I'm not sure if this one will copy and past cleanly, because the trigger has to match the number of spaces twixt the various elements of the sbar in order to fire. It does give an idea of how to write the trigger and have it dump values straight into variables, though. The buttons are the gauges. It's just how zmud does it.

Personal tools