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
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Tue Jun 25, 2002 1:57 pm   

Need help creating this complicated script
 
I need help creating a tracker that goes through a variable lists of names and outputs in chat if there are tracks of that person (name (fresh | medium | old) (direction)) then outputs again once the script is done listing all the names that was tracked.

The following are what outputs when I type, "track bob" and it's possible combinations.

The fresh tracks of Bob appear to leave the area heading %2!
The fresh tracks of Bob appear to leave the area right above you!
The fresh tracks of Bob appear to leave the area right below you!
The old tracks of Bob appear to leave the area heading %2!
The old tracks of Bob appear to leave the area right above you!
The old tracks of Bob appear to leave the area right below you!
The tracks of Bob appear to leave the area heading %2!
The tracks of Bob appear to leave the area right above you!
The tracks of Bob appear to leave the area right below you!


Note: The %2 could be north, east, south, west.

Basically, I want to have a variable list of name: Bob, Joe, Mary
and as it goes through the script, if it finds the tracks of Bob it will say in chat "Bob(old)east" and if nothing is found for Joe, nothing happens but then it finds tracks for mary then it would chat again "Mary(old)east" Going through the entire lists until it is either cancelled or finished with the list.

Lastly, when it is done with the list or was cancelled halfway through, it will then chat one more time saying:
Tracks Found: Bob(old)east, Mary(old)east

Can someone help me?

Thank you for everything, it's always appreciated.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Jun 25, 2002 6:33 pm   
 
Aliases to add/delete people to a list that you track:

#ALIAS addtrack {#ADDITEM V_TrackList %lower(%1);#ECHO Track list is now: %replace(@V_TrackList,"|",", ")}
#ALIAS deltrack {#DELITEM V_TrackList %lower(%1);#ECHO Track list is now: %replace(@V_TrackList,"|",", ")}

Alias to try to track all the people in that list:
#ALIAS dotrack {#VAR V_Tracked "";#FORALL @V_TrackList {#SEND {track %i}}}

#TRIGGER {The({ fresh | old | })tracks of ({@V_TrackList}) to leave the area heading (%w)!} {#ADDITEM V_Track %2~(%trim(%1)~)%3;say Track: %2~(%trim(%1)~)%3}

#TRIGGER {The({ fresh | old | })tracks of ({@V_TrackList}) appear to leave the area right (%2) you!} {#ADDITEM V_Track %2~(%trim(%1)~)%3};say Track: %2~(%trim(%1)~)%3}

#ALIAS showtrack {say I tracked: %replace(@V_Track,"|",", ")}

How about something like that? I changed chat for say. Not sure how spammy
this might be for you.

This will show:
Bob(fresh)east
Bob()east
Bob(old)east

Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Tue Jun 25, 2002 7:24 pm   
 
For the medium tracks, is there anyway to say

Bob(old)east
Bob(medium)east
Bob(fresh)east

instead of just Bob()east

Thank you for everything, it's always appreciated.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Tue Jun 25, 2002 9:55 pm   
 
#TRIGGER {The({ fresh | old | })tracks of ({@V_TrackList}) to leave the area heading (%w)!} {#ADDITEM V_Track %2~(%trim(%if("%1"=" ",medium))~)%3;say Track: %2~(%trim(%if("%1"=" ",medium))~)%3}

#TRIGGER {The({ fresh | old | })tracks of ({@V_TrackList}) appear to leave the area right (%2) you!} {#ADDITEM V_Track %2~(%trim(%if("%1"=" ",medium))~)%3};say Track: %2~(%trim(%if("%1"=" ",medium))~)%3}

That should add the mediums.
In order to do a cancel we would need to know what follows a tracking response, change the dotrack alias to only send 1 and update a variable, then add a trigger for the end of the track to execute dotrack again. The cancel could then be handled by a button changing the same variable to indicate a canceled state and therefore adjust showtrack's output. Hardly worth the effort until that list gets much longer.
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