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
Kaputchnik
Beginner


Joined: 06 Jan 2002
Posts: 28
Location: Sweden

PostPosted: Sun Jan 06, 2002 3:40 am   

Text trigger and #sub
 
This is my problem I want to create a trigger that adds a percentage number after I see a npc/pc condition, since there are several conditions for different levels of full health.

The output is:
He is in excellent condition.

I want the trigger to add a 100% after excellent condition, but the trigger I've created doesn't seem to work properly.

This is what I got:
trigger :{He|She|It} is (%w*)
command:
#if {"%1"=~"in excellent condition."} {#sub {"%1"} {{"%1"} "100%"}}

If I get this one correct I can surely finish the others by myself.

Regards,
Kaputchnik
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sun Jan 06, 2002 4:43 am   
 
#SUBSTITUTE can be a real pain in the butt.

This is a version I got working:

Pattern: ({He|She|It}) is (*)

Notice that it captures the pronoun as well as the object phrase.

Action: #IF ("%2" = "in excellent condition.") {#SUB {%1 is in excellent condition. 100%}}



Troubadour
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