Player Alerts

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Player Alerts

Post by Slice » Mon Nov 04, 2002 10:15 am

I'm on a PvP server and I have a second account I dual with in the background in EQW. I use a bot on the second account. I'm trying to design a macro to have the bot alert me when someone that is not on my team is in the zone and their distance to me.

I've thought of two ways to do this:

1) Pull the /who command into an array and then step through the array and con each target looking for a con that is threateningly

2) Maintain a list of hostile guilds or active PK'ers and put them in as alerts.

I'd prefer to go with option 1 because it's more dynamic and I don't have to maintain a list of enemies. But I can't figure out how to get the /who list into an array.

Any ideas?

Thanks,
Slice

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Mon Nov 11, 2002 5:31 pm

After some research I don't think the features are there to support option 1. So here's some coding I did on option 2. Please take a look and see if you think this will work or if there's a better way to write it.

This is just an excerpt of the player alert section I'm adding to S_B_R's Cbot.mac
[ L124RD added Code Brackets]

Code: Select all

Sub Main 
|Assign Player Alerts
/alert add 1 pc Bob
/alert add 2 pc radius 1000 Bob
/alert add 1 pc Sam
/alert add 2 pc radius 1000 Sam
/alert add 1 pc Frank
/alert add 2 pc radius 1000 Frank
:chkevent 
/doevents 
/goto :chkevent 
/return 

Sub Event_Alerts
If $alert(1)=="TRUE" {
     /tell $p69 ENEMY IN ZONE! PREPARE FOR ACTION!
     }
If $alert(2)=="TRUE" {
     /tell $p69 ENEMY IS NEAR! WAKE UP YOU SON OF A MOSS SNAKE!
     }
/return
Slice

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Mon Nov 11, 2002 5:40 pm

Salutations,
I, myself, am not sure if that code will work... I think it has to be more along the lines of:

Code: Select all

Sub Main
|Assign Player Alerts
/alert add 1 pc Bob
/alert add 2 pc radius 1000 Bob
/alert add 1 pc Sam
/alert add 2 pc radius 1000 Sam
/alert add 1 pc Frank
/alert add 2 pc radius 1000 Frank
:chkevent
/press esc
/target alert 2
/if $target()!=FALSE {
 /tell $p69 ENEMY WITHIN 1000 CLICKS!
} else {
 /target alert 1
 /if $target()!=FALSE /tell $p69 ENEMY IN ZONE!
}
/goto :chkevent
/return