when getting attacked, how do I fight back

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

Moderator: MacroQuest Developers

quasit
orc pawn
orc pawn
Posts: 14
Joined: Sun Oct 27, 2002 11:51 am

when getting attacked, how do I fight back

Post by quasit » Thu Dec 19, 2002 11:39 pm

I am writing a macro, and i would like to put in a short subroutine to attack and kill something if it attacks me first. I thought I saw some built into hunter.macs, but I just need that part of it. It seems entrenched into the macro and I can figure out what I need and what I dont need. I would like to loot it, follow it when it starts walking away and stuff like that. Any help would be appreciated.

Q

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Sat Dec 21, 2002 11:01 pm

One way to approach this is to check and see if you have a target. If you have a target then odds are it is attacking you. I usually do a cleanup after the looting portion of my code which assures me I have no target. Therefore if I end up with one it is because it hit me.

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

There is that...

Post by Malachi » Sun Dec 22, 2002 2:13 am

You can check for a target, but that could be bad if hangin around freeport or something and someone buffs you....you attack and guards eat you.

Fippy did it with alerts.

alert ImGettinWhacked "hits you for"

if alert ImGettinWhacked==1 /call Killit

:Sub Killil
attack blah blah blah

Been outta the loop for a few weeks...but you can snag that part from hunter.mac, shouldn't be hard.

~Malachi
~Oh danny boy, the pipes the pipes are calling.~