SimpleHookEvent is_casting outputs error
Need help.
hook is_casting gives me error, whenever i try to use skill on my character.
Here is my code
automacro test {
SimpleHookEvent is_casting
call {
log test!
}
}
Error message:
Operation "eq": no method found,
left argument in overloaded package Skill,
right argument has no overloaded magic at plugins/eventMacro/eventMacro/Core.pm line 853.
Stack trace:
Operation "eq": no method found,
left argument in overloaded package Skill,
right argument has no overloaded magic at plugins/eventMacro/eventMacro/Core.pm line 853.
at plugins/eventMacro/eventMacro/Core.pm line 853
eventMacro::Core::set_scalar_var('eventMacro::Core=HASH(0x666e684)', '.SimpleHookEventLastSkill', 'Skill=HASH(0x6bb2184)', 0) called at plugins/eventMacro/eventMacro/Core.pm line 1511
eventMacro::Core::call_macro('eventMacro::Core=HASH(0x666e684)', 'eventMacro::Automacro=HASH(0x666f0ec)') called at plugins/eventMacro/eventMacro/Core.pm line 1386
eventMacro::Core::manage_event_callbacks('eventMacro::Core=HASH(0x666e684)', 'hook', 'is_casting', 'HASH(0x6bbb2fc)', 'HASH(0x6668434)') called at plugins/eventMacro/eventMacro/Core.pm line 489
eventMacro::Core::__ANON__('is_casting', 'HASH(0x6bbb2fc)', undef) called at src/Plugins.pm line 434
Plugins::callHook('is_casting', 'HASH(0x6bbb2fc)') called at src/Network/Receive/ServerType0.pm line 3345
Network::Receive::ServerType0::skill_cast('Network::Receive::iRO::Restart=HASH(0x689171c)', 'HASH(0x5827e84)') called at src/Network/PacketParser.pm line 276
Network::PacketParser::parse('Network::Receive::iRO::Restart=HASH(0x689171c)', '\x{fb}\x{7}Q\x{99}\x{2}\x{0}\x{ab}\x{a0}\x{3}\x{0}\x{0}\x{0}\x{0}\x{0}\x{1d}\x{0}\x{6}\x{0}\x{0}\x{0}\x{b3}\x{1}\x{0}\x{0}\x{0}', 'Network::Receive::iRO::Restart=HASH(0x689171c)') called at src/Network/Receive.pm line 137
Network::Receive::parse('Network::Receive::iRO::Restart=HASH(0x689171c)', '\x{fb}\x{7}Q\x{99}\x{2}\x{0}\x{ab}\x{a0}\x{3}\x{0}\x{0}\x{0}\x{0}\x{0}\x{1d}\x{0}\x{6}\x{0}\x{0}\x{0}\x{b3}\x{1}\x{0}\x{0}\x{0}', 'Network::Receive::iRO::Restart=HASH(0x689171c)') called at src/Network/PacketParser.pm line 410
Network::PacketParser::process('Network::Receive::iRO::Restart=HASH(0x689171c)', 'Network::MessageTokenizer=HASH(0x3aac394)', 'Network::Receive::iRO::Restart=HASH(0x689171c)') called at src/functions.pl line 736
main::mainLoop_initialized() called at src/functions.pl line 75
main::mainLoop() called at src/Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x4b28af4)') called at openkore.pl line 97
main::__start() called at start.pl line 136
Died at this line:
* if ($variable_value eq 'undef') {
undef $variable_value;
I got this problem too

This issue is still happening. Does anyone got a way around it?
i thkin the only way is to remove the function of save variables of hook
Died at this line:
* if ($variable_value eq 'undef') {
undef $variable_value;
so , what is 'undef' ? a word ????????????????????????????????? :confused:
i googling "right argument has no overloaded magic" and the result is not good for a beginner like me fckup with quote mark ?
@c4c1n6kr3m1 yes, on eventMacro it is a word, for when you want to undef a variable
i read somewhere the solution can be change to double quote mark "undef" or maybe regex /^undef$/ well i don't use eventMacro, yet
@c4c1n6kr3m1 tested your ideias:
- using double quotes didnot change anything
- using regex fixed the problem :thinking:
i don't understand enough of perl to know why, but it works
the only thing i did understand (more or less) is that some variable that is in is_casting hook has an overload method, ( i don't know what means 'overloaded') and the eq don't know how to deal with that
when stopped using eq then everything went back to normal
want to make the PR to fix this?
i am not speak english and not programer so i don't understand "overloaded" too :confused: if you want to PR, you better consult with other devs about this , especially the eventMacro's maker i've read that 'eq' confused to compare because it's not string , whatever ... it's definetly perls thingy