CMUD/ZMUD Script Samples

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
User avatar
Earth
Great Adventurer
Posts: 159
Joined: 04 Mar 2010 16:40
Location: Southern California, USA

CMUD/ZMUD Script Samples

Post by Earth » 19 Jan 2011 21:23

Hi all, as promised on another thread, I'm sharing some of the scripts that I have developed over the years. Probably the most useful script class I've written are my communication scripts.

One set of communication scripts captures speech from conversations and highlights them in green and also moves a copy of the speech to another window. I have added three variables which help with the processing:

SpeakVerbs: The list of verbs which the script uses to identify the line you want to capture. (Example: says, whispers, asks, whines, etc.)

IgnorePeople: The list of people/creatures/etc for which you want the trigger to avoid capturing. (Examples: elite guard, forest troll, Donut, etc.)

SpeakExceptions: The set of phrases sentences that you want the trigger to ignore. Here I put in all Knight and Calian battlecries, ship speech, and other spam from combat you want to ignore ("You scum stop fighting my friend, you puny human!").

The trigger itself is one line, and it does a capture of one line of text to a new window named Converse, then highlights the whole line green.

One more thing, the trigger expects that you have "options autowrap off" in game, so that you will capture everything said and not just the first line of it.

So here is the code which I think should work in Zmud:

Code: Select all

#var SpeakVerbs {agrees|ahoys|announces|answers|asks|blurts|booms|breathes|carols|chatters|communicates|coos|explains|hints|implies|indicates|inquires|maiden|mentions|mumbles|observes|ponders|ponders|pouts|queries|remarks|replies|roars|says|shouts|signals|sings|smiles|snaps|speaks|thinks|thunders|utters|warbles|whispers|wonders|yells}

#var IgnorePeople {elite guard|forest troll|Donut}

#var SpeakExceptions {All aboard!|Buy your tickets now or stay ashore!|Buy your tickets or stay ashore!|By the Measure!|By the Oath and the Measure!|Die enemy of the Minotaur race!|Disembark!|For Solamnia!|For the Knighthood!|For the order of the crown!|For the order of the rose!|For the order of the sword!|For the Shire!|For Vingaard and the Orders!|For Vingaard!|Habbakuk!|I don't need to do anything with it.|In the name of courage!|In the name of honour!|In the name of justice!|It has been fixed as much as possible, I can do nothing more.|Kiri-Jolith!|Last Call from Genesis ShipLines!|Next stop is|Paladine!|Thank you for putting your money in our trust.|Victory to the Knighthood!|We also keep gems for you at another branch of the GoG.|We have arrived at|Welcome to Genesis ShipLines!|You have placed the following money in our trust:|You scum stop fighting my friend, you puny human!}

#trig {{^@IgnorePeople} {@speakverbs}(*)~: {^@SpeakExceptions}(*)} {#capture 1 Converse;#color green}
I like to support Zugg, so as an incentive for you to go out and buy a licensed copy of CMUD, you can import my whole communication library via xml. The following code only works with an xml import function I believe that is unique to recent versions of cmud.

Code: Select all

<class name="Communication" id="1759">
  <trigger priority="60" id="6">
    <pattern>{^@IgnorePeople} {@speakverbs}(*)~: {^@SpeakExceptions}(*)</pattern>
    <value>#if (%ends(%1,"mighty war cry")) {} {#if (%ends(%2, "You should know better than to attack a minotaur.")) {} {#capture 1 Converse
#color green}}</value>
  </trigger>
  <trigger priority="600" id="60">
    <pattern>You {say|utter|ask|shout|whisper}*~: {^For Solamnia~!|For the order of the rose~!|For Vingaard~!|By the Oath and the Measure~!|For the Knighthood~!|Paladine~!|By the Measure!|For Vingaard and the Orders~!|Victory to the Knighthood~!|In the name of justice~!}*</pattern>
    <value>#capture 1 Converse
