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
Godsent_2001
Newbie


Joined: 25 Sep 2001
Posts: 5
Location: USA

PostPosted: Tue Sep 25, 2001 5:27 pm   

Random Color Alias
 
I have an alias that changes they way i speak on my mud:
emote c06says, c00'c11%-1c00'

I was wondering if anyone could tell me how i could get everyother word a different color, or even better everyone letter a different color. A post or an email with the code would be most appreciated.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Sep 26, 2001 7:45 pm   
 
Iljhar had a similar post somewhere earlier on this which I couldn't find quick.

The idea is you would want to make an alias, capture the text, then colorize
the text as you wanted.

I notice your format for colour is c## so we can create a variable to store
all the colours numbers you want to use:

VARIABLE: ColorCodes
Default Value:
Value: 01|02|03|04|05|06|07|08|09|11

I'll use an alias to colorize your text.
syntax: semote Congratulations Guru, Iljhar

ALIAS: semote
SCRIPT:


#VAR semoteTemp "%-1"
#VAR semoteTemp2 "c06says, c00~'"
#LOOP %len(@semoteTemp) {
#NOOP The next 3 lines are really 1 line in your settings editor
#VAR semoteTemp2 %concat(@semoteTemp2,"c",
%item(@ColorCodes,%random(%numitems(@ColorCodes))),
%copy(@semoteTemp,%i,1))
}
#VAR semoteTemp2 %concat(@semoteTemp2,"c00~'")
emote @semoteTemp2


TonDiening
Uses 6.16

Modified 6:02 pm in orange
Reply with quote
Godsent_2001
Newbie


Joined: 25 Sep 2001
Posts: 5
Location: USA

PostPosted: Wed Sep 26, 2001 10:57 pm   
 
Thanks this works great. Although unless i did something wrong, it will only work for one word. It looks cool though. I like it changing my words to be different, but if i could get more then one it'd be great. Please tell me if i did something wrong.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Sep 27, 2001 12:04 am   
 
My bad,

#VAR semoteTemp "%-1"

That will capture all words.

TonDiening
Uses 6.16
Reply with quote
Godsent_2001
Newbie


Joined: 25 Sep 2001
Posts: 5
Location: USA

PostPosted: Thu Sep 27, 2001 12:51 am   
 
Thanks a bounch, it works great!
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Tue Oct 02, 2001 5:23 am   
 
i am so unfortunate as to not have version 6.16, and i have tried this on the version i currently use, 4.62. would you happen to know how i could get this color thingy to work?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Oct 02, 2001 8:22 pm   
 
Ugrade :)

You can make a very tedious loop that checks for preceeding spaces
then checks the next character to be in [a..z].

You would then take that ascii value of it and subtract it by 32
and stuff it into the string. // ascii(a) = 97 ascii(A) = 65

Tedious. Upgrade it is worth the expense!

TonDiening
Uses 6.16
Reply with quote
Pappsi
Newbie


Joined: 16 Oct 2001
Posts: 3
Location: Sweden

PostPosted: Tue Oct 16, 2001 4:14 pm   
 
Hello, I think you made a great color script there,
but It doesn't work for me...:(

On the MUD I use we have the color sheme - #r(dark red) #R(red)
we have #R #C #B #M #Y #W #Y (Including the small letters after every #)

I use the commands say, chat, gos, auc, ct, gt
It would be really appreciate if someone could remake the script so it
suites the above.

Pappsi
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Oct 17, 2001 2:33 am   
 
quote:

On the MUD I use we have the color sheme - #r(dark red) #R(red)
we have #R #C #B #M #Y #W #Y (Including the small letters after every #)

I use the commands say, chat, gos, auc, ct, gt



VARIABLE: ColorCodes
Default Value:
Value: r|R|c|C|b|B|m|M|y|Y|w|W

I'll use an alias to colorize your text.
syntax: colorize <channel> <message>
syntax: colorize auc I have a tarn helm for sale dirt cheap

ALIAS: colorize
SCRIPT:


#VAR ColorizeTemp "%-1"
#NOOP Strip the first word out for the channel to use
#VAR Channel %word(@ColorizeTemp,1)
#NOOP Grab words 2+ for the message
#VAR ColorizeTemp %copy(@ColorizeTemp,%pos(" "),%len(@ColorizeTemp))
#VAR ColorizeTemp2 ""
#LOOP %len(@ColorizeTemp) {
#NOOP The next 3 lines are really 1 line in your settings editor
#VAR ColorizeTemp2 %concat(@ColorizeTemp2,"#",
%item(@ColorCodes,%random(%numitems(@ColorCodes))),
%copy(@ColorizeTemp,%i,1))
}
@Channel @ColorizeTemp2



Unfortunately not tested

TonDiening
Uses 6.16
Reply with quote
Pappsi
Newbie


Joined: 16 Oct 2001
Posts: 3
Location: Sweden

PostPosted: Wed Oct 17, 2001 3:39 pm   
 
Thanks alot for the script and help...
But i still can't get it to work :(.
I create an alias named colorize, then I paste your script into it.
When I try to write e g "colorize say Hello!" nothing happens...
I would like to have it like #gH#Me#yl#wl#Co -> Hello (random colors)
And my MUD cant change the channel's color (say, gt, ct etc)
just the text after the channel command.

And the script creates like 20 folders in the settings box.

I would be really glad if you could make the script again, im a newbie in this...




Pappsi
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Oct 23, 2001 5:22 pm   
 
I fear you didn't put that #VAR command on 1 line. Check your alias
for the #VAR statement in the loop.

