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


Joined: 04 Apr 2009
Posts: 4

PostPosted: Wed Apr 08, 2009 5:04 am   

#CW Question
 
I would like to create an alias that colors whatever keywords I specify. Right now, I'm starting with:

#alias {mark} {#CW %params orange}

Every time I "mark" a word, a separate trigger gets created. Is there a way to specify the destination of the trigger that gets created, so that if I've marked 20-30 words, I can go back and simply #DELCLASS {marked} and delete all the markers I've made? As opposed to opening up the package editor and deleting each #CW trigger one by one?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Apr 08, 2009 5:15 am   
 
#CW is just like an alias shortcut to #TRIGGER, which is the only reason using %selected get evaluated... I cant think of a way to do this via strait trigger creation...

But might i suggest running it off a variable instead?

#ALIAS mark {#ADDITEM orange %selected}
#TR {{@orange}} {#CW orange}
_________________
Discord: Shalimarwildcat
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Wed Apr 08, 2009 5:58 am   
 
hmm

Code:
#class Collective
#var tm_catchall %replace(%params," ","|")
#forall @tm_catchall {#cw %i Red}
#unvar tm_catchall
#class 0


Would make color word red for it's parameters in a folder named Collective. You could name the alias Mark. if you accidently double space params funky chickens might appear on the full moon

Code:
%replace(%params, "  ", "|")


too?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Apr 08, 2009 6:09 am   
 
ah yes... #CLASS would work around it, good call.
_________________
Discord: Shalimarwildcat
Reply with quote
Swyft
Newbie


Joined: 04 Apr 2009
Posts: 4

PostPosted: Wed Apr 08, 2009 6:29 am   
 
Ty for the help, but honestly I have no idea what is going on -

I tried shalimar's solution and it wouldn't even color anything.

Ex: I want to color the word test, so i do mark test
Instead of getting it colored, I have a variable named orange with entries mark and test


I tried Leitia's code and still can't figure out what is supposed to happen =(

If you don't mind, please explain what I'm supposed to do with it
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Apr 08, 2009 7:43 am   
 
#ALIAS mark {#ADDITEM orange %params}
//old version used %selected instead of %params, my bad
#TR {{@orange}} {#CW orange}


unless you use my trigger as well (which colors every instance of the words contained in the variable), that's all it was supposed to do, populate the variable for the trigger to use.
_________________
Discord: Shalimarwildcat
Reply with quote
Swyft
Newbie


Joined: 04 Apr 2009
Posts: 4

PostPosted: Wed Apr 08, 2009 8:26 am   
 
Ah thank you so much, this is a great alternative solution!
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Wed Apr 08, 2009 1:05 pm   
 
I wrote "an alias that colors whatever keywords I specify" I am curious what it was you did try because you should have "whatever keyword" in a folder named Collective that you "can go back and simply #DELCLASS" I did not name the folder Marked, not thinking (it was late) that was a folder name.

MARK test1 test2 test3

makes the words test1, test2, and test3 red, that is when you have those words displayed
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