Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Nov 29, 2007 2:03 am   

Stutter Script Enhancement cMud
 
I saw someone enhanced my old stutter script and I ported it over to cMUD to see if I can get it to work for me. For some reason it jumbles my string variables.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<module name="Communication" global="true">
  <uid>{D1B52B4E-B3D1-4F0D-9FDF-8F05F72D47C1}</uid>
  <class name="stutter">
    <alias name="stex">
      <value>mood = 1
stutter %-1</value>
    </alias>
    <alias name="st">
      <value>mood = 1
stutter %-1</value>
    </alias>
    <alias name="stconf">
      <value>mood = 10
stutter %-1</value>
    </alias>
    <alias name="stHelp">
      <value><![CDATA[#CLR
#ECHO <color red><b>This Program was created to be able to stutter in a language.</b></color>
#ECHO ""
#ECHO <color green><b>I hope you find this help file helpful</b></color>
#ECHO <color cyan>---------------------------------------------------</color>
#ECHO <color lightgreen>Alias: DelayStutterTime</color>
#ECHO <color cyan>This alias is used to delay the time of your stutter.</color>
#ECHO <color cyan>The higher the number the less your character will stutter.</color>
#ECHO <color yellow>------------------- USAGE -------------------</color>
#ECHO <color cyan>Example:</color>
#ECHO <color cyan>DelayStutterTime 3</color>
#ECHO <color cyan>---------------------------------------------------</color>
#ECHO <color lightgreen>Alias: stutter</color>
#ECHO <color cyan>This alias is used to make your character stutter. See more information below.</color>
#ECHO <color yellow>------------------- USAGE -------------------~</color>
#ECHO <color red><b>red</b></color> <color white>is for the command</color>
#ECHO <color lightgreen><b>green</b></color> <color white>is for the channel</color>
#ECHO <color purple><b>purple</b></color> <color white>is for the channel</color>
#ECHO <color yellow><b>yellow</b></color> <color white>is for the channel emphasis </color>
#ECHO <color cyan><b>cyan</b></color> <color white>is for the channel verbiage</color>
#ECHO ""
#ECHO <color cyan>Example 1:</color>
#ECHO ~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>
#ECHO ~<color cyan>Output 1:~</color>
#ECHO ~<color cyan>tell Dave My oh my. This i..i..is not for you. I will not do i..i..it?~</color>
#ECHO ""
#ECHO <color cyan>Example 2:</color>
#ECHO <color red><b>stutter</b></color> <color lightgreen><b>tell</b></color> <color purple><b>Dave</b></color> <color yellow><b>~(while smiling~) </b></color> <color cyan><b>My oh my. This is not for you. I will not do it?</b></color>
#ECHO <color cyan>Output 2:</color>
#ECHO <color cyan>tell Dave ~(while smiling) My oh my. This is not for you. I will not do it?</color>
#ECHO ""
#ECHO <color cyan>Example 3:</color>
#ECHO <color red><b>stutter</b></color> <color lightgreen><b>say</b></color> <color yellow><b>~(while smiling)</b></color> <color cyan><b>My oh my. This is not for you. I will not do it?</b></color>
#ECHO <color cyan>Output 3:</color>
#ECHO <color cyan>say ~(while smiling) M..M..My oh my. Th..Th..This is not for you. I will not do it?</color>
#ECHO ""
#ECHO <color cyan>Example 4:</color>
#ECHO <color red><b>stutter</b></color> <color lightgreen><b>say</b></color> <color yellow><b>~(while smiling)</b></color> <color cyan><b>My oh my. This is not for you. I will not do it?</b></color>
#ECHO <color cyan>Output 4:</color>
#ECHO <color cyan>You used the incorrect format for an emphasis</color>
#ECHO ""
#ECHO <color cyan>Example 5:</color>
#ECHO <color red><b>stutter</b></color> <color lightgreen><b>say</b></color> <color cyan><b>My oh my. This is not for you. I will not do it?</b></color>
#ECHO <color cyan>Output 4:</color>
#ECHO <color cyan>say M..M..My oh my. Th..Th..This is not for you. I will not do it?</color>]]></value>
    </alias>
    <var name="channel" type="String">tell</var>
    <var name="emph" type="Literal"/>
    <var name="input">My Oh m..m..my. Th..Th..This i..i..is not for you.</var>
    <var name="mood" type="String">3</var>
    <var name="output" type="String">I am confident stutterI am confident stutterI am confident stutterI am confident stutterI am confident stutterI am confident stutter</var>
    <var name="person">Dave</var>
    <var name="stutterlist">m|i|ch|th|st|g|c|l|j|t|th</var>
    <var name="s_word">i..i..is</var>
    <var name="sayto">tell|whisper|te</var>
    <var name="inval_emp">/|?|,|.|=|-|#</var>
    <var name="st_relay" type="String">4</var>
    <alias name="DelayStutterTime">
      <value>;This alias is used to change the stutter delay
; The higher the variable the less your character will stutter
#VARIABLE st_relay %1</value>
    </alias>
    <alias name="stutter" autoappend="true">
      <value>   #VARIABLE channel {%1}
   #VARIABLE input {%-2}
   #VARIABLE person "
   #VARIABLE emph "
   #VARIABLE loopcount 0
   #VARIABLE s_word "
   #VARIABLE input %replace( @input, " ", "|")
   #IF (%ismember( @channel, @sayto)) {
; Check to see if the channel is a member of the sayto list
      #VARIABLE input %replace( @input, "|", " ")
      #VARIABLE person %word( @input, 1)
      #VARIABLE input %replace( @input, " ", "|")
      #VARIABLE input %delitem( @person, @input)
      }
;Next check for an emphasis
   #IF (%match( @input.1, ~[|~])) {
      #VARIABLE emph @input.1
;Fix emphasis to have is using the incorrect format
      #IF (%match( @emph, "~~(")) {
         #SHOW You used the incorrect format for an emphasis
         #ABORT 1
         }