say #Ws#ya#yy#c #Bt#e#s#mt#m #Ct#e#Rs#Yt#W #mt#e#cs#Bt

Is what I get when I test.
ALIAS: semote
SCRIPT:


#VARIABLE ColorizeTemp "%-1"
#NOOP Strip the first word out for the channel to use
#VARIABLE Channel %word( @ColorizeTemp, 1)
#NOOP Grab words 2+ for the message
#VARIABLE ColorizeTemp %copy( @ColorizeTemp, %pos( " "), %len( @ColorizeTemp))
#VARIABLE ColorizeTemp2 ""
#LOOP %len( @ColorizeTemp) {
#NOOP The next 3 lines are really 1 line in your settings editor
#VARIABLE ColorizeTemp2 %concat( @ColorizeTemp2, "#", %item( @ColorCodes, %random( %numitems( @ColorCodes))), %copy( @ColorizeTemp, %i, 1))
}
@Channel @ColorizeTemp2


TonDiening
Uses 6.16
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Mon Nov 05, 2001 4:19 am   
 
ok i got 6.16 but no it kinda messing up, at times it wont put the number after the /c, is that because there is that blank at the end of the list of variables? just wondering
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Nov 06, 2001 3:44 am   
 
Most likely. Check the variable that has the:
Value: 01|02|03|04|05|06|07|08|09|11

Make sure it doest have a nothing entry at the start, middle or end:
Value: |01|02|03|04|05|06||07|08|09|11|

Looks like northing ("") is being chosen.

TonDiening
Uses 6.16
Reply with quote
Pappsi
Newbie


Joined: 16 Oct 2001
Posts: 3
Location: Sweden

PostPosted: Tue Nov 06, 2001 11:21 am   
 
Thanks alot for the help ToneDiening :)

Pappsi
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Nov 07, 2001 7:58 am   
 
01|02|03|04|05|06|07|08|09|11|12|13|14|29|00

is what i have and am using, and it still messes up it will go Apollyon says, 'test test tecst' or some variation of that, should i click on the box that says, Use Default Value? my friend says it wiroks with the new beta, although i am not ready to work with the beta until i get a better grasp witht he coding differences between 4.62 and 6.16...
Reply with quote
einar
Wanderer


Joined: 06 Nov 2000
Posts: 80
Location: USA

PostPosted: Wed Nov 07, 2001 9:08 am   
 
coding differences? as in you need to be sure that all of your current scripts will still work after you upgrade? most scripts should, and if they don't im sure everyone here would be able to clean them up and make em work.

btw, 6.16 isn't a beta (6.22 is the current beta) at least to my knowledge

Master, seventh circle of idling
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Nov 08, 2001 1:32 am   
 
As long as the variable's value has :

01|02|03|04|05|06|07|08|09|11|12|13|14|29|00

You should be fine. If you are using a default value with the above then click on the user default value and reset the value so it shows the above.

TonDiening
Uses 6.16
Reply with quote
sponge-bob
Beginner


Joined: 10 Nov 2001
Posts: 18

PostPosted: Sat Nov 10, 2001 3:36 am   
 
is there a way to modify this code so when you type something like

ct hello zmud

it would send

ct |rh|Re|rl|Rl|ro |Rz|rm|Ru|rd
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sat Nov 10, 2001 6:02 am   
 
what about when the colour codes are &blood& &pea& &ash& etc. is there any hope for us? :)

Why oh WHY did I have pass door on...
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Sun Nov 11, 2001 8:13 am   
 
Ok things seem to work now, but i am having another problem, which i didnt have with 4.62, everytime i leave and close z mud all my values i stored for the variables disappear, such as the

01|02|03|04|05|06|07|08|09|11|12|13|14|29|00

value i have for the colors, i save in the variable list i go to all other save places i can find in zmud, is there something else i have to do, i thought save would work, appearantly not
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Nov 12, 2001 5:03 am   
 
Did you do as TonDiening suggested and throw the string list in the default part of the variable? If so, are you saying that it's just not saving there?

Iljhar
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Nov 13, 2001 3:40 am   
 
Apollyon:
As iljhar pointed out I think your problem would be having the default value faulty, and
having the default value box checked so everytime you load zMud you get a bad value from
the default value. If you only fix the value of the variable then you are fine for that
session but once you restart zMud you are buggy again.


sponge-bob:

To modify the code which iljhar once made for someone and for an output/use of
"ct |rh|Re|rl|Rl|ro |Rz|rm|Ru|rd":

You'll have to add your other colors to the value as you only refer to 2 in your example:

VARIABLE: ColorCodes
Default Value:
Value: r|R

I'll use an alias to colorize your text and as you have selected no channel I'll default
with say.

syntax: ct <message>
syntax: ct I have a tarn helm for sale dirt cheap

ALIAS: ct
SCRIPT:


#VAR ColorizeTemp "%-1"
#NOOP Strip the first word out for the channel to use
#VAR Channel %word(@ColorizeTemp,1)
#NOOP Grab words 2+ for the message
#VAR ColorizeTemp %copy(@ColorizeTemp,%pos(" "),%len(@ColorizeTemp))
#VAR ColorizeTemp2 ""
#LOOP %len(@ColorizeTemp) {
#VAR ColorizeTemp2 %concat(@ColorizeTemp2,"
|",%item(@ColorCodes,%random(%numitems(@ColorCodes))),%copy(@ColorizeTemp,%i,1)) }
say @ColorizeTemp2


TonDiening
Uses 6.16
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