<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Initnpctimer</id>
		<title>Initnpctimer - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Initnpctimer"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Initnpctimer&amp;action=history"/>
		<updated>2026-05-01T10:05:17Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Initnpctimer&amp;diff=964&amp;oldid=prev</id>
		<title>Ind: nevermind me [5] (testing stuff)</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Initnpctimer&amp;diff=964&amp;oldid=prev"/>
				<updated>2015-01-17T14:05:13Z</updated>
		
		<summary type="html">&lt;p&gt;nevermind me [5] (testing stuff)&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:05, 17 January 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  [[stopnpctimer]];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  [[stopnpctimer]];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  [[end]];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  [[end]];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Script Command]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Script Command]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ind</name></author>	</entry>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Initnpctimer&amp;diff=428&amp;oldid=prev</id>
		<title>Via: Created page with &quot;==Syntax== * initnpctimer {&lt;attach flag&gt;}; * initnpctimer {&quot;&lt;NPC name&gt;&quot;}; * initnpctimer {&quot;&lt;NPC name&gt;&quot;{, &lt;attach flag&gt;}};  ==Description==  This script command wil...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Initnpctimer&amp;diff=428&amp;oldid=prev"/>
				<updated>2013-06-09T08:14:33Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Syntax== * &lt;a href=&quot;/wiki/Initnpctimer&quot; title=&quot;Initnpctimer&quot;&gt;initnpctimer&lt;/a&gt; {&amp;lt;attach flag&amp;gt;}; * &lt;a href=&quot;/wiki/Initnpctimer&quot; title=&quot;Initnpctimer&quot;&gt;initnpctimer&lt;/a&gt; {&amp;quot;&amp;lt;NPC name&amp;gt;&amp;quot;}; * &lt;a href=&quot;/wiki/Initnpctimer&quot; title=&quot;Initnpctimer&quot;&gt;initnpctimer&lt;/a&gt; {&amp;quot;&amp;lt;NPC name&amp;gt;&amp;quot;{, &amp;lt;attach flag&amp;gt;}};  ==Description==  This script command wil...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Syntax==&lt;br /&gt;
* [[initnpctimer]] {&amp;lt;attach flag&amp;gt;};&lt;br /&gt;
* [[initnpctimer]] {&amp;quot;&amp;lt;NPC name&amp;gt;&amp;quot;};&lt;br /&gt;
* [[initnpctimer]] {&amp;quot;&amp;lt;NPC name&amp;gt;&amp;quot;{, &amp;lt;attach flag&amp;gt;}};&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
This script command will begin an NPC-attached timer on the running or specified NPC. The timer will run internally in the NPC and is not attached to any player, so will continue to run even when there are no players logged on. It is important to note that an NPC can only run a single timer on itself at any given time. In order to process multiple timers, the script would have to use player based timers such as [[addtimer]].&lt;br /&gt;
&lt;br /&gt;
The timer runs in milliseconds (1/1000th of a second) from 0, and calling this script command will begin a new timer (if a timer is not already running on the NPC) or reset the current timer on the NPC. To completely stop the NPC timer, the script command [[stopnpctimer]] must be called, and to resume the timer (without resetting the current tick) the script command [[startnpctimer]] must be called.&lt;br /&gt;
&lt;br /&gt;
The script can access a timer event by creating a label matching the format &amp;quot;OnTimer&amp;lt;tick&amp;gt;:&amp;quot; where the &amp;lt;tick&amp;gt; is replaced with a millisecond value to occur on. The NPC timer does not reset automatically once reaching one of these labels, therefore it is possible to multiple labels with incremented &amp;lt;tick&amp;gt; values to handle the same NPC timer (see [[#Examples|Examples]]).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
===Attach Flag===&lt;br /&gt;
&lt;br /&gt;
The flag value determines whether a player should be directly associated with this NPC timer. When flag is specified (a value of 1) the script will attach the player who is currently attached to the script, to the timer. If no player is attached to the script when this flag is specified, then the [[initnpctimer]] call will fail.&lt;br /&gt;
&lt;br /&gt;
If a player is successfully attached to the NPC timer, and logs out of the game, then the event label &amp;quot;OnTimerQuit:&amp;quot; will run on the NPC (the player will still be logged in at this point) to allow cleaning up and handling of the timer.&lt;br /&gt;
&lt;br /&gt;
===NPC Name===&lt;br /&gt;
&lt;br /&gt;
If specified, the call to [[initnpctimer]] will not apply to the current running script but will take effect on the NPC which exists with the passed NPC name. If an NPC could not be found with this name then the [[initnpctimer]] call will fail.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
* Announce every 1 second (resetting the timer after every 1000 milliseconds)&lt;br /&gt;
     initnpctimer;&lt;br /&gt;
     end;&lt;br /&gt;
 &lt;br /&gt;
 [[OnTimer]]1000:&lt;br /&gt;
     [[announce]] &amp;quot;1 second has passed!&amp;quot;, bc_all|bc_npc;&lt;br /&gt;
     initnpctimer;&lt;br /&gt;
     [[end]];&lt;br /&gt;
* Announce at 5 and 10 seconds (stopping the timer once 10000 milliseconds is reached)&lt;br /&gt;
     initnpctimer;&lt;br /&gt;
     end;&lt;br /&gt;
 &lt;br /&gt;
 [[OnTimer]]5000:&lt;br /&gt;
     [[announce]] &amp;quot;5 seconds have passed!&amp;quot;, bc_all|bc_npc;&lt;br /&gt;
     [[end]];&lt;br /&gt;
 &lt;br /&gt;
  OnTimer10000:&lt;br /&gt;
     announce &amp;quot;10 seconds have passed!!&amp;quot;, bc_all|bc_npc;&lt;br /&gt;
     [[stopnpctimer]];&lt;br /&gt;
     end;&lt;br /&gt;
&lt;br /&gt;
* Perform an event on a player every 60 seconds (resetting the timer after every 60000 milliseconds)&lt;br /&gt;
     initnpctimer 1;&lt;br /&gt;
     end;&lt;br /&gt;
 &lt;br /&gt;
 [[OnTimer]]60000:&lt;br /&gt;
     [[percentheal]] 10, 0;&lt;br /&gt;
     [[message]] [[strcharinfo]](0), &amp;quot;You were healed 10% HP!&amp;quot;;&lt;br /&gt;
     initnpctimer 1;&lt;br /&gt;
     [[end]];&lt;br /&gt;
 &lt;br /&gt;
 OnTimerQuit:&lt;br /&gt;
     [[stopnpctimer]];&lt;br /&gt;
     [[end]];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Command]]&lt;/div&gt;</summary>
		<author><name>Via</name></author>	</entry>

	</feed>