;Change input back to string list.
      #VARIABLE input %replace( @input, " ", "|")
      #VARIABLE input %delitem( @emph, @input)
      #VARIABLE emph %replace( @emph, "|", " ")
      #VARIABLE emph %concat( "(", @emph, ")")
      }
;Now check the remaining input variable and make it stutter
   #FORALL @input {
      #ADD loopcount 1
      #FORALL @stutterlist {
         #IF %begins( %i, %j) {
            #IF (%random( 1, 3)=1) {
               #IF (%i = "I" ) {#SHOW Should make this proper case.}
               #VARIABLE s_word %concat( %j, "..", %j, "..", %i)
               #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
               } //END RANDOM IF
            } // END BEGINS IF
; This IF is to check for Proper words.
         #IF %begins( %i, %proper( %j)) {
            #IF (%random( 1, 3)=1) {
               #IF (%i = "I" ) {#SHOW Should make this proper case.}
               #VARIABLE s_word %concat( %proper( %j), "..", %proper( %j), "..", %i)
               #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
               } //END RANDOM IF
            } // END PROPER CHECK IF
         }
      }
; Replace pipe symbols with space to display remaining input
   #VARIABLE input %replace( @input, "|", " ")
;********* Display the finished output ***********************
@channel @person @emph @input</value>
    </alias>
  </class>
</module>
</cmud>


Example: stutter tell Dave My Oh my. This is not for you.
Output: tellDaveMy Oh m..m..my. Th..Th..This i..i..is not for you.

See what happens... Anybody? I do know there are ~ characters in there that are no longer needed, but they still work. I plan on cleaning up the stHelp Alias.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Nov 29, 2007 4:15 am   
 
Well, if you're referring to my enhancement... you're missing the changes giggle. Its funny since I just posted that today, but I can see by your ending lines there that it isn't correct.

If you aren't, then ignore this or not as you please :)

Here is my enhanced version ported to cMUD. It WORKS if you use the stutter alias. If however you use one of the mood aliases (stex, stconf, and st), it just outputs your text to the channel with a trailing space. Maybe this is a bug, or maybe I'm missing something thats new in cMUD.

