openkore
openkore copied to clipboard
eventMacro - Add hash variables support for SimpleHookEvent
https://github.com/OpenKore/openkore/issues/1256 This patch add possibility to get hash args from SimpleHookEvent call.
$.SimpleHookEventLast<capitalized hash name><capitalized hash key>
Macro example (to get sold item name):
automacro vend {
SimpleHookEvent vending_item_sold
call {
log $.SimpleHookEventLastVendArticleName
}
}
need your review @Henrybk
Seems good, I haven't tested it though. Maybe it could also support nested hashes and arrays using a while
for the ref type instead of an if
.
looks good but can not test it now.... cause we need to check is there any nested hashes and arrays in there, if yes max nesting?
Can smb give me alg to get all hooks in Kore?... i am so lost now
@Mortimal https://openkore.com/wiki/hooks#Discovering_all_existing_hooks_Windows_Distro
Found this already... only started: Plugins::callHook('checkPlayerCondition', %args); ACHTUNG! $player->{guild}{name} Plugins::callHook ('open_shop', {title => $shop{title}, items => @items}); ACHTUNG! @items - is array of hashes
i think this is better: #3686