[Tk Mission]Macro creation help needed (interesting topic !)

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
Gnagna
Noob
Noob
Posts: 7
Joined: 11 Dec 2013, 07:52
Noob?: Yes

Re: [Tk Mission]Macro creation help needed (interesting topic !)

#11 Post by Gnagna »

OMG, it's not working from the beginning xD, i got fooled by the "Message" automatically appearing from the ServerType0" there was no \n so it was chaining the "Monster: the propername" but the propername did not come from the sub

Code: Select all

sub tkpackets {
my (undef, $args) = @_;
my $tkmission = $args->{monsterName};
return "$tkmission";
}

automacro exp {
hook taekwon_packets_getmob
run-once 1 
call {
do eval tkpackets warning "Monster name : $tkmission\n";
}
The link made in servertype0 does not seems to work

Code: Select all

Plugins::callHook('taekwon_packets_getmob', {monsterName => bytesToSring($args->{name})});
here is my elseif statement in ServerType0:

Code: Select all

elsif ($args->{flag} == 20) { #Info about TaeKwon Do TK_MISSION mob
		Plugins::callHook('taekwon_packets_getmob', {monsterName => bytesToString($args->{name})});
		message TF("%s"."\n", bytesToString($args->{name})), "info";
	}

User avatar
SkylorD
Moderators
Moderators
Posts: 1166
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: [Tk Mission]Macro creation help needed (interesting topic !)

#12 Post by SkylorD »

Fine...

Use :

Code: Select all

hook packet_taekwon
ServerType0 :

Code: Select all

	} elsif ($args->{flag} == 20) { #Info about TaeKwon Do TK_MISSION mob
		message TF("[TaeKwon Mission] Target Monster : %s (%d%)"."\n", bytesToString($args->{name}), $args->{value}), "info";
        my $monsterName = bytesToString($args->{name});
		Plugins::callHook('packet_taekwon', { monster => $monsterName } );
		
	}
http://www.openkore.com/index.php/Macro_plugin

Search here for Hooks -> Events -> save
hook packet_taekwon
save monster
call {
Learn rules

Gnagna
Noob
Noob
Posts: 7
Joined: 11 Dec 2013, 07:52
Noob?: Yes

Re: [Tk Mission]Macro creation help needed (interesting topic !)

#13 Post by Gnagna »

Thanks man, i managed to make my macro work perfectly now :)

The only true problem was indeed how to initialize the hook by doing

Code: Select all

Plugins::callHook('packet_taekwon', { monster => $monsterName } );
i did not find good explanations on this on the wiki, i only found before asking your help, the event handling in the macros.txt file, i already did some tests and i was using the correct syntax with the

Code: Select all

hook packet, save, $.hooksave0
and so on before coming here lol

Thanks a lot for your help bro', now the mission changes until the mob changes and then it plays a wonderful sound to alert me ^^

See u ;-)

Locked