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


Joined: 15 Jan 2002
Posts: 5

PostPosted: Wed Jan 16, 2002 5:13 pm   

An intresting trigger / sub question ...
 
Hiya folks.

I play mume and my probelm is as follows,
there is limited PK and the enemy you are supposed to kill is shown like this :
*an orc* or *a elf* etc ...
what I would like to do is change output of their movements like instead of :
*an orc* leaves west you would get :
*an orc* leaves <<<WEST<<<
a simple #sub wont do since it would change all leaves west (etc) to the same format and I want to be able to see what line is for enemy and what not.
I managed to make a trigger that would activate it (~*(*)~* leaves (*)) but not sure what to do next, I dont want to #sub all names starting with stars, since I would have about 200 of subs after that ...

So any bright ideas how to do this properly ?

Thx in advance
Reply with quote
bruntilda
Novice


Joined: 10 Oct 2000
Posts: 39

PostPosted: Wed Jan 16, 2002 5:31 pm   
 
what about:

Pattern: ~*(*)~* leaves (%w)
Trigger: #SUB {*%1* leaves <<<%upper(%2)<<<}
Reply with quote
bendrago
Newbie


Joined: 15 Jan 2002
Posts: 5

PostPosted: Wed Jan 16, 2002 5:43 pm   
 
That still leaves me with the #sub's ...
then I have like 1000 #sub *blah* leaves east #sub *blah2* leaves ..... :)

I can sub, but dont want to, unless there is a way to make #sub work just at conjunction with it's trigger or delete it utomaticly just after it has ran once.
Reply with quote
bruntilda
Novice


Joined: 10 Oct 2000
Posts: 39

PostPosted: Wed Jan 16, 2002 6:11 pm   
 
I guess I'm not sure what you mean. Only enemy names are surrounded by *'s, right? You won't need any other triggers, as this isn't specific to a single enemy.

Or maybe you refer to the way #SUB sometimes creates new #SUB triggers when you use it as:
#SUB {Original Text} {Substituted Text}

But the trigger I gave you wouldn't have this problem, since it has only one argument. Of course it might remove any special coloring of the line. If you are really worried about that you can replace the 'Trigger' portion of my last post with
#TEMP {%2} {#SUB {<<<%upper(%2)<<<}}
Reply with quote
bendrago
Newbie


Joined: 15 Jan 2002
Posts: 5

PostPosted: Wed Jan 16, 2002 6:40 pm   
 
Yeah sorry I dont make myself clear :)

a typical output of my mud on enemies :

*a orc* leaves west ... or ...
*a dreadful orc* leaves west ... or ...
*Hatcher the orc* leaves west ...
and then if the enemy is riding you get something like :
*a orc* leaves west riding a warg

what I want it to look like would be like this :

*a orc* LEAVES <<<WEST<<< ... or ...
*a orc* LEAVES >>>EAST>>> ... or ...
*a orc* LEAVES vvvSOUTHvvv riding a warg

so the trigger would have to substitute eg. east with >>>EAST>>> and west <<<WEST<<<

the problem I had with #sub is that it stores itself in zmud and after a while I would have like 100 #sub's around :)

Atm I trigger it for each direction separately like this :

Pattern: ~*(*)~* leaves east(*)
Trigger: #ga
#sa ~*%1~* LEAVES >>>EAST>>> %2

but is there a way to do this with just one trigger instead of the 6 I use atm ?

And also is it possible to change the #sa color just for one line ?

Thx
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Jan 17, 2002 12:05 am   
 
Bruntilda is right SUB with 1 argument will not create a trigger. It is KEY that the argument be encased with {} as Bruntilda wrote it. The bonus nuggets are another matter...

#FU DirLetter {%if("%1"="north","^",%if("%1"="south","v",%if("%1"="west","<",%if("%1"="east",">","?"))))}
#TR {~*(*)~* leaves (*)$} {
#SUB {%ansi(RED)*%1* leaves %repeat(@DirLetter(%word("%2",1)),4)%upper(%word("%2",1))@DirLetter(%word("%2",1)),4)%remove(%word("%2",1),"%2"}
}

Obviously you would have to add the charaacter you want for nw,ne,se,sw,u,d. Also you could eliminate all the uses of %word by only capturing 1 word in the trigger; this however allows you to color it as you see fit with %ansi. If you still dont trust #SUB feel free to use #GAG and #ECHO. I suggest echo over say because echo by default doesn't activate triggers, say does.
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