viewtopic.php?f=24&t=6668.
Code: Select all
|=====VARS
|
| o UnderAttack exists so that you can filter based on wether or not you are currently being attacked, like:
| /if (${UnderAttack.Equal[True]}) {
| /yell
| }
|
| o AlertTank exists to ensure you're tank doesn't get spammed each time you get hit.
|
| o MTank is tank's name. (Who recieves the help cry)
|
|===========
/declare UnderAttack string outer FALSE
/declare AlertTank string outer FALSE
/declare MTank string outer Tank
|========== Description: ===============
|
| The advantage here is that it will actually return a target's unique spawn name instead of
| just pulling it out of the combat text. This is so that another character can target the exact
| mob that is attacking you if you have more than one "orc pawn" around.
| It clears the target and waits up to 4 seconds (count for ${i}) for the game to auto-target
| the next mob that hits you. Once this happens, it reportts to the tank the unique name of
| the mob that whacked you.
|
|==============================
Sub Event_Attacked
/declare i int local
/varset UnderAttack TRUE
/varset i 0
/squelch /target clear
:gettarget
/delay 5
/if (${Target.ID} && ${AlertTank.Equal[FALSE]}) {
/tell ${MTank} Help! ${Target.Name} is attacking ${Me.Name}!!
/varset AlertTank TRUE
/return
} else {
/if (${i}<7) {
/varcalc i ${i}+1
/goto :gettarget
}
}
/return
I guess this macro assumes only ONE mob is kicking your ass..
