Template:SimpleHookEvent: Difference between revisions
Jump to navigation
Jump to search
(Created page with " <noinclude>This template describes the '''SimpleHookEvent''' Event Conditions of the automacro eventMacros.</noinclude> ;SimpleHookEvent :* Description:...") |
No edit summary |
||
Line 1: | Line 1: | ||
<noinclude>This template describes the '''SimpleHookEvent''' [[EventMacro#Event|Event Conditions]] of the automacro eventMacros.</noinclude> | <noinclude>This template describes the '''SimpleHookEvent''' [[EventMacro#Event|Event Conditions]] of the automacro eventMacros.</noinclude> | ||
;SimpleHookEvent | ;SimpleHookEvent | ||
:* Description: Is checked every time the hook you set, is triggered. | :* Description: Is checked every time the [[hooks|hook]] you set, is triggered. | ||
: Syntax: | : Syntax: | ||
Line 10: | Line 10: | ||
: Set all variables the hook have as: | : Set all variables the hook have as: | ||
$.SimpleHookEventLast< | $.SimpleHookEventLast <Capitalized variable name> | ||
: Example: | |||
$. | : Example 1: | ||
Plugins::callHook("target_died", {monster => $monsters_old{$ID}}); | |||
SimpleHookEvent target_died | |||
$.SimpleHookEventLast'''Monster''' => monster ID in target_died hook | |||
: Example 2: | |||
Plugins::callHook ('open_shop', {title => $shop{title}, items => \@items}); | |||
SimpleHookEvent open_shop | |||
$.SimpleHookEventLast'''Title''' | |||
@.SimpleHookEventLast'''Items''' | |||
$.SimpleHookEventLast'''Items[0]''' | |||
: Example 3: | |||
my %hook_args = ( | |||
serverIndex => $index, | |||
itemID => $itemID, | |||
); | |||
Plugins::callHook('packet_useitem', \%hook_args); | |||
SimpleHookEvent packet_useitem | |||
%.SimpleHookEventLast'''Hook_args''' | |||
$.SimpleHookEventLast'''Hook_args{serverIndex}''' |
Latest revision as of 01:21, 15 January 2023
This template describes the SimpleHookEvent Event Conditions of the automacro eventMacros.
- 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}