Moderator: MacroQuest Developers
Code: Select all
/varset v1 $target(id)
/assist
:loop
/if $target(id)==$v1 {
/delay 3
/goto loop
}
/attack

Code: Select all
#chat group
#define MT "toon1"
...
sub event_chat
/if "$p0"=="group" { | if group say
/if "$p1"==MT { | and said by main tank
/if "$left(6,"$p2")"=="attack" { | and starts with attack
/target id $int($right($strlen($p2)-6,$p2))
}
}
}
/return
Code: Select all
#event INC "Noir tells the group, Incoming'" |Change to INC msg start
|Variables used:
|v0 = Used to set your current target's id.
|event_INC will only be ran when the text above is sent
sub event_INC
/call FindAssist
/return
sub FindAssist
/press f1 |Select Self to clear any targets
/doevents
/varset v0 $target(id) |Set your ID as $v0
:CheckAgain
/assist Noir | Change Noir to the guy you want to assist
/doevents
|If Target isn't 0 (none) or yourself, you found a new target!
/if $target(id)!=$v0 /if $target(id)!=0 /goto :FoundTarget
/goto :CheckAgain
:FoundTarget
/attack on
/return
Is there a reason you need a specific target ID? Can't you just /assist your other char like stated above?you may want to look in to using events instead of delays. Each song should have some text that is output when it completes its "casting". When that text is displayed is usually the optimal time to stop it and start the next.
Code: Select all
/press f1
/varset v1 $target(id)
:loop
/if $target(id)==$v1 {
/assist myotherchar
/delay 3
/goto loop
}
/attackCode: Select all
#chat group
#define MT "toon1"
sub Main
:start
/doevents
/goto :start
/return
sub Event_chat
/if "$p0"=="group" {
/if "$p1"==MT {
/if "$left(6,"$p2")"=="attack" {
/varset v1 $int($calc($strlen("$p2")-7))
/target id $right($v1,"$p2")
}
}
}
/g %t is my target
/return