-
Notifications
You must be signed in to change notification settings - Fork 762
Setnpctimer
Haru edited this page Oct 19, 2016
·
1 revision
- setnpctimer <tick></tick>{,"NPC Name"};
The 'setnpctimer' is a command that will explicitly set a NPC timer to a given tick. 'getnpctimer' provides timer information. Its parameter defines what type:
0 - Will return the current tick count of the timer. 1 - Will return 1 if there are remaining [[OnTimer]]<ticks></ticks>:" labels in the
specified NPC waiting for execution.
2 - Will return the number of times the timer has triggered and will
trigger an "OnTimer<tick></tick>:" label in the specified NPC.
Here is an example which will help you to understand how the setnpctimer command works.
[[OnTimer]]15000: [[set]] $quote,rand(5); [[if]]($quote == 0) goto Lquote0; if($quote == 1) [[goto]] Lquote1; if($quote == 2) goto Lquote2; if($quote == 3) goto Lquote3; if($quote == 4) goto Lquote4; Lquote0: [[npctalk]] "If 0 is randomly picked you will see this"; '''setnpctimer''' 0; [[end]]; Lquote1: npctalk "If 1 is randomly picked you will see this"; '''setnpctimer''' 0; end; Lquote2: npctalk "If 2 is randomly picked you will see this"; '''setnpctimer''' 0; end; Lquote3: npctalk "If 3 is randomly picked you will see this"; '''setnpctimer''' 0; end; Lquote4: npctalk "If 4 is randomly picked you will see this"; '''setnpctimer''' 0; end;
Example 2:
OnTimer60000&amp;&#35;58&#59; announce &amp;quot&#59;Only 30 seconds passed, but OnTimer60000 Called.&amp;quot&#59;,bc_all&amp;&#35;59&#59; end&amp;&#35;59&#59;Category:Script Command