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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Wed Oct 13, 2004 1:30 am   

Colored speach
 
Just a quick one, either my brain is not working, or i have just not done anything like this. I simply want to take the first letter of anything is say and make it one color and make the rest anouther color


so if in game I said

Hello how is it goen?

i would want to make the first letter of each word and make them red, and the rest of them grey.

to make a letter red, you use {R, and to make a letter grey you use {D. also at the end of every sentance you need to use a {X to cancel the color string, so as not to bleed the color.
_________________
<Clever text here>
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Oct 13, 2004 4:23 am   
 
#AL say {#VAR saystring {~{R%-1~{X};#LOOP %len( @saystring),1 {#IF (" " = %copy( @saystring, %i, 1)) {#VAR saystring {%insert( ~{R, %insert( ~{D, @saystring, %i + 2), %i + 1)}}};'@saystring}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Wed Oct 13, 2004 8:24 pm   
 
Thanks lightbulb!
Only one thing, The first word of any sentance is all red, The rest of the words look fine. Any ideas?
_________________
<Clever text here>
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Oct 14, 2004 1:37 am   
 
#AL say {#VAR saystring {~{R%-1~{X};#LOOP %len( @saystring),1 {#IF (" " = %copy( @saystring, %i, 1)) {#VAR saystring {%insert( ~{R, %insert( ~{D, @saystring, %i + 2), %i + 1)}}};#VAR saystring %insert( ~{D, @saystring, 4);'@saystring}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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