N/H>Macro - Target died?

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Smith92
Noob
Noob
Posts: 5
Joined: 08 May 2012, 09:32
Noob?: Yes

N/H>Macro - Target died?

#1 Post by Smith92 »

hello all

i searched all macro pages here but coudlnt find a solution for my actuell problem.
i want to know if the target already died.
the normal output message after a mob died cant help me out.

i searched into the source a bit and found the snippet by finishAttack

Code: Select all

	my $args = AI::args;
	$timeout{'ai_attack'}{'time'} -= $timeout{'ai_attack'}{'timeout'};
	my $ID = $args->{ID};
	AI::dequeue;
	if ($monsters_old{$ID} && $monsters_old{$ID}{dead}) {
		message T("Target died\n"), "ai_attack";
i tried to insert a message code into the snipps where the main() will loop again to continue attack.....
that message was spammed into the console.

so my question is how can i use the code above inside a automacro?
i dont know how to use eval

can someone help me out how the code need to be used so that call will trigger mob still alive?
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: N/H>Macro - Target died?

#2 Post by EternalHarvest »

There's a hook "target_died" called right after that, how about using it?
how the code need to be used so that call will trigger mob still alive?
Can't you just check whether you're attacking something?

Code: Select all

eval AI::action eq 'attack'
Smith92
Noob
Noob
Posts: 5
Joined: 08 May 2012, 09:32
Noob?: Yes

Re: N/H>Macro - Target died?

#3 Post by Smith92 »

hello EternalHarvest

thank you for ur reply.

target_died sounds good, how i can use it?

i tried the eval ( $::AI::action eq "attack" ) but it ends up with the i quoted.

how do i use target_died?

Code: Select all

automacro detectAlive {
	eval AI::action eq 'attack'
	call {
		log "Target not dead"
		release detectAlive
	}
}
control\macros.txt: ignoring 'eval AI::action eq 'attack'' <munch, munch, unknown automacro keyword
the macro i want to try is meaned like this

Code: Select all

automacro detectAlive {
	Used Skill X
	if ( !$target_dead )
	call {
		log "Target not dead"
		release detectAlive
	}
}