Code:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="Allynia.mud" usesession="false">
  <uid>{B458A1E0-B33A-4A86-8F07-3316F4E2CC67}</uid>
  <packages>English Keypad|English Directions|Allynia.mud|Various</packages>
  <class name="Stutter">
    <alias name="stutter">
      <value>#ECHO Stutter Called As: %1 %-2 a
#VARIABLE channel {%1}
#VARIABLE input {%-2}
#VARIABLE output ""
#VARIABLE person ""
#VARIABLE emph ""
#VARIABLE loopcount 0
#VARIABLE s_word ""
#VARIABLE input %replace( @input, " ", "|")
#IF (%ismember( @channel, @sayto)) {
  #VARIABLE input %replace( @input, "|", " ")
  #VARIABLE person %word( @input, 1)
  #VARIABLE input %replace( @input, " ", "|")
  #VARIABLE input %delitem( @person, @input)
  }
#IF (%match( @input.1, ~[|~])) {
  #VARIABLE emph @input.1
  #IF (%match( @emph, "~~(")) {
    #SHOW You used the incorrect format for an emphasis
    #ABORT 1
    }
  #VARIABLE input %replace( @input, " ", "|")
  #VARIABLE input %delitem( @emph, @input)
  #VARIABLE emph %replace( @emph, "|", " ")
  #VARIABLE emph %concat( "(", @emph, ")")
  }
#FORALL @input {
  #ADD loopcount 1
  #FORALL @stutterlist {
    #IF %begins( %i, %j) {
      #IF (%random( 1, @mood)=1) {
        #IF (%i = "I" ) {#SHOW Should make this proper case.}
        #VARIABLE s_word %concat( %j, "..", %j, "..", %i)
        #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
        } //END RANDOM IF
      } // END BEGINS IF
    #IF %begins( %i, %proper( %j)) {
      #IF (%random( 1, @mood)=1) {
        #IF (%i = "I" ) {#SHOW Should make this proper case.}
        #VARIABLE s_word %concat( %proper( %j), "..", %proper( %j), "..", %i)
        #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
        } //END RANDOM IF
      } // END PROPER CHECK IF
    }
  }
#VARIABLE input %replace( @input, "|", " ")
#IF (@person != "") {#VARIABLE output %concat( @output, @person, " ")}
#IF (@emph != "") {#VARIABLE output %concat( @output, @emph, " ")}
#VARIABLE output %concat(" ", @output, @input)
@channel @output
mood = 3</value>
    </alias>
    <alias name="stex">
      <value>mood = 1
stutter %-1</value>
    </alias>
    <alias name="stconf">
      <value>mood = 10
stutter %-1</value>
    </alias>
    <alias name="st">
      <value>mood = 3