#color green</value>
  </trigger>
  <var name="SpeakVerbs" type="StringList" sorted="1" id="305">
    <value>agrees|ahoys|announces|answers|asks|blurts|booms|breathes|carols|chatters|communicates|coos|explains|hints|implies|indicates|inquires|maiden|mentions|mumbles|observes|ponders|ponders|pouts|queries|remarks|replies|roars|says|shouts|signals|sings|smiles|snaps|speaks|thinks|thunders|utters|warbles|whispers|wonders|yells</value>
    <json>["agrees","ahoys","announces","answers","asks","blurts","booms","breathes","carols","chatters","communicates","coos","explains","hints","implies","indicates","inquires","maiden","mentions","mumbles","observes","ponders","ponders","pouts","queries","remarks","replies","roars","says","shouts","signals","sings","smiles","snaps","speaks","thinks","thunders","utters","warbles","whispers","wonders","yells"]</json>
  </var>
  <var name="SpeakExceptions" type="StringList" sorted="1" id="348">
    <value>All aboard!|Buy your tickets now or stay ashore!|Buy your tickets or stay ashore!|By the Measure!|By the Oath and the Measure!|Die enemy of the Minotaur race!|Disembark!|For Solamnia!|For the Knighthood!|For the order of the crown!|For the order of the rose!|For the order of the sword!|For the Shire!|For Vingaard and the Orders!|For Vingaard!|Habbakuk!|I don't need to do anything with it.|In the name of courage!|In the name of honour!|In the name of justice!|It has been fixed as much as possible, I can do nothing more.|Kiri-Jolith!|Last Call from Genesis ShipLines!|Next stop is|Paladine!|Thank you for putting your money in our trust.|Victory to the Knighthood!|We also keep gems for you at another branch of the GoG.|We have arrived at|Welcome to Genesis ShipLines!|You have placed the following money in our trust:|You scum stop fighting my friend, you puny human!</value>
    <json>["All aboard!","Buy your tickets now or stay ashore!","Buy your tickets or stay ashore!","By the Measure!","By the Oath and the Measure!","Die enemy of the Minotaur race!","Disembark!","For Solamnia!","For the Knighthood!","For the order of the crown!","For the order of the rose!","For the order of the sword!","For the Shire!","For Vingaard and the Orders!","For Vingaard!","Habbakuk!","I don't need to do anything with it.","In the name of courage!","In the name of honour!","In the name of justice!","It has been fixed as much as possible, I can do nothing more.","Kiri-Jolith!","Last Call from Genesis ShipLines!","Next stop is","Paladine!","Thank you for putting your money in our trust.","Victory to the Knighthood!","We also keep gems for you at another branch of the GoG.","We have arrived at","Welcome to Genesis ShipLines!","You have placed the following money in our trust:","You scum stop fighting my friend, you puny human!"]</json>
  </var>
  <trigger priority="4740" id="474">
    <pattern><Newbie></pattern>
    <value>#Capture 1 Converse
#color green</value>
  </trigger>
  <trigger priority="10280" id="1028">
    <pattern>* hands you a letter and says: I have a letter for you from (*)</pattern>
    <value>#color white
#window converse %time() - Message from %1</value>
  </trigger>
  <trigger priority="13350" id="1335">
    <pattern>The voice of * suddenly invades your mind saying: *</pattern>
    <value>#color green
#window converse %time() - %1</value>
  </trigger>
  <trigger priority="17580" id="1758">
    <pattern>arrives jogging and hands you a message from (*).</pattern>
    <value>#color white
#window converse %time() - Letter from %1</value>
  </trigger>
  <trigger priority="17600" id="1760">
    <pattern>A brown monkey runs towards you and jumps back on your shoulder. * gives you a message from (*).</pattern>
    <value>#color white
#window converse %time() - Message from %1</value>
  </trigger>
  <trigger priority="22630" id="2263">
    <pattern>eagle descends from the sky, lands on your shoulder and gives you a message from (*).</pattern>
    <value>#color white
#window converse %time() - Message from %1</value>
  </trigger>
  <trigger priority="34970" id="3497">
    <pattern>tells you~: (*)</pattern>
    <value>#color green
#window converse %time() - @TellID: %1</value>
  </trigger>
  <trigger priority="35670" id="3567">
    <pattern>chipmunk scampers up to you with a message from (*). You</pattern>
    <value>#color white
#window converse %time() - Message from %1</value>
  </trigger>
  <trigger priority="10280" id="12179">
    <pattern>A red-winged harrekki descends from above, sinks its talons into your arm, and gives you a message from (*).</pattern>
    <value>#color white
#window converse %time() - Message from %1</value>
  </trigger>
  <trigger priority="123580" id="12358">
    <pattern>Postmaster tells you that you have (*).</pattern>
    <value>#color white
