|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: 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 |
|
|
|
int 21h Newbie
Joined: 14 Jun 2002 Posts: 8
|
Posted: 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) |
|
|
|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: 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! |
|
|
|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: 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! |
|
|
|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: Mon Jun 17, 2002 2:52 pm |
I changed the line:
#trigger {{@enemies}} {#CW red}
to
#trigger {({@enemies})} {#CW red}
and it works now... |
|
|
|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: 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?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
Racer Newbie
Joined: 14 Jun 2002 Posts: 6
|
Posted: Tue Jun 18, 2002 1:19 pm |
very cool! thanks!
|
|
|
|
|
|