stutter %-1</value>
    </alias>
    <alias name="DelayStutterTime">
      <value>#VARIABLE st_relay {%1}</value>
    </alias>
    <alias name="stHelp">
      <value><![CDATA[#CLR
#SHOW {""}
#SHOW {~<color red>~<b>This Program was created to be able to stutter in a language.~</b>~</color>}
#SHOW {~<color green>~<b>I hope you find this help file helpful~</b>~</color>}
#SHOW {~<color cyan>---------------------------------------------------~</color>}
#SHOW {~<color lightgreen>Alias: DelayStutterTime~</color>}
#SHOW {~<color cyan>This alias is used to delay the time of your stutter.~</color>}
#SHOW {~<color cyan>The higher the number the less your character will stutter.~</color>}
#SHOW {~<color yellow>------------------- USAGE -------------------~</color>}
#SHOW {~<color cyan>Example:~</color>}
#SHOW {~<color cyan>DelayStutterTime 3~</color>}
#SHOW {~<color cyan>---------------------------------------------------~</color>}
#SHOW {~<color lightgreen>Alias: stutter~</color>}
#SHOW {~<color cyan>This alias is used to make your character stutter. See more information below.~</color>}
#SHOW {~<color yellow>------------------- USAGE -------------------~</color>}
#SHOW {~<color red>~<b>red~</b>~</color> ~<color white>is for the command~</color>}
#SHOW {~<color lightgreen>~<b>green~</b>~</color> ~<color white>is for the channel~</color>}
#SHOW {~<color purple>~<b>purple~</b>~</color> ~<color white>is for the channel~</color>}
#SHOW {~<color yellow>~<b>yellow~</b>~</color> ~<color white>is for the channel emphasis ~</color>}
#SHOW {~<color cyan>~<b>cyan~</b>~</color> ~<color white>is for the channel verbiage~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 1:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 1:~</color>}
#SHOW {~<color cyan>tell Dave My oh my. This i..i..is not for you. I will not do i..i..it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 2:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color yellow>~<b>(while smiling) ~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 2:~</color>}
#SHOW {~<color cyan>tell Dave (while smiling) My oh my. This is not for you. I will not do it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 3:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color yellow>~<b>(while smiling)~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 3:~</color>}
#SHOW {~<color cyan>say (while smiling) M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 4:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color yellow>~<b>~/(while smiling)~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 4:~</color>}
#SHOW {~<color cyan>You used the incorrect format for an emphasis~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 5:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 4:~</color>}
#SHOW {~<color cyan>say M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>}
#CR]]></value>
    </alias>
    <var name="stutterlist" type="StringList">m|i|ch|th|st|g|c|l|j|t</var>
    <var name="sayto" type="StringList">tell|whisper|te</var>
    <var name="input"/>
    <var name="inval_emph" type="StringList">/|?|,|.|=|-|#</var>
    <var name="emph" type="Literal"/>
    <var name="loopcount">0</var>
    <var name="s_word" type="Literal"/>
    <var name="ouput"/>
    <var name="mood">3</var>
  </class>
</window>
</cmud>
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Nov 29, 2007 1:57 pm   
 
That isn't the issue. Look at the las line in my above post. The variable aren't being displayed correctly.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Nov 29, 2007 5:01 pm   
 
darmir wrote:

That isn't the issue. Look at the las line in my above post. The variable aren't being displayed correctly.


Grin, what I posted doesn't do that. It outputs correctly.
It looks to me that when you use cMUD to do the
@channel @person @emph @input it doesn't count the spaces between the variables.
Quick fix you can do is:
Replace
Code:

@channel @person @emph @input

with
Code:

#VARIABLE input %concat(" ", @person, " ", @emph, " ", @input)
@channel @input


I replaced it with THIS instead, to avoid the extra spaces:
Code:

#IF (@person != "") {#VARIABLE output %concat( @output, @person, " ")}
#IF (@emph != "") {#VARIABLE output %concat( @output, @emph, " ")}
#VARIABLE output %concat(" ", @output, @input)
@channel @output


Note that final concatenation to prepend a space to the output var so that there is a space between the channel and the text when its actually sent to the MUD.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Nov 29, 2007 7:51 pm   
 
Ah, there it is. You can't start a line with a variable or a function in CMUD - a line MUST start with a command, either a zScript command, an alias, or literal text to send to the MUD. You can use #send, #sendraw or #exec to get CMUD to sent commands to the MUD, but just a variable on a line on its own won't work.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Nov 29, 2007 10:32 pm   
 
We've discussed and mostly fixed this in the Beta forums since we're still experiencing a single specific problem with it that I'm waiting for a response from Zugg on.
Once we're fully working I'll repost with a new xml export of the full version. We do have it working, but only because we're using a work AROUND. Once Zugg decides
what will be proper behavior for what I'm discussing there, then I'll post it corrected.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Nov 30, 2007 2:43 pm   
 
Your script is tempting me to write a package of text filters, but I know I'll never have the time. Still, it would be fun to have a package of functions to simulate the old UNIX filters: jive, valspeak, swedishchef, etc. Very Happy
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Dec 01, 2007 5:01 am   
 
Actually darmir and I are discussing a "lisp" script to go with this one.
And I also have a morse code script and a "code" talker script that could be fun to port.
Look for the finished stutter for cMUD tomorrow.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sat Dec 01, 2007 5:56 pm   My Final Version - As Promised
 
Here is the final version I've made. As far as I've found, there are no bugs anymore. Everything works even if the code isn't the cleanest possible. I've moved on to more important code, so enjoy :)

Stutter 2.7
Code:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="Allynia.mud" usesession="false">
  <uid>{B458A1E0-B33A-4A86-8F07-3316F4E2CC67}</uid>
  <packages>English Keypad|English Directions|Allynia.mud|Various|Zuran.mud</packages>
  <class name="Stutter">
    <alias name="stutter">
      <value>#VARIABLE channel {%1}
#VARIABLE input {%-2}
#VARIABLE output ""
#VARIABLE person ""
#VARIABLE emph ""
#VARIABLE loopcount 0
#VARIABLE s_word ""
#VARIABLE input %replace( @input, " ", "|")
#IF (%ismember( @channel, @sayto)) {
  #VARIABLE input %replace( @input, "|", " ")
  #VARIABLE person %word( @input, 1)
  #VARIABLE input %replace( @input, " ", "|")
  #VARIABLE input %delitem( @person, @input)
  }
