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


Joined: 21 Aug 2007
Posts: 29

PostPosted: Tue Aug 21, 2007 10:23 pm   

Newbie zmudder trying to make a simple trigger
 
I am very new to zmud and I am trying to make a simple trigger but have been really struggling to do so. The mud I play has it's own mud variables, such as {location} to tell which plane you are on, {*x*} to tell what you x-coordinate is, and {*y*} for your y-coordinate. I want to make a trigger that will display my location to any of my clan mates. If someone types "findxan" across a certain channel, I want it to fire back the contents of the variables I mentioned above. I have been able to make this work in 2 separate triggers.

Trigger 1

Pattern
^Guest tells you, ':%w: findxan.'$
Output
display {*name*} is in {location} at {*x*} {*y*}

This displays "Xantharus is in the Realm at 2000 -2000

I then have a 2nd trigger

Pattern
%w is in the Realm at (%d) (%d)$
Output
tell guest [>I am in the Realm at %1 %2

There has to be a better way to do this. Any help?
Thanks
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Aug 21, 2007 11:05 pm   
 
The curly braces {}, square brackets [] and angle brackets <> are special characters in zMUD. You can tell zMUD that you don't want to use their special properties by putting a ~ before them. So your commands become

display ~{*name*~} is in ~{location~} at ~{*x*~} ~{*y*~}
tell guest ~[~>I am in the Realm at %1 %2

You might possibly need to quote the asterisks too, but I don't think so.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Wed Aug 22, 2007 6:59 am   
 
That didn't help me too much. What I am trying to do is to get rid of the 2 step process. How can I read those mud variables into zmud variables or is there a way for me to just type tell guest "I am in {location} at {*x*} {*y*}"? Right now the display just echos the variables out to the screen and another trigger picks them up. Seems cumbersome.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Aug 22, 2007 7:18 am   
 
It is probably a limitation in your mud that only makes the variables available with the display command. You could try to see if they are available with other commands; perhaps starting with say, prompt, and trying tell. If they work then you can do it as the single command "tell guest [>I am in the realm at {*x*} {*y*}", otherwise you are doing it right.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Thu Aug 23, 2007 1:25 pm   
 
Thank you both for your help. I have rewritten this and it seems to work.
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