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
solaron_draktha
Newbie


Joined: 04 Jun 2002
Posts: 4

PostPosted: Tue Jun 04, 2002 2:38 pm   

Visible Threat Report
 
I posted this on the wrong forum, pardon me, last time.

If I type who and see three known killers on, I'd like to be able to tell my group or yell to the area automatically.

For example, I type "threat" and it automatically enters "who", if it sees any of the names that are on my threat list, it gossips those.

Is this possible?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jun 04, 2002 5:02 pm   
 
You would need a way to know when the output of who ends, but I'm going to use a blank line for this script:
#ALIAS threat {#T+ threatTrig;who;#TEMP {$} {#T- threatTrig}}
#TRIGGER {({@threatList})} {gtell %1 is logged on!} "threatTrig"

Kjata
Reply with quote
solaron_draktha
Newbie


Joined: 04 Jun 2002
Posts: 4

PostPosted: Wed Jun 05, 2002 12:01 am   
 
I've tried entering all of the above. I then go to variables and make one called threatList. I add names to it. I then type threat, and a who pops up, but nothing happens, even when those people added in @threatList are on. Ideas?
Reply with quote
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Wed Jun 05, 2002 2:38 am   
 
I'm not sure how Kjata was trying to get this to work, let me see what I can do.

#ALIAS threat {#T+ threatTrig;who;#ALARM +2 {#T- threatTrig}}
#TRIGGER {{@threatList}} {gtell %1 is logged on!} "threatTrig"

i'm not sure how the "#TEMP {$}" works in Kjata's example, but the #ALARM +2 in mine will allow the whole 'who' list to get to the screen before it turns off that class. Then anytime a persons name, who ismember of the @threatList will hit that trigger.

I'm also not sure what the extra set of () are for in Kjata's example either. I don't think they are needed for this.

I haven't tested this, it's just off the top of my head.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jun 05, 2002 2:07 pm   
 
The alias threat will enable a class called "threatTrig" which contains the trigger that will match the names of the people in the @thretList variable. Then the alias will send the who command to the MUD and create a temporary trigger which fires on a blank line (pattern: $) and disables the class with the trigger. The trigger just looks for any line that contains one of the words in the stringlist @threatList and then tells the group the name it has matched. The parenthesis are necessary because that is how you tell zMUD that you want to save whatever is matched to %1. Otherwise, %1 will be blank. Also, if you do it using the #ALARM you posted, then you run the risk that the who list might last longer that two seconds in finishing displaying and thus won't catch all of the names.

Now, I just tested this in my zMUD and it works perfectly. There is only one change to be made which is that I forgot that the trigger needs to have the Trigger on Trigger option disabled. Now, to check why it isn't working, here are some possible problems:
1. Something was mistyped. Check to see that everything is typed exactly as above.
2. Your who output does not actually end with a blank line. The temp trigger's pattern needs to be changed accordingly.
3. The @threatList variable is not created correctly. Make sure it is a stringlist variable, where each name is separated by a |. You can enter in the command line #SH @threatList, and it should display something like: Kjata|Solaron|Zugg

Kjata
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