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


Joined: 30 May 2002
Posts: 17
Location: Denmark

PostPosted: Sun Jul 07, 2002 6:03 pm   

Trigger
 
Hi

I want to make a trigger that’s capture the output when I cast
a spell, the spell can have 2 variants:
cast 'fly' logic
cast 'word of recall'

Some of the spell have a target and some don’t.

Here is what I have try to do, but it wont work :(

#TR ^cast '(%w)' (%w)
#UNV target
#VAR spell %1
#VAR target %2

Logic
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Sun Jul 07, 2002 6:26 pm   
 
%w will only capture 1 word. You'll probably want to have 2 triggers, 1 with targets and 1 without.

#trigger {cast '(*)'$} {#var spell %1;#var target ""}

#trigger {cast '(*)' (%w)$} {#var spell %1;#var target %2}


You could just do it in 1 trigger, but this is easy too.

Iljhar
Reply with quote
Logic
Beginner


Joined: 30 May 2002
Posts: 17
Location: Denmark

PostPosted: Sun Jul 07, 2002 7:06 pm   
 
Hi agian

Thanks for the fast reply :)

But non of the trigger will capture all the words in the spell like cast 'word of recall'
only the first word is capture.

Else they work fine, but..


Logic
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 07, 2002 8:08 pm   
 
If you want to include more than one word in a variable-value, you need to enclose it in braces {} or other delimiters. Otherwise, the spaces are interpreted as delimiters so the first word becomes the value, the second becomes the default value, the third becomes the class, and anything after that is ignored.
#trigger {cast '(*)'$} {#var spell {%1};#var target ""}
#trigger {cast '(*)' (%w)$} {#var spell {%1};#var target %2}

LightBulb
Senior Member
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