Skip to content
Haru edited this page Oct 19, 2016 · 1 revision

Syntax

  • setnpctimer <tick></tick>{,"NPC Name"};

Description

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]]&lt;ticks&gt;&lt;/ticks&gt;:" 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.

Example

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;amp&#59;&amp;&#35;35&#59;58&amp;&#35;59&#59;
		announce &amp;amp&#59;quot&amp;&#35;59&#59;Only 30 seconds passed, but OnTimer60000 Called.&amp;amp&#59;quot&amp;&#35;59&#59;,bc_all&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
		end&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
Category:Script Command
Clone this wiki locally