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
Liposo
Plain Yogurt
Posts: 59 Joined: 20 May 2013, 02:00
Noob?: No
#1
Post
by Liposo » 22 Aug 2015, 07:02
I'm trying to write a plugin to hook when your HP/SP got changed.
I've found
in
ServerType0.pm . But somehow this function never triggers when your HP/SP got changed.
Please recommend how to know when HP/SP got changed using Plugin's hook.
Liposo
Plain Yogurt
Posts: 59 Joined: 20 May 2013, 02:00
Noob?: No
#2
Post
by Liposo » 24 Aug 2015, 07:10
Any way?
c4c1n6kr3m1
The Way Of Human
Posts: 150 Joined: 24 Mar 2012, 04:13
Noob?: Yes
#3
Post
by c4c1n6kr3m1 » 25 Aug 2015, 01:31
usually i added this line
message("this line is working\n");
Liposo
Plain Yogurt
Posts: 59 Joined: 20 May 2013, 02:00
Noob?: No
#4
Post
by Liposo » 04 Sep 2015, 15:23
c4c1n6kr3m1 wrote: usually i added this line
message("this line is working\n");
Yes I've added that line in the file. Still no message printed in console.
c4c1n6kr3m1
The Way Of Human
Posts: 150 Joined: 24 Mar 2012, 04:13
Noob?: Yes
#5
Post
by c4c1n6kr3m1 » 05 Sep 2015, 05:15
i am not familiar with this
i tried with my sitting bot with debug received
<< Received packet: 00B0 - Your Status Info [ 8 bytes]
so it is sub stat_info
you can see hash %stat_info_handlers
i don't know what is sub hp_sp_changed for
may be it is for warlock soul drain
because i remember a lot off complain about warlock here when they implement 0A27
vitriol
Plain Yogurt
Posts: 61 Joined: 19 Apr 2011, 23:26
Noob?: No
#6
Post
by vitriol » 06 Sep 2015, 01:12
Plugins::addHooks(['packet/hp_sp_changed', \&doHookSubroutine]);
Liposo
Plain Yogurt
Posts: 59 Joined: 20 May 2013, 02:00
Noob?: No
#7
Post
by Liposo » 15 Sep 2015, 02:52
vitriol wrote: Plugins::addHooks(['packet/hp_sp_changed', \&doHookSubroutine]);
I'm aware that I could add hook in line of code.
But if a simple code like
Code: Select all
message("this line is working\n");
is not printing any message in the console, that means the sub is never called therefore the hook shouldn't work either?