|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Tue Jun 15, 2004 4:58 pm
Speaking Script |
hey all thanks for the help with all the other scripts. im working on another one that basically turns Greetings mortals, the end is near to GReETinGs MOrTals, ThE eNd iS NEaR just for an RP project.
I found the %lower function but I cant find the capitalize function. And im not really sure how to start. I reckon i would start with #trigger say %w %lower %w Cap etc etc? |
|
|
|
geniusclown Magician
Joined: 23 Apr 2003 Posts: 358 Location: USA
|
Posted: Wed Jun 16, 2004 3:37 pm |
The other function you want is %upper. Here's an alias that will do what you're asking for, randomly making each letter cap or lower:
quote:
#ALIAS Say {
output=""
#LOOP %len( %0) {output = %concat( @output, %if( %random( 1, 2)=1, %lower( %copy( %0, %i, 1)), %upper( %copy( %0, %i, 1))))}
~say @output
}
|
|
|
|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Thu Jun 17, 2004 6:13 am |
hmm it sort of works. but it seems its not flushing out what i said. Like i would type say hello world and hello world would magically appear every time i said anything and only it would get the funky caps and lowers. wonder why its doing that
|
|
|
|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Thu Jun 17, 2004 6:16 am |
I should be more specific. if i type say hello world, nothing goes through, like its recording it, then if i type say it will say HeLlo World perfectly. However if i go to record another phrase by typing say (text) the hello world is still there, and the new stuff i typed isnt getting the funky letters. any help with that?
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Jun 17, 2004 7:37 am |
Enclose your loop in a #PRIO {#loop stuff in here}
|
|
|
|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Fri Jun 18, 2004 5:36 am |
still doesnt seem to work
|
|
|
|
Zener Wanderer
Joined: 31 May 2004 Posts: 54 Location: USA
|
Posted: Fri Jun 18, 2004 7:29 am |
zMUD 7.05
I copy/pasted EXACTLY what Geniusclown has in the Quote field and it worked perfectly.
~Zener |
|
|
|
Zener Wanderer
Joined: 31 May 2004 Posts: 54 Location: USA
|
Posted: Fri Jun 18, 2004 7:43 am |
Ok, I take that back...the script like well I'll explain
say Well, you know how it is
You say wweWELWELL
say Well, I guess it works
You say wweWELWELL
I guess the script don't like puntuations. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jun 18, 2004 11:35 am |
Replace all instances of %0 with "%-1". The use of %0 is undocumented and unsupported. The quotes are added to assure that punctuation such as commas don't cause a problem. Other punctuations such as quotes would cause problems. Simply don't use them. It is an unavoidable consequence of having an interpretted language.
|
|
|
|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Fri Jun 18, 2004 5:23 pm |
perhaps im not entering it right. i dont see how you can enter it at the command line, so i just opened alias then new and pasted it in the value. then the name was say. this is correct? it works, but its like it takes what you said the first time you use it and gets put there indefinitely never clearing out for what you want to say next. like if the first thing i say is hello world then that will be entred into the alias and anything said afterwards will have hello world, then a NON upper lower thingy to it. like HelLo WOrlD crap why wont this work, HelLO WoRlD testing?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jun 18, 2004 9:44 pm |
"i dont see how you can enter it at the command line"
Drag your mouse to select everything in the quote, starting with #ALIAS and ending with }. Right-click in the selected area and choose Copy from the popup menu. Switch to the zMUD window. Make sure the command line is empty, then right-click in the middle of the command line. Choose Paste from the popup menu. Press the ENTER key.
I am unable to duplicate your current problem. I did duplicate your original problem, but the modification Vijilante suggested fixes that. Of course, %0 was used three times and must be replaced all three times.
Paste all the blue text to your command line, using the method explained above. Paste it all at once, not line-by-line. Make no changes.
#ALIAS Say {output=""
#LOOP %len( "%-1") {output = %concat( @output, %if( %random( 1, 2)=1, %lower( %copy( "%-1", %i, 1)), %upper( %copy( "%-1", %i, 1))))}
~say @output} |
|
|
|
xaosvilin Novice
Joined: 08 Jun 2004 Posts: 36
|
Posted: Sat Jun 19, 2004 9:46 pm |
works great now, should I post this in the finished script forum?
|
|
|
|
|
|