SimpleHookEvent: Difference between revisions
Jump to navigation
Jump to search
(Add EventMacro event condition: SimpleHookEvent) |
m (4epT moved page simpleHookEvent to SimpleHookEvent over a redirect without leaving a redirect) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:SimpleHookEvent}} | |||
: | [[Category:EventMacro_Automacros]] | ||
[[Category:EventMacro_Conditions_Event]] | |||
: | |||
Latest revision as of 21:57, 12 September 2021
- SimpleHookEvent
-
- Description: Is checked every time the hook you set, is triggered.
- Syntax:
SimpleHookEvent <hook name>
- Example:
SimpleHookEvent target_died
- Set all variables the hook have as:
$.SimpleHookEventLast <Capitalized variable name>
- Example 1:
Plugins::callHook("target_died", {monster => $monsters_old{$ID}}); SimpleHookEvent target_died $.SimpleHookEventLastMonster => monster ID in target_died hook
- Example 2:
Plugins::callHook ('open_shop', {title => $shop{title}, items => \@items}); SimpleHookEvent open_shop $.SimpleHookEventLastTitle @.SimpleHookEventLastItems $.SimpleHookEventLastItems[0]
- Example 3:
my %hook_args = ( serverIndex => $index, itemID => $itemID, ); Plugins::callHook('packet_useitem', \%hook_args); SimpleHookEvent packet_useitem %.SimpleHookEventLastHook_args $.SimpleHookEventLastHook_args{serverIndex}