#IF (%match( @input.1, ~[|~])) {
  #VARIABLE emph @input.1
  #IF (%match( @emph, "~~(")) {
    #SHOW You used the incorrect format for an emphasis
    #ABORT 1
    }
  #VARIABLE input %replace( @input, " ", "|")
  #VARIABLE input %delitem( @emph, @input)
  #VARIABLE emph %replace( @emph, "|", " ")
  #VARIABLE emph %concat( "(", @emph, ")")
  }
#FORALL @input {
  #ADD loopcount 1
  #FORALL @stutterlist {
    #IF %begins( %i, %j) {
      #IF (%random( 1, @mood)=1) {
        #IF (%i = "I" ) {#SHOW Should make this proper case.}
        #VARIABLE s_word %concat( %j, "..", %j, "..", %i)
        #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
        } //END RANDOM IF
      } // END BEGINS IF
    #IF %begins( %i, %proper( %j)) {
      #IF (%random( 1, @mood)=1) {
        #IF (%i = "I" ) {#SHOW Should make this proper case.}
        #VARIABLE s_word %concat( %proper( %j), "..", %proper( %j), "..", %i)
        #VARIABLE input %replaceitem( @s_word, @loopcount, @input)
        } //END RANDOM IF
      } // END PROPER CHECK IF
    }
  }
#VARIABLE input %replace( @input, "|", " ")
#IF (@person != "") {#VARIABLE output %concat( @output, @person, " ")}
#IF (@emph != "") {#VARIABLE output %concat( @output, @emph, " ")}
#VARIABLE output %concat(@output, @input)
#SEND {@channel @output}
mood = 3</value>
    </alias>
    <alias name="stex">
      <value>mood = 1
#EXEC stutter %-1</value>
    </alias>
    <alias name="stconf">
      <value>mood = 10
#EXEC stutter %-1</value>
    </alias>
    <alias name="stn">
      <value>mood = 3
