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


Joined: 18 Sep 2002
Posts: 15

PostPosted: Wed Sep 18, 2002 5:23 am   

Help with a tracking script.
 
Ok this may or may not be a complex question,
I certainly can't figure it out. I want to create a scan based tracking script. I have included a sample scan from the mud I play below. Now if I wanted to follow Regnak, how can I make a script that will associate his position with his name...i.e. when I get the scan below how can I make a script that will walk 2 south.



*** Range 1 (north) ***
A skeletal warrior scours the area looking for weaknesses.
*** Range 2 (north) ***
An avian city guard of Seringale stands watch here.
A fearless adventurer is here asking for a group to explore Haon Dor.
An elf citizen of Seringale sneaks around.
*** Range 3 (north) ***
A crazed monk wanders about the town telling prophecies of destruction.
*** Range 4 (north) ***
A dark warrior stands here executing the will of Grazz't.
You scan east.
*** Range 2 (east) ***
A crazed monk is sleeping here.
You scan south.
*** Range 1 (south) ***
A skeletal warrior scours the area looking for weaknesses.
An illithid city guard of Seringale stands watch here.
*** Range 2 (south) ***
(Translucent) (White Aura) Regnak the Holy Patriarch of Healing is here.
(Charmed) A special guard stands here, red with anger.
(Charmed) A mist of ectoplasm vapor fills the air.
(Pyramid) Addreodyn the Lord of the Senses is here.
*** Range 3 (south) ***
A skeletal warrior scours the area looking for weaknesses.
*** Range 4 (south) ***
A dark warrior stands here executing the will of Grazz't.
You scan west.
*** Range 3 (west) ***
A crazed monk wanders about the town telling prophecies of destruction.
You scan up.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 18, 2002 5:18 pm   
 
#VAR target Regnak
#TR {~*~*~* Range (%d) ~((%t)~) ~*~*~*} {#VAR TargetRange %1;#VAR TargetDir %2}
#TR {@target * here.} {walk @TargetRange @TargetDir}

LightBulb
Senior Member
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Wed Sep 18, 2002 8:39 pm   
 
Hmm, it seems like it almost works, it will fire the walk command when it see's the target, but it soesn't pick up the number or direction variable, it just gives a blank walk command?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 18, 2002 8:47 pm   
 
That means the first trigger isn't working, which means the trigger phrase doesn't match the MUD output. This is usually because there's extra spaces somewhere that don't show up in your post.

Change the phrase
{~*~*~* Range (%d) ~((%t)~) ~*~*~*}
so that it matches your MUD output. Cut-and-paste works well for this. Be sure to include the ~ before any special characters. Remember to use wildcards (such as %d and %t) for things that will change. And put parentheses around whatever parts you will want to use in the action (value) part of the trigger.

In case my explanation isn't clear, you should have a look at the zMUD helpfiles for triggers and patterns.

LightBulb
Senior Member
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Wed Sep 18, 2002 9:59 pm   
 
Hmmm, I understand what your saying and I've read all the helpfiles. I think there is a problem with it finding the direction variable because it is within paranthesis? Does that sound reasonable or am I nuts. Because I've tried a couple times varyinging the spaces and cut and pasting and it still won't fire. If I reduce the trigger to Range (%d), it will give me "walk 2", but I can't get walk 2 south.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Sep 19, 2002 12:01 am   
 
You should note that in LightBulb's suggestion there are two wildcards that are saved. So you have %1 and %2 available. Using LightBulb's pattern, your trigger should have:
walk %1 %2

Kjata
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Thu Sep 19, 2002 12:58 am   
 
Yeah, I have the two variable's, but like I said I can't get it to tore the second one. I must be an idiot?
Reply with quote
Stephen
Newbie


Joined: 02 Nov 2000
Posts: 8

PostPosted: Thu Sep 19, 2002 3:45 am   
 
Hey, Darkspawn. I play Abandoned Realms too - An excellent MUD. So here are the triggers you want (exactly):

#tr {~*~*~* Range (%d) ~((%w)~) ~*~*~*} {num = %1; dir = %2}

#tr {@hunted * here.} {#loop @num @dir}

Now, I'm using ZMud 6.16, but these seem to work wonderfully. Remember the @hunted variable must contain the name of the person you're tracking.

I use an alias to set this:

#alias {pk} {#if (%1==%null) {hunted = ""} {hunted = %1}}

Good luck! Hope this doesn't help you kill me in the game.
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Thu Sep 19, 2002 3:59 am   
 
Haha, yeah that one works much better stephen, thanks a bunch.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 19, 2002 6:30 pm   
 
It's possible that %t doesn't recognize "south" as a direction. Just change it to (%w), which is a word.
#TR {~*~*~* Range (%d) ~((%w)~) ~*~*~*} {#VAR TargetRange %1;#VAR TargetDir %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