|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Fri Jun 29, 2001 3:14 pm
Newly Improved - Stutter Script for any MUD |
This script was created for me by Iljhar. Since, this is such a great Alias, I thought it would be great in the finished scripts forum.
This alias will randomly stutter on the letters given in the alias.
Code: |
Alias: stutter
Value:
#VARIABLE whole ""
#VARIABLE rand %random( 3, %numparam( ))
#VARIABLE channel %param( 1)
#LOOP 2,%numparam( ) {
#VARIABLE temp2 %param( %i)
#VARIABLE whole %concat( @whole, %if( @rand=%i or %i=2, %if( %begins( %lower( @temp2), "th"), "th..th..", %if( %begins( %lower( @temp2), "d"), "d..d..", %if( %begins( %lower( @temp2), "a"), "a..a..", %if( %begins( %lower( @temp2), "wh"), "wh..wh..", %if( %begins( %lower( @temp2), "i"), "i..i..", %if( %begins( %lower( @temp2), "v"), "v..v..", %if( %begins( %lower( @temp2), "t"), "t..t..", %if( %begins( %lower( @temp2), "s"), "s..s..",<font color="red"> %if( %begins( %lower( @temp2), "g"), "g..g..",</font id="red"> ""))))))))<font color="red">)</font id="red">, ""), @temp2, " ")
}
#VARIABLE temp2 %proper( %left( %trim( @whole), 3))
#VARIABLE whole %right( %trim( @whole), 3)
#IF (%begins( @whole, ".")) {
#VARIABLE temp2 %concat( @temp2, %left( @whole, 1))
#VARIABLE whole %right( @whole, 1)
}
@channel %concat( @temp2, %upper( %left( @whole, 1)), %right( @whole, 1))
#NOOP
|
stutter gossip This is so cool!
You'll get something like:
gossip Th..Th..This is s..s..so cool!
To add another letter to stutter on just add to the alias as shown above in red.
Darmir
"A gentle answer turns way wrath,
but a harsh word stirs up anger"
Proverbs 15:1 |
|
Last edited by darmir on Thu Jul 22, 2004 8:23 pm; edited 2 times in total |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Wed Sep 26, 2001 8:48 pm |
NEW AND IMPROVED SCRIPT BY ILJHAR.
I asked Iljhar if he could improve the script to do the following:
- Find a way to use a string list for the letters to stutter on.
- Fix the problem when I have the first word in the sentence over 3 letters it automatically capitalizes the fourth letter.
- Find a way to be able to Capitalize the first word of each additional sentence.
Example: stutter gossip This is it. I want to run for office.
Here is the finished script:
Code: |
#VARIABLE stutterlist {v|br|th|m|b}
Alias: stutter
#VARIABLE input {%-1}
#VARIABLE found 0
#VARIABLE cap 1
#VARIABLE found 0
#VARIABLE whole ""
#VARIABLE channel %word( @input, 1)
#VARIABLE input %replace( %replace( %right( @input, %pos( " ", @input)), " ", " "), " ", "|")
#FORALL @input {
#VARIABLE temp2 %i
#IF (%random( 1, 3)=1) {#FORALL @stutterlist {#IF (!@found) {#IF (%begins( %lower( @temp2), %i)) {
#VARIABLE whole %concat( @whole, %if( @cap, %proper( %i), %i), "..", %if( @cap, %proper( %i), %i), "..")
#VARIABLE found 1
}}}}
#VARIABLE whole %concat( @whole, %if( @cap, %proper( @temp2), @temp2), " ")
#VARIABLE found 0
#VARIABLE cap 0
#IF (%ends( @temp2, ".")) {
#VARIABLE cap 1}
}
#VARIABLE temp2 %proper( %left( %trim( @whole), 3))
#VARIABLE whole %right( %trim( @whole), 3)
#IF (%begins( @whole, ".")) {
#VARIABLE temp2 %concat( @temp2, %left( @whole, 1))
#VARIABLE whole %right( @whole, 1)
}
@channel %concat( @temp2, %if( %pos( ".", @temp2), %concat( %upper( %left( @whole, 1)), %right( @whole, 1)), @whole))
|
An important thing to remember, if you have more than 1 letter to stutter on, like "br" and you also want to stutter on words that start with "b", you MUST put the 2+ letter combinations ahead of the 1 letter in the stutterlist variable.
Darmir
"A gentle answer turns way wrath,
but a harsh word stirs up anger"
Proverbs 15:1 |
|
Last edited by darmir on Thu Jul 22, 2004 8:28 pm; edited 2 times in total |
|
|
|
Alrik Newbie
Joined: 18 Nov 2001 Posts: 2 Location: Italy
|
Posted: Sat Nov 24, 2001 11:19 am |
I have modified the scritp to make it usefull also with non-public channel that uses a target. I.e. Say to, Send, Trasmit.
In RED the modification
#VARIABLE stutterlist {t|m|n|l|b|c|s|d}
#VARIABLE input {%-1}
#VARIABLE found 0
#VARIABLE cap 1
#VARIABLE whole ""
#VARIABLE channel %word( @input, 1)
#VARIABLE sayto %word( @input, 2)
#VARIABLE target %word( @input, 3)
#VARIABLE input %replace( %right( @input, %pos( " ", @input)), " ", " ")
#IF (%upper(@sayto)="TO") {
#VARIABLE input %replace( %right( @input, %pos( " ", @input)), " ", " ")
#VARIABLE input %replace( %right( @input, %pos( " ", @input)), " ", " ")
#VARIABLE channel %concat( @channel, " ", @sayto, " ", @target, " ")
} {#IF (%upper( @sayto)="MESS" or %upper( @sayto)="SEND" or %upper( @sayto)="MESSAGE") {
#VARIABLE input %replace( %right( @input, %pos( " ", @input)), " ", " ")
#VARIABLE channel %concat( @channel, " ", @sayto, " ")
} {#NOOP}
}
#VARIABLE input %replace( @input, " ", "|")
#FORALL @input {
#VARIABLE temp2 %i
#IF (%random( 1, 2)=1) {#FORALL @stutterlist {#IF (!@found) {#IF (%begins( %lower( @temp2), %i)) {
#VARIABLE whole %concat( @whole, %if( @cap, %proper( %i), %i), "..", %if( @cap, %proper( %i), %i), "..")
#VARIABLE found 1
}}}}
#VARIABLE whole %concat( @whole, %if( @cap, %proper( @temp2), @temp2), " ")
#VARIABLE found 0
#VARIABLE cap 0
#IF (%ends( @temp2, ".")) {#VARIABLE cap 1}
}
#VARIABLE temp2 %proper( %left( %trim( @whole), 3))
#VARIABLE whole %right( %trim( @whole), 3)
#IF (%begins( @whole, ".")) {
#VARIABLE temp2 %concat( @temp2, %left( @whole, 1))
#VARIABLE whole %right( @whole, 1)
}
@channel %concat( @temp2, %if( %pos( ".", @temp2), %concat( %upper( %left( @whole, 1)), %right( @whole, 1)), @whole))
Alrik |
|
|
|
Vaulcul Newbie
Joined: 10 Jul 2002 Posts: 5
|
Posted: Mon Jul 15, 2002 12:20 am |
How do you keep it from stuttering the persons name while your messaging them...
so things don't look like this: tell S..S..Seid s..s..stop stuttering so much
They aren't here. |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Mon Jul 22, 2002 8:07 pm |
Then don't use the stutter alias when you want to use the tell command!
Darmir
"A gentle answer turns way wrath,
but a harsh word stirs up anger"
Proverbs 15:1 |
|
|
|
russtops Newbie
Joined: 04 Mar 2003 Posts: 2 Location: USA
|
Posted: Tue Mar 04, 2003 4:07 pm |
I am not a good scripter at all... So I need to ask for some help here.
I'm looking to to make an olde English-speak script...
I want it to change every command I send out that begins with say, ', tell, gnt, and ct to do this:
Change HAD/HAVE/HAS to HATH
Change ARE to ART
Change YOU'RE to THOU ART
Change YOURS to THINE
Change YOUR to THY
Change YOU to THEE
the next best thing to a stutter script. :-)
conjure illusion The Pixie Queen sticks her tongue out and blows a raspberry at you. |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Tue Mar 04, 2003 4:34 pm |
This is only for completed scripts! Ask this question on the general forum.
Darmir
"A gentle answer turns way wrath,
but a harsh word stirs up anger"
Proverbs 15:1 |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Thu Jun 17, 2004 8:56 pm |
New version of Stutter Script
I have re-written this script from scratch to make better use of the latest version of zMud.
Capabilites:
- Can distinguish between channels with a target.
- Can also use emphasis of channels - Designed specifically for Shadows of Isildur Mud.
Script will stop if emphasis not formatted correctly.
- Can distinguish between Proper words and non-proper words for stuttering.
---------------------------------------------------
Example 1:
stutter tell Dave My oh my. This is not for you. I will not do it?
Output 1:
tell Dave My oh my. This i..i..is not for you. I will not do i..i..it?
---------------------------------------------------
Example 2:
stutter tell Dave (while smiling) My oh my. This is not for you. I will not do it?
Output 2:
tell Dave (while smiling) My oh my. This is not for you. I will not do it?
---------------------------------------------------
Example 3:
stutter say (while smiling) My oh my. This is not for you. I will not do it?
Output 3:
say (while smiling) M..M..My oh my. Th..Th..This is not for you. I will not do it?
---------------------------------------------------
stutter say /(while smiling) My oh my. This is not for you. I will not do it?
Output 5:
You used the incorrect format for an emphasis
---------------------------------------------------
Example 5:
stutter say My oh my. This is not for you. I will not do it?
Output 5:
say M..M..My oh my. Th..Th..This is not for you. I will not do it?
---------------------------------------------------
Here is the finished script
Code: |
#CLASS {stutter}
#ALIAS stutter {
#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
}
#ALIAS DelayStutterTime {
;This alias is used to change the stutter delay
; The higher the variable the less your character will stutter
#VARIABLE st_relay {%1}
}
#ALIAS stHelp {
#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
}
#VARIABLE stutterlist {m|i|th|st|g|c|l|j}
#VARIABLE channel {}
#VARIABLE sayto {tell|whisper}
#VARIABLE input {}
#VARIABLE emph {}
#VARIABLE inval_emp {/|?|,|.|=|-|~#}
#VARIABLE loopcount {}
#VARIABLE s_word {}
#CLASS 0
|
|
|
Last edited by darmir on Wed Nov 17, 2004 7:39 pm; edited 7 times in total |
|
|
|
Night Walker Newbie
Joined: 09 Jul 2004 Posts: 1 Location: Sweden
|
Posted: Fri Jul 09, 2004 6:27 pm |
Iam on new om the mud thing so i was wondering what "stutter" is... Can anyone help m understand?
|
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Fri Jul 09, 2004 6:29 pm |
Night Walker,
The stutter script is so you can roleplay a person that has a stutter problem with his/her speech. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Nov 29, 2007 12:15 am |
I've added a little adjustment to this to allow for different moods.
If you're confident you will stutter less. If you are excited (stressed)
you will stutter a lot (my code makes it always). I've also added
to the stutterlist a few things. It isn't as pretty to look at as the above
post, but I'm not going to take the time to edit it ;)
Code: |
#CLASS {Stutter}
#ALIAS stutter {#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}
#ALIAS stex {mood = 1;stutter %-1}
#ALIAS st {mood = 3;stutter %-1}
#ALIAS stconf {mood = 10;stutter %-1}
#ALIAS DelayStutterTime {#VARIABLE st_relay {%1}}
#ALIAS stHelp {#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}
#VAR stutterlist {m|i|ch|th|st|g|c|l|j|t}
#VAR sayto {tell|whisper|te}
#VAR input {I am confident stutter}
#VAR emph {}
#VAR inval_emp {/|?|,|.|=|-|#}
#VAR loopcount {5}
#VAR s_word {}
#VAR output {I am confident stutterI am confident stutterI am confident stutterI am confident stutterI am confident stutterI am confident stutter}
#VAR mood {3}
#CLASS 0
|
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Thu Nov 29, 2007 12:23 am |
Nice adjustment to my script.. I was thinking of converting this for cMUD. So I will do it in next week so so and put it into the package library.
|
|
_________________ 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) |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Nov 29, 2007 4:51 pm |
Oops, darmir has kindly pointed out that I forgot to add the new examples for my adjustments.
To stutter when "excited" use stex <channel> <message>
To stutter when "confident" use stconf <channel> <message>
To stutter "normal" use st | stutter <channel> <message>
Other than that, my only changes were to add some stuff to the stutterlist and replace the final outputting code with a cleaner version that avoids extraneous spaces (that didn't matter on my MUD but look bad) |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
DSL_Character Beginner
Joined: 18 Aug 2010 Posts: 13
|
Posted: Wed Aug 18, 2010 2:08 am |
Seems to be an EMPH malfunction with the sayto "say". Doesn't seem to have this issue with any of the other sayto's I added. Also, any way to avoid being forced to use 2+ words in the emph, allowing you to use single-word emph's also? I worked around it by adding spaces around the single-word, aka, ( emph ). Perhaps anyone can assist?
IMPUT:
st say (while smiling) boom batter better butt bale box boch break
OUTPUT:
You say '(while (while smiling) boom batter b..b..better butt b..b..bale b..b..box boch b..b..break' |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Wed Aug 18, 2010 5:43 am |
Did you modify the code?
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
DSL_Character Beginner
Joined: 18 Aug 2010 Posts: 13
|
Posted: Wed Aug 18, 2010 7:35 am |
It's an exact duplicate of the one above.
zMud version 7.21.
I added additional sayto's, that's all I changed, I will report the change for you to see:
#VAR sayto {tell|whisper|reply|>|gossip|cgossip|clan|gtell|say|yell|shout}
They all work except the "say" command. |
|
|
|
DSL_Character Beginner
Joined: 18 Aug 2010 Posts: 13
|
Posted: Wed Aug 18, 2010 7:49 am |
Code: |
#CLASS {Stutter Script}
#ALIAS stutter {#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}
#ALIAS stex {mood = 1;stutter %-1}
#ALIAS st {mood = 3;stutter %-1}
#ALIAS stconf {mood = 10;stutter %-1}
#ALIAS DelayStutterTime {#VARIABLE st_relay {%1}}
#VAR stutterlist {m|i|ch|th|st|g|c|l|j|t|w|b}
#VAR sayto {tell|whisper|reply|>|gossip|cgossip|clan|gtell|say|yell|shout}
#VAR input {Rochford is great!}
#VAR emph {}
#VAR inval_emp {/|?|,|.|=|-|#}
#VAR loopcount {4}
#VAR s_word {}
#VAR output {Rochford is great!}
#VAR mood {3}
#VAR channel {tell}
#VAR person {Rochford}
#VAR st_relay {2}
#CLASS 0 |
I edited out the helpfile for simplcity sake. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Wed Aug 18, 2010 5:27 pm |
Ok, I'll look at this when I get home. It shouldn't do that.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
DSL_Character Beginner
Joined: 18 Aug 2010 Posts: 13
|
Posted: Wed Aug 18, 2010 7:53 pm |
Thanks!
Also, another item of note: the emph only acknowledges 2+ word emph's, and not single-word emphs. A way to get around this is to add [spaces] around the single word, because if you don't, it enables the emph to act like a normal word, thus a chance of stuttering if the letter is in your stutterlist.
Examples of valid inputs:
st [channel] [name] (while smiling) [message]
st [channel] [name] ( angrily ) [message]
Adding the [spaces] around "angrily" allows the stutter exemption to stay in place as if the emph were 2+ words long. Any chance we can get the single-word emph fixed so the need for [spaces] are eliminated?
Thanks again! >:-D |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Aug 20, 2010 8:57 pm |
Ok, I think I see your problem. You're putting all channels into sayto. sayto is only used with things like tell, where it expects an argument of
st channel name msg.
gossip, say, etc... don't have that. They're just:
st channel msg.
And so they don't need to be in the sayto list.
As for the 1 word emphasis, yes I can and have fixed that (by replacing that portion of the code with regex instead)
Code: |
#CLASS {Stutter}
#ALIAS stutter {
#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)
};
#VARIABLE input %replace( @input, "|", " ");
#NOOP %regex( @input, "^(\(.+\)) (.+)", emph, input);
#VARIABLE input %replace( @input, " ", "|")
#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
}
#ALIAS stex {mood = 1;stutter %-1}
#ALIAS st {mood = 3;stutter %-1}
#ALIAS stconf {mood = 10;stutter %-1}
#ALIAS DelayStutterTime {#VARIABLE st_relay {%1}}
#ALIAS stHelp {
#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: (This example should now be invalid)~</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 5:~</color>;
#SHOW ~<color cyan>say M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>;
#CR
}
#VAR stutterlist {m|i|ch|th|st|g|c|l|j|t}
#VAR sayto {tell|whisper|te}
#VAR input {I am an excited stutterer}
#VAR emph {(while smiling)}
#VAR inval_emp {/|?|,|.|=|-|#}
#VAR loopcount {5}
#VAR s_word {}
#VAR output {(while smiling) I am an excited stutterer}
#VAR mood {3}
#CLASS 0
|
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Sun Aug 22, 2010 4:06 pm |
I've been informed that my code post above doesn't work because I forgot to remove all the semi-colons from the line ends when I prettied it up for display. Here's the original code. If this gives you syntax errors I don't know why, I don't have any on my end. Actually, when viewing it in the CLASS folder view of all the code in the class, I show a syntax error that isn't really. So ignore that one.
Code: |
#CLASS {Stutter}
#ALIAS stutter {#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)};#VARIABLE input %replace( @input, "|", " ");#NOOP %regex( @input, "^(\(.+\)) (.+)", emph, input);#VARIABLE input %replace( @input, " ", "|");#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}
#ALIAS stex {mood = 1;stutter %-1}
#ALIAS st {mood = 3;stutter %-1}
#ALIAS stconf {mood = 10;stutter %-1}
#ALIAS DelayStutterTime {#VARIABLE st_relay {%1}}
#ALIAS stHelp {#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: (This example should now be invalid)~</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 5:~</color>;#SHOW ~<color cyan>say M..M..My oh my. Th..Th..This is not for you. I will not do it?~</color>;#CR}
#VAR stutterlist {m|i|ch|th|st|g|c|l|j|t}
#VAR sayto {tell|whisper|te}
#VAR input {I..I..I am an excited st..st..stutterer}
#VAR emph {(excited stutter)}
#VAR inval_emp {/|?|,|.|=|-|#}
#VAR loopcount {5}
#VAR s_word {st..st..stutterer}
#VAR output {(excited stutter) I..I..I am an excited st..st..stutterer}
#VAR mood {3}
#CLASS 0
|
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
DSL_Character Beginner
Joined: 18 Aug 2010 Posts: 13
|
Posted: Sun Aug 22, 2010 6:23 pm |
Perfect.
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Mon Aug 23, 2010 5:38 am |
If you have any more problems, just let me know.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
|
|
|
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
|
|