Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Fri Dec 01, 2006 3:12 pm   

[1.17] trigger help
 
Hey all, playing about with trying to get a few of my more complex scripts working in cmud and ive come up against a problem, not a bug, more to do with my lack of brain power.

Currently, I have a trigger, that grabs the name of a quest mob out of a mudside announcement line (the name is always different), I then take this and make a trigger to turn that name yellow, thus being easier to spot when i perform a scan function.

currently this is the pattern and script:


Code:
The %1 quests 'If you think you know where %1 is, you might be able to find me!'

#TRIGGER "see_qmob" {%1} {#col yellow}


now, when triggered in cmud, it purely makes a trigger using the %1 as the litteral pattern, not the contents as I mean it to.

Im hoping theres an easy answer to this, but it escapes me.

Much thankies for your help.

Crycry Smile
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Fri Dec 01, 2006 3:15 pm   
 
Shouldn't be using %1 in pattern matches, you should use %w, %d, * etc.

Change the match to something like
The * quests 'If you think you know where (*) is, you might be able to find me!'
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Fri Dec 01, 2006 3:28 pm   
 
hmms.. thanks Guinn changed as suggested, the trigger still creates with the patern %1, rather than the intended contents of %1.

Code:
The (*) quests 'If you think you know where (*) is, you might be able to find me!'

#TRIGGER "see_qmob" {%1} {#col yellow}
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Dec 01, 2006 4:52 pm   
 
Oh I see, you have a trigger that creates a trigger. I think Guinn misunderstood.

Firstly, which name do you want to capture? I used a trigger with this pattern:

The ($name1:*) quests 'If you think you know where ($name2:*) is, you might be able to find me!'

and this script:

#trig "see_qmob" {$name1} {#col yellow}

And it works fine. Just change it to $name2 if you wanted the second one captured.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Fri Dec 01, 2006 5:01 pm   
 
oooooo that looks great, thanks fang, that works fabulously. i need to learn more about catching variables like that though, its unfamiliar teritory.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Dec 01, 2006 5:14 pm   
 
It's pretty simple - you just use the syntax ($localvar:wildcard) and then call them throughout the script like you would with the %nn value. Wildcards are explained here.
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Fri Dec 01, 2006 5:16 pm   
 
thanks Fang, really helpful stuff
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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