#EXEC stutter %-1</value>
    </alias>
    <alias name="DelayStutterTime">
      <value>#VARIABLE st_relay {%1}</value>
    </alias>
    <alias name="stHelp">
      <value><![CDATA[#CLR
#SHOW {""}
#SHOW {~<color red>~<b>This Program was created to be able to stutter in a language.~</b>~</color>}
#SHOW {~<color green>~<b>I hope you find this help file helpful~</b>~</color>}
#SHOW {~<color cyan>---------------------------------------------------~</color>}
#SHOW {~<color lightgreen>Alias: DelayStutterTime~</color>}
#SHOW {~<color cyan>This alias is used to delay the time of your stutter.~</color>}
#SHOW {~<color cyan>The higher the number the less your character will stutter.~</color>}
#SHOW {~<color yellow>------------------- USAGE -------------------~</color>}
#SHOW {~<color cyan>Example:~</color>}
#SHOW {~<color cyan>DelayStutterTime 3~</color>}
#SHOW {~<color cyan>---------------------------------------------------~</color>}
#SHOW {~<color lightgreen>Alias: stutter~</color>}
#SHOW {~<color cyan>This alias is used to make your character stutter. See more information below.~</color>}
#SHOW {~<color yellow>------------------- USAGE -------------------~</color>}
#SHOW {~<color red>~<b>red~</b>~</color> ~<color white>is for the command~</color>}
#SHOW {~<color lightgreen>~<b>green~</b>~</color> ~<color white>is for the channel~</color>}
#SHOW {~<color purple>~<b>purple~</b>~</color> ~<color white>is for the channel~</color>}
#SHOW {~<color yellow>~<b>yellow~</b>~</color> ~<color white>is for the channel emphasis ~</color>}
#SHOW {~<color cyan>~<b>cyan~</b>~</color> ~<color white>is for the channel verbiage~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 1:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 1:~</color>}
#SHOW {~<color cyan>tell Dave My oh my. This i..i..is not for you. I will not do i..i..it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 2:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color yellow>~<b>(while smiling) ~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 2:~</color>}
#SHOW {~<color cyan>tell Dave (while smiling) My oh my. This is not for you. I will not do it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 3:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color yellow>~<b>(while smiling)~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 3:~</color>}
#SHOW {~<color cyan>say (while smiling) M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 4:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color yellow>~<b>~/(while smiling)~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 4:~</color>}
#SHOW {~<color cyan>You used the incorrect format for an emphasis~</color>}
#SHOW {""}
#SHOW {~<color cyan>Example 5:~</color>}
#SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>say~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}
#SHOW {~<color cyan>Output 4:~</color>}
#SHOW {~<color cyan>say M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>}
#CR]]></value>
    </alias>
    <var name="stutterlist" type="StringList">m|i|ch|th|st|g|c|l|j|t</var>
    <var name="sayto" type="StringList">tell|whisper|te</var>
    <var name="input">t..t..test t..t..test test t..t..test</var>
    <var name="inval_emph" type="StringList">/|?|,|.|=|-|#</var>
    <var name="emph" type="Literal"/>
    <var name="loopcount">3</var>
    <var name="s_word">t..t..test</var>
    <var name="ouput"/>
    <var name="mood">3</var>
  </class>
</window>
</cmud>
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Dec 06, 2007 6:22 pm   
 
Well, I have noticed the @emph part of this script doesn't work correctly. It used to work in my old version. Now it remove the () since they are special characters.
Example:

stutter say (while moving to the table) You stutter more often.

The part in parenthesis get jumbled together.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Dec 06, 2007 7:09 pm   
 
This has always been true in CMUD - any special characters you enter on the command line need to be escaped with ~ or part of an explicit string, "like so".
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Dec 06, 2007 7:12 pm   
 
Fang. I do escape the parenthesis but the words (while moving to the table) get displayed as


say whilemovingtothetable You stutter more often.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Dec 06, 2007 7:29 pm   
 
You didn't do that in your previous post, so I misunderstood. I'll take a look at the script later (give me a while, I need sleep) and see if I can track down what's causing this. That's assuming someone doesn't beat me to it, anyway.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Dec 06, 2007 7:50 pm   
 
It isn't parsing INTO the @EMPH variable at all. Something is screwy with %match I'm guessing.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Dec 06, 2007 8:11 pm   
 
I figure it out. Need to change in stutter alias:
Code:

#VARIABLE emph %concat( "(", @emph, ")")

with
Code:

#VARIABLE emph %concat( "~~(", @emph, "~~)")


And change stHelp line:
Code:

SHOW {~<color red>~<b>stutter~</b>~</color> ~<color lightgreen>~<b>tell~</b>~</color> ~<color purple>~<b>Dave~</b>~</color> ~<color yellow>~<b>(while smiling) ~</b>~</color> ~<color cyan>~<b>My oh my. This is not for you. I will not do it?~</b>~</color>}

to
Code:

SHOW {<color red><b>stutter</b></color> <color lightgreen><b>tell</b></color> <color purple><b>Dave</b></color> <color yellow><b>~~(while smiling~~) </b></color> <color cyan><b>My oh my. This is not for you. I will not do it?</b></color>}
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
DSL_Character
Beginner


Joined: 18 Aug 2010
Posts: 13

PostPosted: Wed Aug 18, 2010 1:21 am   
 
Anyone have a copy of the od finished Zmud version?
Reply with quote
DSL_Character
Beginner


Joined: 18 Aug 2010
Posts: 13

PostPosted: Wed Aug 18, 2010 1:21 am   
 
Apologies, double post.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net