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


Joined: 14 Jun 2002
Posts: 6

PostPosted: Fri Jun 14, 2002 6:30 pm   

highlight enemies automatically?
 
I am a complete novice when it comes to Zmud, but I thought it would be cool to have a trigger/script to do the following:

The mud I'm on has assassins, who can be listed with the command "who assassin".

The command gives out information in the following format...

HP:60 EP:60> who assassin
----------Assassins Online (the dashes are actually whitespaces)

Jimmy the Hitman
Greg the Deathbringer
Susan the Slayer

Total assassins: 3
Total users: 97

The script would grab the first word of each assassin's line (their name) and store it in a variable list, and would exclude the other lines (assassins online and the total lines).

Then if you happened to walk into a room where one of these assassins was, their name would blink red.

Is this possible to do? If so would someone be willing to code it or point me in the right direction?

Thanks! - Racer
Reply with quote
int 21h
Newbie


Joined: 14 Jun 2002
Posts: 8

PostPosted: Fri Jun 14, 2002 8:33 pm   
 
I think the following code will do what you want to do, I make no claims to its functionality however, and it should only be used as pseudo guide to as how you should approach the problem. The aliases are used as follows: clearenemies (clears list of enemies), addenemy X (manually add X to enemy list), delenemy X (delete X from the enemy list if X is on the list). Everything is automatic to your specifications of your who list. Who assassin should fill your enemy list, and highlight them in red.

#trigger {^*Assassins Online} {#T+ enemyadd}
#trigger {^(%w) *} {#addi enemies %1} {enemyadd}
#trigger {^Total assassin*} {#T- enemyadd}
#trigger {{@enemies}} {#CW red}
#alias clearenemies {#unvar enemies}
#alias addenemy {#addi enemies %1}
#alias delenemy {#if (%ismember(%1,@enemies)) {#delitem enemies {%1};#say %1 Removed from List.} {#say %1 not on list!}}



---
I can show you the door, but only you can open it.

ArcticMUD (http://mud.arctic.org || telnet://mud.arctic.org:2700)
Reply with quote
Racer
Newbie


Joined: 14 Jun 2002
Posts: 6

PostPosted: Sun Jun 16, 2002 9:20 pm   
 
Thanks for the reply. This looks much easier than I expected. I'll try it out and let you know how it works...

Thanks again!
Reply with quote
Racer
Newbie


Joined: 14 Jun 2002
Posts: 6

PostPosted: Mon Jun 17, 2002 2:32 pm   
 
I tried setting this up, but it's not working correctly. Unless ALL of my enemies are listed on the line, it won't highlight the names in red.

My sample "test trigger" line comes up like "Enemy1|Enemy2|Enemy3" which I believe reads like "Enemy1" or "Enemy2" or "Enemy3", but it's acting like "Enemy1" and "Enemy2" and "Enemy3"

Any ideas? Thanks!
Reply with quote
Racer
Newbie


Joined: 14 Jun 2002
Posts: 6

PostPosted: Mon Jun 17, 2002 2:52 pm   
 
I changed the line:

#trigger {{@enemies}} {#CW red}

to

#trigger {({@enemies})} {#CW red}

and it works now...
Reply with quote
Racer
Newbie


Joined: 14 Jun 2002
Posts: 6

PostPosted: Mon Jun 17, 2002 4:12 pm   
 
One last question...Is there anyway I could accomplish this same task using a Zmud DB instead of just variables so that I can retain the information when I log off?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jun 17, 2002 6:23 pm   
 
zMUD will retain the information in a variable through logoff as long as you don't have a default value for the variable.

LightBulb
Senior Member
Reply with quote
Racer
Newbie


Joined: 14 Jun 2002
Posts: 6

PostPosted: Tue Jun 18, 2002 1:19 pm   
 
very cool! thanks!
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