#window converse %time() - %1</value>
  </trigger>
  <trigger priority="124250" id="12425">
    <pattern>As if from behind you, you hear*whispering:</pattern>
  </trigger>
  <trigger priority="124450" id="12445">
    <pattern>An apparition of (*) appears to you.</pattern>
    <value>TellID = %1</value>
  </trigger>
  <var name="TellId" id="12446">Armageddon</var>
  <trigger priority="124470" id="12447">
    <pattern>You replied to *:</pattern>
    <value>#capture 1 Converse
#color green</value>
  </trigger>
  <trigger priority="127980" id="12798">
    <pattern>faerie flutters down from above and lands on your shoulder, handing you a rolled up scroll.</pattern>
    <value>#color white
#window converse %time() - Faerie scroll from a kender.</value>
  </trigger>
  <trigger priority="128560" id="12856">
    <pattern>A cold voice thunders from beneath * mask,(*)</pattern>
    <value>#Capture 1 Converse
#color green</value>
  </trigger>
  <var name="IgnorePeople" type="StringList" id="12927">
    <value>elite guard|forest troll|Donut</value>
    <json>["elite guard","forest troll","Donut"]</json>
  </var>
</class>

Feel free to comment on the above or make requests for other things you would like to see scripts for.

User avatar
Alorrana
Myth
Posts: 1016
Joined: 04 Mar 2010 11:23
Location: Mordor. passing gass.

Re: CMUD/ZMUD Script Samples

Post by Alorrana » 19 Jan 2011 21:40

Gont, Kabal, Mithas, Qualinesti, Terel Trolls, :-P

Nah just kidding, good work.
I’m not a complete idiot. Some pieces are missing.

Greneth

Re: CMUD/ZMUD Script Samples

Post by Greneth » 19 Jan 2011 22:13

autowrap is off yet its only capturing the first line for me for the converse window. Had a bit of a problem with the project as well as when depositing coins.
Last edited by Greneth on 19 Jan 2011 22:17, edited 1 time in total.

User avatar
Earth
Great Adventurer
Posts: 159
Joined: 04 Mar 2010 16:40
Location: Southern California, USA

Re: CMUD/ZMUD Script Samples

Post by Earth » 19 Jan 2011 22:16

Zmud or Cmud? Autowrap is off in game right? Also, are you connecting directly to Genesis or through some other server first?

Greneth

Re: CMUD/ZMUD Script Samples

Post by Greneth » 19 Jan 2011 22:21

Earth wrote:Zmud or Cmud? Autowrap is off in game right? Also, are you connecting directly to Genesis or through some other server first?
Yeah that was kinda bad info on my part, sorry ;)

Cmud, "options autowrap off", directly to genesis


Also is it possible to change the color of the txt within the converse window?

User avatar
Earth
Great Adventurer
Posts: 159
Joined: 04 Mar 2010 16:40
Location: Southern California, USA

Re: CMUD/ZMUD Script Samples

Post by Earth » 19 Jan 2011 23:10

Greneth wrote:
Earth wrote:Zmud or Cmud? Autowrap is off in game right? Also, are you connecting directly to Genesis or through some other server first?
Yeah that was kinda bad info on my part, sorry ;)

Cmud, "options autowrap off", directly to genesis


Also is it possible to change the color of the txt within the converse window?
Under Settings in CMUD, make sure you turn off "auto wrap" feature. It's under the Session section, under "word wrap" tab.

In regards to the color, yes you can. Simply change the order of the #color line in the trigger to be first before the #capture line.

Greneth

Re: CMUD/ZMUD Script Samples

Post by Greneth » 19 Jan 2011 23:36

Still the same thing with it turned off in the cmud settings as well

User avatar
Earth
Great Adventurer
Posts: 159
Joined: 04 Mar 2010 16:40
Location: Southern California, USA

Re: CMUD/ZMUD Script Samples

Post by Earth » 19 Jan 2011 23:47

Greneth wrote:Still the same thing with it turned off in the cmud settings as well
I should ask, what version of CMUD are you using?

Greneth

Re: CMUD/ZMUD Script Samples

Post by Greneth » 19 Jan 2011 23:49

3.32

Johnny
Veteran
Posts: 226
Joined: 02 Apr 2010 09:33
Location: Washington State

Re: CMUD/ZMUD Script Samples

Post by Johnny » 19 Jan 2011 23:59

Earth, youre good.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/