<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.solarstrike.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pumbatoo</id>
		<title>SolarStrike wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.solarstrike.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pumbatoo"/>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php/Special:Contributions/Pumbatoo"/>
		<updated>2026-04-30T22:04:44Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Custom_Scripting&amp;diff=982</id>
		<title>RoM Custom Scripting</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Custom_Scripting&amp;diff=982"/>
				<updated>2011-08-08T17:04:46Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[RoM Heal Yourself|How To: Heal yourself with the Bot]]&lt;br /&gt;
* [[RoM Working with profile events|How To: Working with profile events]]&lt;br /&gt;
* [[RoM Harvest|How To: Harvest]]&lt;br /&gt;
* [[RoM Leveling|How To: Automatic Leveling e.g. Level 1-10]] - Connect waypoint files, level up skills, open bags and equipt items&lt;br /&gt;
* [[RoM Working with waypoint files|How To: Working with waypoint files]]&lt;br /&gt;
* [[RoM Auto repair|How To: Auto Repair and Auto Sell]]&lt;br /&gt;
* [[RoM Fight Support Only|How To: Use the Bot as Fight Support Only]]&lt;br /&gt;
* [[RoM Looting Issues|How To: Looting Issues, Lootfilter, Problems ...]]&lt;br /&gt;
* [[RoM Click in foreground|How To: Use mouseclick on foreground window]]&lt;br /&gt;
* [[RoM DailyLevel1Elves|Example Script: Daily Quest Tal der Vorbereitung (German Labels)]]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_file&amp;diff=980</id>
		<title>RoM Waypoint file</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_file&amp;diff=980"/>
				<updated>2011-08-08T17:01:26Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: moved RoM Waypoinf files to RoM Waypoint file:&amp;amp;#32;typo correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Create a new waypoint file =&lt;br /&gt;
Start MicroMacro and execute the rom/createpath.lua script by entering&lt;br /&gt;
 rom/createpath.lua&lt;br /&gt;
into your MM window. You need a valid profile for your ingame charactername and have to set the dummy macro ingame. You could also execute the script with a forced profile&lt;br /&gt;
 rom/createpath.lua profile:default&lt;br /&gt;
&lt;br /&gt;
You just walk to each point you want in your waypoint list (try to avoid walking near any trees, fences, steep hills, etc.), and press NUMPAD 1. Once you've made your round (the waypoints should loop back and bring you near the start), press NUMPAD 3. Now type in the name you want to save it as (example: 'boars' would be good enough. Don't include any slashes, and the .xml extension is automatically applied).&lt;br /&gt;
&lt;br /&gt;
The new created waypointfile boars.xml will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 4 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-640&amp;quot; z=&amp;quot;-8412&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 5 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-800&amp;quot; z=&amp;quot;-8308&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Waypoint types =&lt;br /&gt;
&lt;br /&gt;
You can determine the targeting and attacking behaviour of the bot by using waypoint types. You can add the 'type' option at the top of the waypoint file or separately for each waypoint. The default value is 'NORMAL'. If you don't specify a type at the waypoint, the waypoint will inherit the type from the &amp;lt;WAYPOINTS&amp;gt; tag at the top of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot; type=&amp;quot;RUN&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;In this example, the waypoints #1 and #3 have the type 'TRAVEL' and the waypoints #2 have the type 'RUN'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | NORMAL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Default value for waypoints. The bot will try to target new mobs and attack them.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | RUN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs but will fight back against aggressive enemies.&lt;br /&gt;
&lt;br /&gt;
This should be used when attempting to run through groups of enemies and only bothering with those that attack you, such as when you are running out to your farming spot.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | TRAVEL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.&lt;br /&gt;
&lt;br /&gt;
This should be used to travel to &amp;quot;safe&amp;quot; locations (ie. town).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Using LUA code within your waypoint files =&lt;br /&gt;
You can use you own lua code '''within''' the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything.&lt;br /&gt;
The lua code will be executed after you reach that waypoint.  It would look like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
   if( player.Level &amp;gt; 2 ) then&lt;br /&gt;
      loadPaths(&amp;quot;1-10Pioneers/l3t_3-4_bear&amp;quot;);&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2144&amp;quot; z=&amp;quot;-9585&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also make use of an onLoad event for this waypoint script. This Lua code will be executed when the waypoint script is loaded (either automatically or by calling __WPL:load()).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoints&amp;gt;&lt;br /&gt;
   &amp;lt;onLoad&amp;gt;&lt;br /&gt;
      printf(&amp;quot;Waypoint onLoad event test.\n&amp;quot;);&lt;br /&gt;
   &amp;lt;/onLoad&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions list of functions] that you can use for your own coding.&lt;br /&gt;
&lt;br /&gt;
= The included 'RBAssist.xml' waypoint file =&lt;br /&gt;
&lt;br /&gt;
This file does not move your character, only heals, buffs and attacks monsters. It can be used to help you when you are playing manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has 3 'modes' that can be set by the user by changing the 'attackMode' variable at the top of the file.&lt;br /&gt;
The 3 modes are:&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''trigger''''  &lt;br /&gt;
| = Have to trigger each attack with the &amp;quot;go&amp;quot; macro.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''auto''''&lt;br /&gt;
| = Auto attacks targeted monsters. &amp;quot;go&amp;quot; macro toggles it on and off.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''disabled''''&lt;br /&gt;
| = Only heal and buff. Never attacks. &amp;quot;go&amp;quot; macro does nothing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default it is set to mode ''''auto'''' and is switched 'on' so it is ready to attack automatically when you target a monster even without using the trigger. So in the default mode, using the 'trigger' is optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wish to use the trigger, create a macro with the command&lt;br /&gt;
 /script RBTrigger = &amp;quot;go&amp;quot;&lt;br /&gt;
and add it to your action bar. Then when you press it, the script will receive the trigger and act accordingly.&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoinf_files&amp;diff=981</id>
		<title>RoM Waypoinf files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoinf_files&amp;diff=981"/>
				<updated>2011-08-08T17:01:26Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: moved RoM Waypoinf files to RoM Waypoint file:&amp;amp;#32;typo correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[RoM Waypoint file]]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_files&amp;diff=979</id>
		<title>RoM Waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_files&amp;diff=979"/>
				<updated>2011-08-08T17:00:04Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=Del:RoM_Waypoint_files&amp;diff=977</id>
		<title>Del:RoM Waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Del:RoM_Waypoint_files&amp;diff=977"/>
				<updated>2011-08-08T16:58:06Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: moved RoM Waypoint files to Del:RoM Waypoint files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Create a new waypoint file =&lt;br /&gt;
Start MicroMacro and execute the rom/createpath.lua script by entering&lt;br /&gt;
 rom/createpath.lua&lt;br /&gt;
into your MM window. You need a valid profile for your ingame charactername and have to set the dummy macro ingame. You could also execute the script with a forced profile&lt;br /&gt;
 rom/createpath.lua profile:default&lt;br /&gt;
&lt;br /&gt;
You just walk to each point you want in your waypoint list (try to avoid walking near any trees, fences, steep hills, etc.), and press NUMPAD 1. Once you've made your round (the waypoints should loop back and bring you near the start), press NUMPAD 3. Now type in the name you want to save it as (example: 'boars' would be good enough. Don't include any slashes, and the .xml extension is automatically applied).&lt;br /&gt;
&lt;br /&gt;
The new created waypointfile boars.xml will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 4 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-640&amp;quot; z=&amp;quot;-8412&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 5 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-800&amp;quot; z=&amp;quot;-8308&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Waypoint types =&lt;br /&gt;
&lt;br /&gt;
You can determine the targeting and attacking behaviour of the bot by using waypoint types. You can add the 'type' option at the top of the waypoint file or separately for each waypoint. The default value is 'NORMAL'. If you don't specify a type at the waypoint, the waypoint will inherit the type from the &amp;lt;WAYPOINTS&amp;gt; tag at the top of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot; type=&amp;quot;RUN&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;In this example, the waypoints #1 and #3 have the type 'TRAVEL' and the waypoints #2 have the type 'RUN'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | NORMAL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Default value for waypoints. The bot will try to target new mobs and attack them.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | RUN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs but will fight back against aggressive enemies.&lt;br /&gt;
&lt;br /&gt;
This should be used when attempting to run through groups of enemies and only bothering with those that attack you, such as when you are running out to your farming spot.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | TRAVEL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.&lt;br /&gt;
&lt;br /&gt;
This should be used to travel to &amp;quot;safe&amp;quot; locations (ie. town).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Using LUA code within your waypoint files =&lt;br /&gt;
You can use you own lua code '''within''' the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything.&lt;br /&gt;
The lua code will be executed after you reach that waypoint.  It would look like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
   if( player.Level &amp;gt; 2 ) then&lt;br /&gt;
      loadPaths(&amp;quot;1-10Pioneers/l3t_3-4_bear&amp;quot;);&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2144&amp;quot; z=&amp;quot;-9585&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also make use of an onLoad event for this waypoint script. This Lua code will be executed when the waypoint script is loaded (either automatically or by calling __WPL:load()).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoints&amp;gt;&lt;br /&gt;
   &amp;lt;onLoad&amp;gt;&lt;br /&gt;
      printf(&amp;quot;Waypoint onLoad event test.\n&amp;quot;);&lt;br /&gt;
   &amp;lt;/onLoad&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions list of functions] that you can use for your own coding.&lt;br /&gt;
&lt;br /&gt;
= The included 'RBAssist.xml' waypoint file =&lt;br /&gt;
&lt;br /&gt;
This file does not move your character, only heals, buffs and attacks monsters. It can be used to help you when you are playing manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has 3 'modes' that can be set by the user by changing the 'attackMode' variable at the top of the file.&lt;br /&gt;
The 3 modes are:&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''trigger''''  &lt;br /&gt;
| = Have to trigger each attack with the &amp;quot;go&amp;quot; macro.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''auto''''&lt;br /&gt;
| = Auto attacks targeted monsters. &amp;quot;go&amp;quot; macro toggles it on and off.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''disabled''''&lt;br /&gt;
| = Only heal and buff. Never attacks. &amp;quot;go&amp;quot; macro does nothing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default it is set to mode ''''auto'''' and is switched 'on' so it is ready to attack automatically when you target a monster even without using the trigger. So in the default mode, using the 'trigger' is optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wish to use the trigger, create a macro with the command&lt;br /&gt;
 /script RBTrigger = &amp;quot;go&amp;quot;&lt;br /&gt;
and add it to your action bar. Then when you press it, the script will receive the trigger and act accordingly.&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_files&amp;diff=978</id>
		<title>RoM Waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_files&amp;diff=978"/>
				<updated>2011-08-08T16:58:06Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: moved RoM Waypoint files to Del:RoM Waypoint files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Del:RoM Waypoint files]]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_file&amp;diff=976</id>
		<title>RoM Waypoint file</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Waypoint_file&amp;diff=976"/>
				<updated>2011-08-08T16:57:31Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Create a new waypoint file =&lt;br /&gt;
Start MicroMacro and execute the rom/createpath.lua script by entering&lt;br /&gt;
 rom/createpath.lua&lt;br /&gt;
into your MM window. You need a valid profile for your ingame charactername and have to set the dummy macro ingame. You could also execute the script with a forced profile&lt;br /&gt;
 rom/createpath.lua profile:default&lt;br /&gt;
&lt;br /&gt;
You just walk to each point you want in your waypoint list (try to avoid walking near any trees, fences, steep hills, etc.), and press NUMPAD 1. Once you've made your round (the waypoints should loop back and bring you near the start), press NUMPAD 3. Now type in the name you want to save it as (example: 'boars' would be good enough. Don't include any slashes, and the .xml extension is automatically applied).&lt;br /&gt;
&lt;br /&gt;
The new created waypointfile boars.xml will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 4 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-640&amp;quot; z=&amp;quot;-8412&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 5 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-800&amp;quot; z=&amp;quot;-8308&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Waypoint types =&lt;br /&gt;
&lt;br /&gt;
You can determine the targeting and attacking behaviour of the bot by using waypoint types. You can add the 'type' option at the top of the waypoint file or separately for each waypoint. The default value is 'NORMAL'. If you don't specify a type at the waypoint, the waypoint will inherit the type from the &amp;lt;WAYPOINTS&amp;gt; tag at the top of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot; type=&amp;quot;RUN&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;In this example, the waypoints #1 and #3 have the type 'TRAVEL' and the waypoints #2 have the type 'RUN'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | NORMAL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Default value for waypoints. The bot will try to target new mobs and attack them.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | RUN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs but will fight back against aggressive enemies.&lt;br /&gt;
&lt;br /&gt;
This should be used when attempting to run through groups of enemies and only bothering with those that attack you, such as when you are running out to your farming spot.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | TRAVEL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.&lt;br /&gt;
&lt;br /&gt;
This should be used to travel to &amp;quot;safe&amp;quot; locations (ie. town).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Using LUA code within your waypoint files =&lt;br /&gt;
You can use you own lua code '''within''' the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything.&lt;br /&gt;
The lua code will be executed after you reach that waypoint.  It would look like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
   if( player.Level &amp;gt; 2 ) then&lt;br /&gt;
      loadPaths(&amp;quot;1-10Pioneers/l3t_3-4_bear&amp;quot;);&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2144&amp;quot; z=&amp;quot;-9585&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also make use of an onLoad event for this waypoint script. This Lua code will be executed when the waypoint script is loaded (either automatically or by calling __WPL:load()).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoints&amp;gt;&lt;br /&gt;
   &amp;lt;onLoad&amp;gt;&lt;br /&gt;
      printf(&amp;quot;Waypoint onLoad event test.\n&amp;quot;);&lt;br /&gt;
   &amp;lt;/onLoad&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions list of functions] that you can use for your own coding.&lt;br /&gt;
&lt;br /&gt;
= The included 'RBAssist.xml' waypoint file =&lt;br /&gt;
&lt;br /&gt;
This file does not move your character, only heals, buffs and attacks monsters. It can be used to help you when you are playing manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has 3 'modes' that can be set by the user by changing the 'attackMode' variable at the top of the file.&lt;br /&gt;
The 3 modes are:&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''trigger''''  &lt;br /&gt;
| = Have to trigger each attack with the &amp;quot;go&amp;quot; macro.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''auto''''&lt;br /&gt;
| = Auto attacks targeted monsters. &amp;quot;go&amp;quot; macro toggles it on and off.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''disabled''''&lt;br /&gt;
| = Only heal and buff. Never attacks. &amp;quot;go&amp;quot; macro does nothing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default it is set to mode ''''auto'''' and is switched 'on' so it is ready to attack automatically when you target a monster even without using the trigger. So in the default mode, using the 'trigger' is optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wish to use the trigger, create a macro with the command&lt;br /&gt;
 /script RBTrigger = &amp;quot;go&amp;quot;&lt;br /&gt;
and add it to your action bar. Then when you press it, the script will receive the trigger and act accordingly.&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=Del:RoM_Waypoint_files&amp;diff=975</id>
		<title>Del:RoM Waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Del:RoM_Waypoint_files&amp;diff=975"/>
				<updated>2011-08-08T16:57:15Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: Created page with '= Create a new waypoint file = Start MicroMacro and execute the rom/createpath.lua script by entering  rom/createpath.lua into your MM window. You need a valid profile for your i…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Create a new waypoint file =&lt;br /&gt;
Start MicroMacro and execute the rom/createpath.lua script by entering&lt;br /&gt;
 rom/createpath.lua&lt;br /&gt;
into your MM window. You need a valid profile for your ingame charactername and have to set the dummy macro ingame. You could also execute the script with a forced profile&lt;br /&gt;
 rom/createpath.lua profile:default&lt;br /&gt;
&lt;br /&gt;
You just walk to each point you want in your waypoint list (try to avoid walking near any trees, fences, steep hills, etc.), and press NUMPAD 1. Once you've made your round (the waypoints should loop back and bring you near the start), press NUMPAD 3. Now type in the name you want to save it as (example: 'boars' would be good enough. Don't include any slashes, and the .xml extension is automatically applied).&lt;br /&gt;
&lt;br /&gt;
The new created waypointfile boars.xml will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 4 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-640&amp;quot; z=&amp;quot;-8412&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 5 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-800&amp;quot; z=&amp;quot;-8308&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Waypoint types =&lt;br /&gt;
&lt;br /&gt;
You can determine the targeting and attacking behaviour of the bot by using waypoint types. You can add the 'type' option at the top of the waypoint file or separately for each waypoint. The default value is 'NORMAL'. If you don't specify a type at the waypoint, the waypoint will inherit the type from the &amp;lt;WAYPOINTS&amp;gt; tag at the top of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-791&amp;quot; z=&amp;quot;-8322&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-637&amp;quot; z=&amp;quot;-8155&amp;quot; type=&amp;quot;RUN&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-552&amp;quot; z=&amp;quot;-8251&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;In this example, the waypoints #1 and #3 have the type 'TRAVEL' and the waypoints #2 have the type 'RUN'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | NORMAL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Default value for waypoints. The bot will try to target new mobs and attack them.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | RUN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs but will fight back against aggressive enemies.&lt;br /&gt;
&lt;br /&gt;
This should be used when attempting to run through groups of enemies and only bothering with those that attack you, such as when you are running out to your farming spot.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | TRAVEL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.&lt;br /&gt;
&lt;br /&gt;
This should be used to travel to &amp;quot;safe&amp;quot; locations (ie. town).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Using LUA code within your waypoint files =&lt;br /&gt;
You can use you own lua code '''within''' the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything.&lt;br /&gt;
The lua code will be executed after you reach that waypoint.  It would look like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
   if( player.Level &amp;gt; 2 ) then&lt;br /&gt;
      loadPaths(&amp;quot;1-10Pioneers/l3t_3-4_bear&amp;quot;);&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;waypoint x=&amp;quot;-2144&amp;quot; z=&amp;quot;-9585&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also make use of an onLoad event for this waypoint script. This Lua code will be executed when the waypoint script is loaded (either automatically or by calling __WPL:load()).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;waypoints&amp;gt;&lt;br /&gt;
   &amp;lt;onLoad&amp;gt;&lt;br /&gt;
      printf(&amp;quot;Waypoint onLoad event test.\n&amp;quot;);&lt;br /&gt;
   &amp;lt;/onLoad&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint x=&amp;quot;-2462&amp;quot; z=&amp;quot;-9625&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions list of functions] that you can use for your own coding.&lt;br /&gt;
&lt;br /&gt;
= The included 'RBAssist.xml' waypoint file =&lt;br /&gt;
&lt;br /&gt;
This file does not move your character, only heals, buffs and attacks monsters. It can be used to help you when you are playing manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has 3 'modes' that can be set by the user by changing the 'attackMode' variable at the top of the file.&lt;br /&gt;
The 3 modes are:&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''trigger''''  &lt;br /&gt;
| = Have to trigger each attack with the &amp;quot;go&amp;quot; macro.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''auto''''&lt;br /&gt;
| = Auto attacks targeted monsters. &amp;quot;go&amp;quot; macro toggles it on and off.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 80px;&amp;quot; |    ''''disabled''''&lt;br /&gt;
| = Only heal and buff. Never attacks. &amp;quot;go&amp;quot; macro does nothing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default it is set to mode ''''auto'''' and is switched 'on' so it is ready to attack automatically when you target a monster even without using the trigger. So in the default mode, using the 'trigger' is optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wish to use the trigger, create a macro with the command&lt;br /&gt;
 /script RBTrigger = &amp;quot;go&amp;quot;&lt;br /&gt;
and add it to your action bar. Then when you press it, the script will receive the trigger and act accordingly.&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=Talk:RoM_Working_with_waypoint_files&amp;diff=974</id>
		<title>Talk:RoM Working with waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Talk:RoM_Working_with_waypoint_files&amp;diff=974"/>
				<updated>2011-08-08T16:51:01Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: Redundance and non How Tos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The only How Tos on this page are the last two sections:&lt;br /&gt;
* 'How to use the bot for running between the and NPC &amp;lt;-&amp;gt; blackboard for delivering of daily quests', and&lt;br /&gt;
* 'Automatic leveling with the Bot'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The two sections above were still described on other places:&lt;br /&gt;
* The first section 'LUA code within a waypoint file' is already in the official Waypoint File Page. (see [http://www.solarstrike.net/wiki/index.php5?title=RoM_Waypoinf_files#Using_LUA_coding_with_your_waypoint_files])&lt;br /&gt;
* The second section 'List of functions' highly increase redundance and produce defects. It represents a copy of functions already described on page RoM Functions [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions#Waypoint_File_Functions].&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=User:Pumbatoo&amp;diff=973</id>
		<title>User:Pumbatoo</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=User:Pumbatoo&amp;diff=973"/>
				<updated>2011-08-08T13:58:11Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: Created page with '== RoM bot Wiki Stuff == * Waypoint files - All you need to know about waypoint files'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RoM bot Wiki Stuff ==&lt;br /&gt;
* [[RoM Waypoint files|Waypoint files]] - All you need to know about waypoint files&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=972</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=972"/>
				<updated>2011-08-08T13:53:05Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* Waypoint File Functions */ Added __WPL:getFileName() description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Functions ==&lt;br /&gt;
      loadPaths( [path] [,returnpath] );&lt;br /&gt;
Load a new waypoint file and if available the default return path to that file. e.g. 'loadPaths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 changeProfileOption(_option, _value);&lt;br /&gt;
change profile options and print values in MM protocol&lt;br /&gt;
&lt;br /&gt;
 changeProfileSkill(_skill, _option, _value)&lt;br /&gt;
Change a profile skill option and print a message in the micromacro window. Especially useful for skill options that don't normally change and can't be changed in the skills section of the profile eg. CastTime or Cooldown.&lt;br /&gt;
&lt;br /&gt;
 levelupSkill(_skillname [, _times] )&lt;br /&gt;
&lt;br /&gt;
Levelup a Single Skill by Name. For the skillname look into the file /database/skills.xml. You can use that function only for skill, which have maintent the skilltab and skillnum values within the skills.xml entry. If the don't have that values, please look yourself for them and use the manual way. &lt;br /&gt;
&lt;br /&gt;
 levelupSkills1To10( [&amp;quot;loadonly&amp;quot;] );&lt;br /&gt;
&lt;br /&gt;
That function will levelup a internal given selection of useful skills on your way from 1-10. The selection of the skills is hard coded within functions.lua. That function will also load the skill into your profile skill list and use that skill via the MACRO function. If you restart the bot and want also want to use that skills and don't want to enter them manual into the profile skill list, then just use that function with the parameter 'loadonly' within the onLoad event: &lt;br /&gt;
&lt;br /&gt;
 openGiftbags1To10( [[_player_level] , _maxslot] );&lt;br /&gt;
open the level 1-10 giftbags and equipt the items.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 addMessage( message );&lt;br /&gt;
Send a message to the ingame system chat channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;RoMScript( _script );&lt;br /&gt;
&lt;br /&gt;
 example:&lt;br /&gt;
 local ret1, ret2 = RoMScript( &amp;quot;GetPlayerWorldMapPos();&amp;quot; );&amp;lt;/source&amp;gt;&lt;br /&gt;
Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return       values possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro( _script );&lt;br /&gt;
Same as &amp;quot;RoMScript. Additionally you will see a message in the MM window.&lt;br /&gt;
&lt;br /&gt;
 getQuestStatus( _questname )&lt;br /&gt;
This will return the status of the quest. It will return 'complete' if the quest is completed and ready to be turned in, 'incomplete' if you have accepted the quest but haven't completed it yet and 'not accepted' if you have not accepted the quest. The use of this function requires that the ingamefunctions folder be installed in the games addon folder.&lt;br /&gt;
&lt;br /&gt;
 waitForLoadingScreen( [_maxWaitTime] )&lt;br /&gt;
Waits for the loading screen to appear then disappear. Used after starting a teleport, entering your house, loading a new character, etc. Basically after any action that would cause the loading screen to appear. Replaces the need to add an overly large yrest(nnnnn). If the optional argument _maxWaitTime is specified and that many seconds has passed without the loading screen appearing, then it will stop waiting and return 'false', else it will return 'true'.&lt;br /&gt;
&lt;br /&gt;
 distance(x1, z1, y1, x2, z2, y2)&lt;br /&gt;
 distance(x1, z1, x2, z2)&lt;br /&gt;
Returns the distance between 2 points. Both forms of the command will work. If all 6 arguments are used then it will do a 3 dimensional calculation ie. will take into account the height of the points otherwise it will do a 2 dimensional calculation.&lt;br /&gt;
&lt;br /&gt;
== Event Monitor Functions ==&lt;br /&gt;
      EventMonitorStart(monitorName, event [,filter])&lt;br /&gt;
Tells the in-game-function's addon to start monitoring event &amp;quot;event&amp;quot; and saving them to a log under the name of &amp;quot;monitorName&amp;quot;. &amp;quot;monitorName&amp;quot; is just a name to identify the event monitor. If a filter is included then only events that pass the filter will be saved.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      EventMonitorStart(&amp;quot;LeaderChat&amp;quot;, &amp;quot;CHAT_MSG_PARTY&amp;quot;,&amp;quot;,,,MyLeaderName&amp;quot;)&lt;br /&gt;
This will monitor party chat and save any events that have the word &amp;quot;MyLeaderName&amp;quot; in the 4th argument which happens to be the chat senders name. &lt;br /&gt;
&lt;br /&gt;
      EventMonitorStop(monitorName)&lt;br /&gt;
This will stop monitoring events for &amp;quot;monitorName&amp;quot; and remove any log entries under that name.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorPause(monitorName)&lt;br /&gt;
This will pause the event monitor. It will not save any events under that name while paused. You can still retrieve the log entries saved under that name while it is paused.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorResume(monitorName)&lt;br /&gt;
This will resume a paused monitor and start saving events again under that name.&lt;br /&gt;
&lt;br /&gt;
      local time, moreToCome, arg1, arg2, arg3, arg4, arg5, arg6 = EventMonitorCheck(monitorName[, returnFilter][, lastEntryOnly])&lt;br /&gt;
Use this to return data of an event saved under the name of &amp;quot;monitorName&amp;quot;. This function only returns data of 1 event at a time. By default it returns the first log entry under this name and then deletes it from the log. You can use the returnFilter to only return the event arguments you are interested in. If you only want the latest event and are not interested in older events then you can set lastEntryOnly = true. Then only the last entry in the log under that name will be returned and all other entries will be erased.&lt;br /&gt;
&lt;br /&gt;
The returned values are:&lt;br /&gt;
&lt;br /&gt;
'''time''' - The time the event occurred. I used os.time() to get this value but rombots version of this command returns a different value so I'm not sure how you can use this but I thought it needed to be included. Maybe it can be changed to a better format in the future.&lt;br /&gt;
&lt;br /&gt;
'''moreToCome''' - Is 'true' if there are more log entries under that name and 'false' if not. This would be useful to iterate though all the messages to collect them all.&lt;br /&gt;
&lt;br /&gt;
'''arg1, arg2, ... argn''' - These are the arguments returned by the event. If no returnFilter was specified then all arguments will be returned. If the returnFilter was used then only the requested arguments will be returned in the order requested.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      local time, moreToCome, name, msg = EventMonitorCheck(&amp;quot;LeaderChat&amp;quot;, &amp;quot;4,1&amp;quot;)&lt;br /&gt;
This will return the next &amp;quot;LeaderChat&amp;quot; log entry. Note that I only want the 4th and 1st argument. The 4th argument is the sender and will be stored in the 'name' variable and the 1st argument is the message and will be stored in the 'msg' variable.&lt;br /&gt;
&lt;br /&gt;
== Player Functions ==&lt;br /&gt;
      player:harvest([id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harvest node and harvest that ie. wood, herbs and ore. For backward compatibility you can use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id but you should use player:target_Object() instead as it has more options related to opening objects.&lt;br /&gt;
Note: 'player:harvest(&amp;quot;test&amp;quot;)' is no longer supported, use 'rom/getid.lua' instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:restrnd([probability [, minrest [, maxrest]]]);&lt;br /&gt;
e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player:sleep()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:rest( minrest [, maxrest[, time|full[, restaddrnd]]]);&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&lt;br /&gt;
Code:&lt;br /&gt;
      &amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
      examples:&lt;br /&gt;
      player:rest(20) will rest for 20 seconds.&lt;br /&gt;
      player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
      player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
      player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
      player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:sleep();&lt;br /&gt;
Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:logout([true]);&lt;br /&gt;
Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:mouseclickL(x, y [RoM window wide, RoM window high]);&lt;br /&gt;
Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
      player:cast(&amp;quot;skill&amp;quot;|skill);&lt;br /&gt;
This function accepts either a skill name (ie. &amp;quot;MAGE_FIREBALL&amp;quot;) or a skill object (ie. settings.profile.skills[&amp;quot;MAGE_FIREBALL&amp;quot;]). If the parameter is a string, it must be listed in the players' profile.&lt;br /&gt;
&lt;br /&gt;
      player:checkSkills(_only_friendly);&lt;br /&gt;
This will check all skills that the player has loaded in his profile for those that are appropriate to use. _only_friendly should be either true or false. If true, it will only use helpful skills, such as healing, even while in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:checkPotions();&lt;br /&gt;
This is similar to player:checkSkills(). It will check if the player needs to use any potions and use them accordingly. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:hasBuff(_buffname);&lt;br /&gt;
This will return true if your player has the buff, false if not. Run player:updatebuffs() first if you need to be sure your buff list is up-to date. &lt;br /&gt;
Can also be used to check buffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasBuff(&amp;quot;buffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:hasDebuff(_debuffname);&lt;br /&gt;
This will return true if your player has the debuff, false if not. Run player:updatebuffs() first if you need to be sure your debuff list is up-to date. &lt;br /&gt;
Can also be used to check debuffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasDebuff(&amp;quot;debuffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:fight();&lt;br /&gt;
If the player has an enemy target, it will engage that target in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:loot();&lt;br /&gt;
If the player has a dead enemy target, it will attempt to loot the corpse. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:lootAll();&lt;br /&gt;
Will attempt to loot all nearby lootable bodies. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      success, reason = player:moveTo(waypoint, ignoreCycleTargets);&lt;br /&gt;
This will attempt to move the player to the given waypoint. If ignoreCycleTarget is true, it will not attempt to target and engage nearby enemies while on the move. 'waypoint' may also be a unit (such as player.Target - to move to the player's target). If you have raw coordinates, such as 100,200 that you want to move to, use CWaypoint(100,200) for your 'waypoint'.&lt;br /&gt;
&lt;br /&gt;
This function will return whether or not it was successful and, if unsuccessful, the reason. 'success' will either be true or false, and 'reason' will be WF_TARGET(we abandoned movement because we've got a target), WF_COMBAT(we abandoned movement because we entered combat [typically; pulled an aggressive monster]), WF_DIST(for some reason or other, we actually started moving away from the waypoint [slid down a hill?]), or WF_STUCK(got stuck on something in the terrain).&lt;br /&gt;
&lt;br /&gt;
      player:waitForAggro();&lt;br /&gt;
This function causes the player to stop and wait for a maximum of 5 seconds for aggressive enemies to engage in combat with the player. This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:faceDirection(angle);&lt;br /&gt;
This will rotate the character to face the specified direction in ''radians''('''not''' degrees!). This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:turnDirection(angle);&lt;br /&gt;
This will rotate the character some amount rather than face a specific direction. If 'angle' is negative, the character will rotate 'left', and if 'angle' is positive, then the character will rotate 'right'. 'angle' should be specified in radians.&lt;br /&gt;
&lt;br /&gt;
      player:unstick();&lt;br /&gt;
Attempts to get the player out of being stuck on something. This is generally not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:haveTarget();&lt;br /&gt;
Returns true if the player has a valid, attackable target.&lt;br /&gt;
&lt;br /&gt;
      player:update();&lt;br /&gt;
This causes the player to update all information (hp/mp/etc. from the game client). This should be used after causing the player to enter their home, teleport, log out and back in, etc.&lt;br /&gt;
&lt;br /&gt;
      player:clearTarget();&lt;br /&gt;
Causes the player to drop their current target.&lt;br /&gt;
&lt;br /&gt;
      player:isFriend(pawn);&lt;br /&gt;
Returns true if the given pawn (such as player.Pet or player.Target) are on the player's friend list inside their profile.&lt;br /&gt;
&lt;br /&gt;
      player:isInMobs(pawn);&lt;br /&gt;
Exactly like player:isFriend(), only it checks if the pawn is in the 'mobs' section of their profile.&lt;br /&gt;
&lt;br /&gt;
      player:logout(fc_shutdown);&lt;br /&gt;
Causes the player to attempt to log out of the game and, optionally, shut down their computer (if available). If fc_shutdown is true, it will attempt to shut down your computer after logging off.&lt;br /&gt;
&lt;br /&gt;
      player:findTarget();&lt;br /&gt;
Attempts to locate a nearby target, returning true if it does, otherwise false.&lt;br /&gt;
&lt;br /&gt;
      player:merchant(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. It will then buy, sell and repair based on the characters profile settings. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:openStore(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. You can then issue your own buy and/or sell commands. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:target_NPC(_npcname);&lt;br /&gt;
This will attempt to target a nearby NPC with the name given by '_npcname' but not interact with them.&lt;br /&gt;
&lt;br /&gt;
      player:target_Object(_objname, _waittime, _harvestall, _donotignore, _evalFunc);&lt;br /&gt;
This will target an object similarly to target_NPC but this function has more options to cater for the different behaviors of different objects.&lt;br /&gt;
&lt;br /&gt;
_objname = name or id of object to target. Accepts partial names or a table of names and ids.(Required)&lt;br /&gt;
&lt;br /&gt;
_waittime = time to wait if the object takes time to action, in ms. By default will wait until casting bar is gone. Only really necessary if you want it to wait longer than it takes to collect.(Optional)&lt;br /&gt;
&lt;br /&gt;
_harvestall = true if you wish to collect all in the immediate area. Only use if the object disappears once collected. (Default is false ie. opens/collects only once)&lt;br /&gt;
&lt;br /&gt;
_donotignore = If false, will target an object once then move onto the next object. If true, will continue to target object until it disappears or moves away. Only set to true if the target disappears or moves away or you might end up in an infinite loop.(if _harvestall = true then the default is false, else it is true).&lt;br /&gt;
&lt;br /&gt;
_evalFunc = A user created custom function that can be used to evaluate whether objects are valid or not. Should except an address as an argument and return true or false. (Optional)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Mailbox&amp;quot;)''' -- Targets 'Mailbox' with no wait time afterward.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, 8000)''' -- Encourage hen to lay then wait 8 seconds even though the cast bar only appears for a couple of seconds. Done only once.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, nil, true, true)''' -- Feed all nearby hens, waiting until the cast bar ends. And do not ignore the current hen when searching for the next closest.&lt;br /&gt;
&lt;br /&gt;
The example below targets all hens in the coop by checking their Z coordinate, with no ignoring.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;-- The evaluate function&lt;br /&gt;
function henInCoop (address)&lt;br /&gt;
  if CObject(address).Z &amp;gt; 3240 then&lt;br /&gt;
    return true&lt;br /&gt;
  else&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- The target hen command&lt;br /&gt;
player:target_Object(&amp;quot;Ranch Hen&amp;quot;, nil, true, true, henInCoop);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:findNearestNameOrId(_objnameorid, _evalFunc)&lt;br /&gt;
Finds the nearest object without targeting it. Accepts the items name or id as argument or a table of items and ids to search for. Returns the closest objects table or nil if not found. For a description on how to use _evalFunc, please read the description for player:target_Object() above.&lt;br /&gt;
&lt;br /&gt;
      player:mount();&lt;br /&gt;
Finds the first ''permanent'' mount in your ''known inventory'' (typically slots 1-60; item shop bag not checked) and, if found, mounts it. You may also check if player.Mounted is true or false if you want to know whether the player is mounted or not. Will respond to aggro if mounting is interrupted but will still mount once aggro is dealt with.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
Get the total quantity of an item in your inventory. You can use the item-id or the name of the item. As a second argument you can specify where to look. Accepted values for ''range'' are; 'all', 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. By default it searches just the 'bags'.&lt;br /&gt;
 &lt;br /&gt;
example:&lt;br /&gt;
 if( inventory:itemTotalCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemNameOrId, range)&lt;br /&gt;
This function is obsolete. It is kept for backward compatibility. It is functionally the same as using inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
&lt;br /&gt;
 inventory:findItem(itemNameOrId, range)&lt;br /&gt;
Finds the first item in your inventory by name or id and returns the item object. If it is a stackable item it will return the smallest stack of that item. As a second argument you can specify where to look. Please consult the 'inventory:itemTotalCount' entry for excepted values for 'range'. By default it will search 'all' the inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Finds an item in the inventory by name or id then uses it.&lt;br /&gt;
&lt;br /&gt;
 inventory:getMainHandDurability()&lt;br /&gt;
Returns the durability of the main-hand weapon as a percent value from 1 to 100.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. &lt;br /&gt;
&lt;br /&gt;
 inventory:storeBuyItem(nameIdOrIndex, quantity)&lt;br /&gt;
Buys 'quantity' of items from a store by name, id or store index. Assumes store is already open. If 'quantity' is not specified then it will buy 1 by default.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 inventory:storeBuyItem(&amp;quot;Gold-wrapped Belt&amp;quot;) -- Buy by item name&lt;br /&gt;
 inventory:storeBuyItem(221544, 1) -- Buy by item id&lt;br /&gt;
 inventory:storeBuyItem(3, 1) -- Buy by store index&lt;br /&gt;
All of these examples will do the same thing, buy 1 'Gold-wrapped Belt'.&lt;br /&gt;
&lt;br /&gt;
 item:moveTo(bag)&lt;br /&gt;
Moves the item to the specified bag. Accepted values for ''bag'' are; 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. If possible it will try to merge stackable items. This is particularly useful for moving itemshop items to the itemshop bag.&lt;br /&gt;
&lt;br /&gt;
== Waypoint File Functions ==&lt;br /&gt;
&lt;br /&gt;
 __WPL:reverse();&lt;br /&gt;
Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&lt;br /&gt;
Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them.&lt;br /&gt;
Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setWaypointIndex( number);&lt;br /&gt;
Set the waypoint # 'number' as next waypoint to reach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:getNearestWaypoint(player.X, player.Z);&lt;br /&gt;
Get back the number of the closest waypoint.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&lt;br /&gt;
Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:getFileName();&amp;lt;/source&amp;gt;Returns the name of the waypoint file as string (e.g. &amp;quot;l1t_start.xml&amp;quot;). The string will not contain any information about the path of the file.&lt;br /&gt;
&lt;br /&gt;
== RoM API Functions ==&lt;br /&gt;
With the function sendMacro() or RoMScript() we can submit macros to the RoM API. For a complete list of RoM API functions, go to http://theromwiki.com/index.php/List_of_Functions&lt;br /&gt;
&lt;br /&gt;
Here are some important API functions you can use:&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Levelup a skill. First number is the tab (1=general, 2=general class skills, 4=only primary class skills). Second number is the number of the skill at the tab. You can test the numbers by entering following macro ingame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;/script _SkillName=GetSkillDetail(4,3); SendSystemChat(_SkillName);&amp;lt;/source&amp;gt;That will print you the name of the given skill into the ingame system chat.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 /script SendSystemChat(tonumber(string.sub(GetBagItemLink(GetBagItemInfo(1)), 8, 12), 16));&lt;br /&gt;
Print the itemid of slot-nr 1 into the system chat. Change the slot number to the item you want to get informations about or move that item to slot #1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;GetBagItemCount(&amp;quot;..itemid..&amp;quot;)&amp;quot;)&lt;br /&gt;
Get back the quantity of an givem item ID in your bags.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 occupiedSlots, totalSlots = sendMacro(&amp;quot;GetBagCount();&amp;quot;);&lt;br /&gt;
Get back the number of total slots in your bag and the number of the occupied slot in your bag.&lt;br /&gt;
&lt;br /&gt;
== User Functions ==&lt;br /&gt;
Since version r413 users are able to use a userfunctions.lua file in the Rombot root directory to hold all of their own custom functions.&lt;br /&gt;
&lt;br /&gt;
If you find that you repeat a particular set of code in your waypoint files, you can create your own function with that code in the userfunctions.lua file and use it anywhere with a simple call to that function.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;------------------------------------------------&lt;br /&gt;
-- CancelBuff Script&lt;br /&gt;
-- buffname = name of buff as appears in player buffs&lt;br /&gt;
-- returns 'true' if buff was removed or 'false' if did not have buff.&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
function CancelBuff(buffname)&lt;br /&gt;
    if buffname == nil then&lt;br /&gt;
        cprintf(cli.yellow,&amp;quot;No buff specified. Please use 'CancelBuff(buffname)'.\n&amp;quot;)&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    local buffnum=1&lt;br /&gt;
    local buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    while buff ~= nil do&lt;br /&gt;
        if buff == buffname then&lt;br /&gt;
            sendMacro(&amp;quot;CancelPlayerBuff(&amp;quot;..buffnum..&amp;quot;);&amp;quot;)&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        buffnum=buffnum+1&lt;br /&gt;
        buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&amp;lt;/source&amp;gt;&lt;br /&gt;
With this function in my userfunctions.lua file I can cancel a buff with a 1 line command. For example, every time I want to dismount my Brown Horse I use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;CancelBuff(&amp;quot;Brown Horse&amp;quot;)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use, simply create a text file in the rombot root directory named userfunctions.lua and place your functions within it.&lt;br /&gt;
&lt;br /&gt;
Some user created custom functions can be found here: [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1125 New Feature: Userfunctions.lua]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=971</id>
		<title>RoM Working with waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=971"/>
				<updated>2011-08-08T13:40:09Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* List of functions */ Added __WPL:getFileName() description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here some examples how to work with waypoint files. It shows examples for different types of waypoint files and some special solutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LUA code within a waypoint file ==&lt;br /&gt;
You can use you own lua code within the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything. And there are some prefabricated functions:&lt;br /&gt;
&lt;br /&gt;
To use some of that functions, simply put them into the waypoint tag:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!-- #20 --&amp;gt;&amp;lt;waypoint x=&amp;quot;799&amp;quot; z=&amp;quot;-426&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Caution!!! You must place the codes within the '&amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt;' tag. Not before and not after.'''&lt;br /&gt;
&lt;br /&gt;
'''This is wrong:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;player:harvest();&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2060&amp;quot; z=&amp;quot;-8216&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:harvest();&amp;lt;/source&amp;gt;Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;load_paths( [path] [,returnpath] );&amp;lt;/source&amp;gt;Load a new waypoint file and if available the default return path to that file. e.g. 'load_paths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( player.Level &amp;gt; 9 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something only if you have a given level. Can be usefull to load a new waypoint file only after you get that level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:reverse();&amp;lt;/source&amp;gt;Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&amp;lt;/source&amp;gt;Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them. Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&amp;lt;/source&amp;gt;Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:restrnd([probability [, minrest [, maxrest]]]);&amp;lt;/source&amp;gt;e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:rest( minrest [, maxrest[, time|full[, restaddrnd]]])&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
_resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
_restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
player:rest(20) will rest for 20 seconds.&lt;br /&gt;
player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;stopPE();&amp;lt;/source&amp;gt;Pause the bot at that waypoint. The bot will not react anymore. Press DEL if you want to resume the bot. Similar functions are 'player.restrnd()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:sleep();&amp;lt;/source&amp;gt;Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:logout([true])&amp;lt;/source&amp;gt;Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( os.difftime(os.time(), player.BotStartTime) &amp;gt; 3600 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:target_NPC( [npc_name] );&amp;lt;/source&amp;gt;It will try to target the NPC 'npc_name' and open the dialog window. If it is a merchant and you have a ingame autorepair addon (e.g. [http://rom.curse.com/downloads/rom-addons/details/streamline.aspx Streamline]), it will autorepair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:mouseclickL(x, y [RoM window wide, RoM window high]);&amp;lt;/source&amp;gt;Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:getFileName();&amp;lt;/source&amp;gt;Returns the name of the waypoint file as string (e.g. &amp;quot;l1t_start.xml&amp;quot;). The string will not contain any information about the path of the file.&lt;br /&gt;
&lt;br /&gt;
== How to use the bot for running between the and NPC &amp;lt;-&amp;gt; blackboard  for delivering of daily quests ==&lt;br /&gt;
It starts in Harf. There you have the quest 'Winterspinnenarten' from the blackboard where you deliver 10 winter spider body liquids to the 'Lager im Winternachttal'.&lt;br /&gt;
&lt;br /&gt;
The waypoints are from the blackbard in Harf up to the camp. After each end of the waypoint file is a PAUSE. So you can handle with the NPC/blackboard and after that press 'DEL' to reverse the waypoints and run back.&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;RUN&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14389&amp;quot; z=&amp;quot;-380&amp;quot; type=&amp;quot;TRAVEL&amp;quot;&amp;gt;__WPL:setDirection( WPT_FORWARD );&lt;br /&gt;
	player:sleep();&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14531&amp;quot; z=&amp;quot;-253&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- #21 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-18500&amp;quot; z=&amp;quot;-2516 type=&amp;quot;TRAVEL&amp;quot; &amp;gt;__WPL:setDirection( WPT_BACKWARD );&lt;br /&gt;
	player:sleep();&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
The type of the waypoints is 'RUN' so the bot will not stop and not fight back, if getting aggro. Only the first an the last WP has type TRAVEL to fight back still sticking mobs.&lt;br /&gt;
&lt;br /&gt;
Some hints: If you deliver the quest with a low level char, than set your loot option (&amp;lt;option name=&amp;quot;LOOT&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;) in your profile to 'false'. That will prevent from coming closer to mob groups while looting. It also could be helpful, to reduce your option 'WAYPOINT_DEVIATION' or set it to 0 (and set back to a higher value for normal botting).&lt;br /&gt;
&lt;br /&gt;
== Automatic leveling with the Bot ==&lt;br /&gt;
Thats an example how to start with level 1 and change the botting place depending from your level.&lt;br /&gt;
&lt;br /&gt;
We start at the spawn point:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3779&amp;quot; z=&amp;quot;-8480&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 8 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3034&amp;quot; z=&amp;quot;-9034&amp;quot;&amp;gt;load_paths(&amp;quot;l2-3.xml&amp;quot;);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;At the last waypoint, we load the waypoint path file 'l2-3.xml' and if available the default returnpath 'l2-3_return.xml&amp;quot; and go to the closest waypoint from that waypoint file. We use waypoint type TRAVEL to not targeting mobs while moving to our area (not really neccessary here :-)  )&lt;br /&gt;
&lt;br /&gt;
Now we are at that place:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2206&amp;quot; z=&amp;quot;-9648&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2133&amp;quot; z=&amp;quot;-9796&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2224&amp;quot; z=&amp;quot;-9882&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 7 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
		if( player.Level &amp;gt; 4 ) then&lt;br /&gt;
			load_paths(&amp;quot;l5_goto_6.xml&amp;quot;);&lt;br /&gt;
	  	end;&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If we reach level 5, we load the next waypoint file. Read here for more Informations about [http://www.solarstrike.net/wiki/index.php5?title=RoM_Leveling automatic leveling]&lt;br /&gt;
&lt;br /&gt;
Read here for further informations [http://www.solarstrike.net/wiki/index.php5?title=RoM_Auto_repair about autorepair].&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=970</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=970"/>
				<updated>2011-08-08T08:43:38Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* Player Functions */ using &amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt; for code highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Functions ==&lt;br /&gt;
      loadPaths( [path] [,returnpath] );&lt;br /&gt;
Load a new waypoint file and if available the default return path to that file. e.g. 'loadPaths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 changeProfileOption(_option, _value);&lt;br /&gt;
change profile options and print values in MM protocol&lt;br /&gt;
&lt;br /&gt;
 changeProfileSkill(_skill, _option, _value)&lt;br /&gt;
Change a profile skill option and print a message in the micromacro window. Especially useful for skill options that don't normally change and can't be changed in the skills section of the profile eg. CastTime or Cooldown.&lt;br /&gt;
&lt;br /&gt;
 levelupSkill(_skillname [, _times] )&lt;br /&gt;
&lt;br /&gt;
Levelup a Single Skill by Name. For the skillname look into the file /database/skills.xml. You can use that function only for skill, which have maintent the skilltab and skillnum values within the skills.xml entry. If the don't have that values, please look yourself for them and use the manual way. &lt;br /&gt;
&lt;br /&gt;
 levelupSkills1To10( [&amp;quot;loadonly&amp;quot;] );&lt;br /&gt;
&lt;br /&gt;
That function will levelup a internal given selection of useful skills on your way from 1-10. The selection of the skills is hard coded within functions.lua. That function will also load the skill into your profile skill list and use that skill via the MACRO function. If you restart the bot and want also want to use that skills and don't want to enter them manual into the profile skill list, then just use that function with the parameter 'loadonly' within the onLoad event: &lt;br /&gt;
&lt;br /&gt;
 openGiftbags1To10( [[_player_level] , _maxslot] );&lt;br /&gt;
open the level 1-10 giftbags and equipt the items.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 addMessage( message );&lt;br /&gt;
Send a message to the ingame system chat channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;RoMScript( _script );&lt;br /&gt;
&lt;br /&gt;
 example:&lt;br /&gt;
 local ret1, ret2 = RoMScript( &amp;quot;GetPlayerWorldMapPos();&amp;quot; );&amp;lt;/source&amp;gt;&lt;br /&gt;
Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return       values possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro( _script );&lt;br /&gt;
Same as &amp;quot;RoMScript. Additionally you will see a message in the MM window.&lt;br /&gt;
&lt;br /&gt;
 getQuestStatus( _questname )&lt;br /&gt;
This will return the status of the quest. It will return 'complete' if the quest is completed and ready to be turned in, 'incomplete' if you have accepted the quest but haven't completed it yet and 'not accepted' if you have not accepted the quest. The use of this function requires that the ingamefunctions folder be installed in the games addon folder.&lt;br /&gt;
&lt;br /&gt;
 waitForLoadingScreen( [_maxWaitTime] )&lt;br /&gt;
Waits for the loading screen to appear then disappear. Used after starting a teleport, entering your house, loading a new character, etc. Basically after any action that would cause the loading screen to appear. Replaces the need to add an overly large yrest(nnnnn). If the optional argument _maxWaitTime is specified and that many seconds has passed without the loading screen appearing, then it will stop waiting and return 'false', else it will return 'true'.&lt;br /&gt;
&lt;br /&gt;
 distance(x1, z1, y1, x2, z2, y2)&lt;br /&gt;
 distance(x1, z1, x2, z2)&lt;br /&gt;
Returns the distance between 2 points. Both forms of the command will work. If all 6 arguments are used then it will do a 3 dimensional calculation ie. will take into account the height of the points otherwise it will do a 2 dimensional calculation.&lt;br /&gt;
&lt;br /&gt;
== Event Monitor Functions ==&lt;br /&gt;
      EventMonitorStart(monitorName, event [,filter])&lt;br /&gt;
Tells the in-game-function's addon to start monitoring event &amp;quot;event&amp;quot; and saving them to a log under the name of &amp;quot;monitorName&amp;quot;. &amp;quot;monitorName&amp;quot; is just a name to identify the event monitor. If a filter is included then only events that pass the filter will be saved.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      EventMonitorStart(&amp;quot;LeaderChat&amp;quot;, &amp;quot;CHAT_MSG_PARTY&amp;quot;,&amp;quot;,,,MyLeaderName&amp;quot;)&lt;br /&gt;
This will monitor party chat and save any events that have the word &amp;quot;MyLeaderName&amp;quot; in the 4th argument which happens to be the chat senders name. &lt;br /&gt;
&lt;br /&gt;
      EventMonitorStop(monitorName)&lt;br /&gt;
This will stop monitoring events for &amp;quot;monitorName&amp;quot; and remove any log entries under that name.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorPause(monitorName)&lt;br /&gt;
This will pause the event monitor. It will not save any events under that name while paused. You can still retrieve the log entries saved under that name while it is paused.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorResume(monitorName)&lt;br /&gt;
This will resume a paused monitor and start saving events again under that name.&lt;br /&gt;
&lt;br /&gt;
      local time, moreToCome, arg1, arg2, arg3, arg4, arg5, arg6 = EventMonitorCheck(monitorName[, returnFilter][, lastEntryOnly])&lt;br /&gt;
Use this to return data of an event saved under the name of &amp;quot;monitorName&amp;quot;. This function only returns data of 1 event at a time. By default it returns the first log entry under this name and then deletes it from the log. You can use the returnFilter to only return the event arguments you are interested in. If you only want the latest event and are not interested in older events then you can set lastEntryOnly = true. Then only the last entry in the log under that name will be returned and all other entries will be erased.&lt;br /&gt;
&lt;br /&gt;
The returned values are:&lt;br /&gt;
&lt;br /&gt;
'''time''' - The time the event occurred. I used os.time() to get this value but rombots version of this command returns a different value so I'm not sure how you can use this but I thought it needed to be included. Maybe it can be changed to a better format in the future.&lt;br /&gt;
&lt;br /&gt;
'''moreToCome''' - Is 'true' if there are more log entries under that name and 'false' if not. This would be useful to iterate though all the messages to collect them all.&lt;br /&gt;
&lt;br /&gt;
'''arg1, arg2, ... argn''' - These are the arguments returned by the event. If no returnFilter was specified then all arguments will be returned. If the returnFilter was used then only the requested arguments will be returned in the order requested.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      local time, moreToCome, name, msg = EventMonitorCheck(&amp;quot;LeaderChat&amp;quot;, &amp;quot;4,1&amp;quot;)&lt;br /&gt;
This will return the next &amp;quot;LeaderChat&amp;quot; log entry. Note that I only want the 4th and 1st argument. The 4th argument is the sender and will be stored in the 'name' variable and the 1st argument is the message and will be stored in the 'msg' variable.&lt;br /&gt;
&lt;br /&gt;
== Player Functions ==&lt;br /&gt;
      player:harvest([id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harvest node and harvest that ie. wood, herbs and ore. For backward compatibility you can use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id but you should use player:target_Object() instead as it has more options related to opening objects.&lt;br /&gt;
Note: 'player:harvest(&amp;quot;test&amp;quot;)' is no longer supported, use 'rom/getid.lua' instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:restrnd([probability [, minrest [, maxrest]]]);&lt;br /&gt;
e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player:sleep()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:rest( minrest [, maxrest[, time|full[, restaddrnd]]]);&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&lt;br /&gt;
Code:&lt;br /&gt;
      &amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
      examples:&lt;br /&gt;
      player:rest(20) will rest for 20 seconds.&lt;br /&gt;
      player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
      player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
      player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
      player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:sleep();&lt;br /&gt;
Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:logout([true]);&lt;br /&gt;
Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:mouseclickL(x, y [RoM window wide, RoM window high]);&lt;br /&gt;
Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
      player:cast(&amp;quot;skill&amp;quot;|skill);&lt;br /&gt;
This function accepts either a skill name (ie. &amp;quot;MAGE_FIREBALL&amp;quot;) or a skill object (ie. settings.profile.skills[&amp;quot;MAGE_FIREBALL&amp;quot;]). If the parameter is a string, it must be listed in the players' profile.&lt;br /&gt;
&lt;br /&gt;
      player:checkSkills(_only_friendly);&lt;br /&gt;
This will check all skills that the player has loaded in his profile for those that are appropriate to use. _only_friendly should be either true or false. If true, it will only use helpful skills, such as healing, even while in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:checkPotions();&lt;br /&gt;
This is similar to player:checkSkills(). It will check if the player needs to use any potions and use them accordingly. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:hasBuff(_buffname);&lt;br /&gt;
This will return true if your player has the buff, false if not. Run player:updatebuffs() first if you need to be sure your buff list is up-to date. &lt;br /&gt;
Can also be used to check buffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasBuff(&amp;quot;buffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:hasDebuff(_debuffname);&lt;br /&gt;
This will return true if your player has the debuff, false if not. Run player:updatebuffs() first if you need to be sure your debuff list is up-to date. &lt;br /&gt;
Can also be used to check debuffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasDebuff(&amp;quot;debuffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:fight();&lt;br /&gt;
If the player has an enemy target, it will engage that target in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:loot();&lt;br /&gt;
If the player has a dead enemy target, it will attempt to loot the corpse. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:lootAll();&lt;br /&gt;
Will attempt to loot all nearby lootable bodies. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      success, reason = player:moveTo(waypoint, ignoreCycleTargets);&lt;br /&gt;
This will attempt to move the player to the given waypoint. If ignoreCycleTarget is true, it will not attempt to target and engage nearby enemies while on the move. 'waypoint' may also be a unit (such as player.Target - to move to the player's target). If you have raw coordinates, such as 100,200 that you want to move to, use CWaypoint(100,200) for your 'waypoint'.&lt;br /&gt;
&lt;br /&gt;
This function will return whether or not it was successful and, if unsuccessful, the reason. 'success' will either be true or false, and 'reason' will be WF_TARGET(we abandoned movement because we've got a target), WF_COMBAT(we abandoned movement because we entered combat [typically; pulled an aggressive monster]), WF_DIST(for some reason or other, we actually started moving away from the waypoint [slid down a hill?]), or WF_STUCK(got stuck on something in the terrain).&lt;br /&gt;
&lt;br /&gt;
      player:waitForAggro();&lt;br /&gt;
This function causes the player to stop and wait for a maximum of 5 seconds for aggressive enemies to engage in combat with the player. This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:faceDirection(angle);&lt;br /&gt;
This will rotate the character to face the specified direction in ''radians''('''not''' degrees!). This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:turnDirection(angle);&lt;br /&gt;
This will rotate the character some amount rather than face a specific direction. If 'angle' is negative, the character will rotate 'left', and if 'angle' is positive, then the character will rotate 'right'. 'angle' should be specified in radians.&lt;br /&gt;
&lt;br /&gt;
      player:unstick();&lt;br /&gt;
Attempts to get the player out of being stuck on something. This is generally not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:haveTarget();&lt;br /&gt;
Returns true if the player has a valid, attackable target.&lt;br /&gt;
&lt;br /&gt;
      player:update();&lt;br /&gt;
This causes the player to update all information (hp/mp/etc. from the game client). This should be used after causing the player to enter their home, teleport, log out and back in, etc.&lt;br /&gt;
&lt;br /&gt;
      player:clearTarget();&lt;br /&gt;
Causes the player to drop their current target.&lt;br /&gt;
&lt;br /&gt;
      player:isFriend(pawn);&lt;br /&gt;
Returns true if the given pawn (such as player.Pet or player.Target) are on the player's friend list inside their profile.&lt;br /&gt;
&lt;br /&gt;
      player:isInMobs(pawn);&lt;br /&gt;
Exactly like player:isFriend(), only it checks if the pawn is in the 'mobs' section of their profile.&lt;br /&gt;
&lt;br /&gt;
      player:logout(fc_shutdown);&lt;br /&gt;
Causes the player to attempt to log out of the game and, optionally, shut down their computer (if available). If fc_shutdown is true, it will attempt to shut down your computer after logging off.&lt;br /&gt;
&lt;br /&gt;
      player:findTarget();&lt;br /&gt;
Attempts to locate a nearby target, returning true if it does, otherwise false.&lt;br /&gt;
&lt;br /&gt;
      player:merchant(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. It will then buy, sell and repair based on the characters profile settings. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:openStore(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. You can then issue your own buy and/or sell commands. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:target_NPC(_npcname);&lt;br /&gt;
This will attempt to target a nearby NPC with the name given by '_npcname' but not interact with them.&lt;br /&gt;
&lt;br /&gt;
      player:target_Object(_objname, _waittime, _harvestall, _donotignore, _evalFunc);&lt;br /&gt;
This will target an object similarly to target_NPC but this function has more options to cater for the different behaviors of different objects.&lt;br /&gt;
&lt;br /&gt;
_objname = name or id of object to target. Accepts partial names or a table of names and ids.(Required)&lt;br /&gt;
&lt;br /&gt;
_waittime = time to wait if the object takes time to action, in ms. By default will wait until casting bar is gone. Only really necessary if you want it to wait longer than it takes to collect.(Optional)&lt;br /&gt;
&lt;br /&gt;
_harvestall = true if you wish to collect all in the immediate area. Only use if the object disappears once collected. (Default is false ie. opens/collects only once)&lt;br /&gt;
&lt;br /&gt;
_donotignore = If false, will target an object once then move onto the next object. If true, will continue to target object until it disappears or moves away. Only set to true if the target disappears or moves away or you might end up in an infinite loop.(if _harvestall = true then the default is false, else it is true).&lt;br /&gt;
&lt;br /&gt;
_evalFunc = A user created custom function that can be used to evaluate whether objects are valid or not. Should except an address as an argument and return true or false. (Optional)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Mailbox&amp;quot;)''' -- Targets 'Mailbox' with no wait time afterward.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, 8000)''' -- Encourage hen to lay then wait 8 seconds even though the cast bar only appears for a couple of seconds. Done only once.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, nil, true, true)''' -- Feed all nearby hens, waiting until the cast bar ends. And do not ignore the current hen when searching for the next closest.&lt;br /&gt;
&lt;br /&gt;
The example below targets all hens in the coop by checking their Z coordinate, with no ignoring.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;-- The evaluate function&lt;br /&gt;
function henInCoop (address)&lt;br /&gt;
  if CObject(address).Z &amp;gt; 3240 then&lt;br /&gt;
    return true&lt;br /&gt;
  else&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- The target hen command&lt;br /&gt;
player:target_Object(&amp;quot;Ranch Hen&amp;quot;, nil, true, true, henInCoop);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:findNearestNameOrId(_objnameorid, _evalFunc)&lt;br /&gt;
Finds the nearest object without targeting it. Accepts the items name or id as argument or a table of items and ids to search for. Returns the closest objects table or nil if not found. For a description on how to use _evalFunc, please read the description for player:target_Object() above.&lt;br /&gt;
&lt;br /&gt;
      player:mount();&lt;br /&gt;
Finds the first ''permanent'' mount in your ''known inventory'' (typically slots 1-60; item shop bag not checked) and, if found, mounts it. You may also check if player.Mounted is true or false if you want to know whether the player is mounted or not. Will respond to aggro if mounting is interrupted but will still mount once aggro is dealt with.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
Get the total quantity of an item in your inventory. You can use the item-id or the name of the item. As a second argument you can specify where to look. Accepted values for ''range'' are; 'all', 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. By default it searches just the 'bags'.&lt;br /&gt;
 &lt;br /&gt;
example:&lt;br /&gt;
 if( inventory:itemTotalCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemNameOrId, range)&lt;br /&gt;
This function is obsolete. It is kept for backward compatibility. It is functionally the same as using inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
&lt;br /&gt;
 inventory:findItem(itemNameOrId, range)&lt;br /&gt;
Finds the first item in your inventory by name or id and returns the item object. If it is a stackable item it will return the smallest stack of that item. As a second argument you can specify where to look. Please consult the 'inventory:itemTotalCount' entry for excepted values for 'range'. By default it will search 'all' the inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Finds an item in the inventory by name or id then uses it.&lt;br /&gt;
&lt;br /&gt;
 inventory:getMainHandDurability()&lt;br /&gt;
Returns the durability of the main-hand weapon as a percent value from 1 to 100.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. &lt;br /&gt;
&lt;br /&gt;
 inventory:storeBuyItem(nameIdOrIndex, quantity)&lt;br /&gt;
Buys 'quantity' of items from a store by name, id or store index. Assumes store is already open. If 'quantity' is not specified then it will buy 1 by default.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 inventory:storeBuyItem(&amp;quot;Gold-wrapped Belt&amp;quot;) -- Buy by item name&lt;br /&gt;
 inventory:storeBuyItem(221544, 1) -- Buy by item id&lt;br /&gt;
 inventory:storeBuyItem(3, 1) -- Buy by store index&lt;br /&gt;
All of these examples will do the same thing, buy 1 'Gold-wrapped Belt'.&lt;br /&gt;
&lt;br /&gt;
 item:moveTo(bag)&lt;br /&gt;
Moves the item to the specified bag. Accepted values for ''bag'' are; 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. If possible it will try to merge stackable items. This is particularly useful for moving itemshop items to the itemshop bag.&lt;br /&gt;
&lt;br /&gt;
== Waypoint File Functions ==&lt;br /&gt;
&lt;br /&gt;
 __WPL:reverse();&lt;br /&gt;
Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&lt;br /&gt;
Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them.&lt;br /&gt;
Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setWaypointIndex( number);&lt;br /&gt;
Set the waypoint # 'number' as next waypoint to reach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:getNearestWaypoint(player.X, player.Z);&lt;br /&gt;
Get back the number of the closest waypoint.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&lt;br /&gt;
Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
== RoM API Functions ==&lt;br /&gt;
With the function sendMacro() or RoMScript() we can submit macros to the RoM API. For a complete list of RoM API functions, go to http://theromwiki.com/index.php/List_of_Functions&lt;br /&gt;
&lt;br /&gt;
Here are some important API functions you can use:&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Levelup a skill. First number is the tab (1=general, 2=general class skills, 4=only primary class skills). Second number is the number of the skill at the tab. You can test the numbers by entering following macro ingame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;/script _SkillName=GetSkillDetail(4,3); SendSystemChat(_SkillName);&amp;lt;/source&amp;gt;That will print you the name of the given skill into the ingame system chat.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 /script SendSystemChat(tonumber(string.sub(GetBagItemLink(GetBagItemInfo(1)), 8, 12), 16));&lt;br /&gt;
Print the itemid of slot-nr 1 into the system chat. Change the slot number to the item you want to get informations about or move that item to slot #1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;GetBagItemCount(&amp;quot;..itemid..&amp;quot;)&amp;quot;)&lt;br /&gt;
Get back the quantity of an givem item ID in your bags.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 occupiedSlots, totalSlots = sendMacro(&amp;quot;GetBagCount();&amp;quot;);&lt;br /&gt;
Get back the number of total slots in your bag and the number of the occupied slot in your bag.&lt;br /&gt;
&lt;br /&gt;
== User Functions ==&lt;br /&gt;
Since version r413 users are able to use a userfunctions.lua file in the Rombot root directory to hold all of their own custom functions.&lt;br /&gt;
&lt;br /&gt;
If you find that you repeat a particular set of code in your waypoint files, you can create your own function with that code in the userfunctions.lua file and use it anywhere with a simple call to that function.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;------------------------------------------------&lt;br /&gt;
-- CancelBuff Script&lt;br /&gt;
-- buffname = name of buff as appears in player buffs&lt;br /&gt;
-- returns 'true' if buff was removed or 'false' if did not have buff.&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
function CancelBuff(buffname)&lt;br /&gt;
    if buffname == nil then&lt;br /&gt;
        cprintf(cli.yellow,&amp;quot;No buff specified. Please use 'CancelBuff(buffname)'.\n&amp;quot;)&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    local buffnum=1&lt;br /&gt;
    local buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    while buff ~= nil do&lt;br /&gt;
        if buff == buffname then&lt;br /&gt;
            sendMacro(&amp;quot;CancelPlayerBuff(&amp;quot;..buffnum..&amp;quot;);&amp;quot;)&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        buffnum=buffnum+1&lt;br /&gt;
        buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&amp;lt;/source&amp;gt;&lt;br /&gt;
With this function in my userfunctions.lua file I can cancel a buff with a 1 line command. For example, every time I want to dismount my Brown Horse I use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;CancelBuff(&amp;quot;Brown Horse&amp;quot;)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use, simply create a text file in the rombot root directory named userfunctions.lua and place your functions within it.&lt;br /&gt;
&lt;br /&gt;
Some user created custom functions can be found here: [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1125 New Feature: Userfunctions.lua]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=969</id>
		<title>RoM Working with waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=969"/>
				<updated>2011-08-08T08:33:08Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* How to use the bot for running between the and NPC  blackboard  for delivering of daily quests */ replaced __WPL:reverse() by __WPL:setDirection(..)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here some examples how to work with waypoint files. It shows examples for different types of waypoint files and some special solutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LUA code within a waypoint file ==&lt;br /&gt;
You can use you own lua code within the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything. And there are some prefabricated functions:&lt;br /&gt;
&lt;br /&gt;
To use some of that functions, simply put them into the waypoint tag:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!-- #20 --&amp;gt;&amp;lt;waypoint x=&amp;quot;799&amp;quot; z=&amp;quot;-426&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Caution!!! You must place the codes within the '&amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt;' tag. Not before and not after.'''&lt;br /&gt;
&lt;br /&gt;
'''This is wrong:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;player:harvest();&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2060&amp;quot; z=&amp;quot;-8216&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:harvest();&amp;lt;/source&amp;gt;Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;load_paths( [path] [,returnpath] );&amp;lt;/source&amp;gt;Load a new waypoint file and if available the default return path to that file. e.g. 'load_paths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( player.Level &amp;gt; 9 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something only if you have a given level. Can be usefull to load a new waypoint file only after you get that level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:reverse();&amp;lt;/source&amp;gt;Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&amp;lt;/source&amp;gt;Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them. Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&amp;lt;/source&amp;gt;Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:restrnd([probability [, minrest [, maxrest]]]);&amp;lt;/source&amp;gt;e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:rest( minrest [, maxrest[, time|full[, restaddrnd]]])&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
_resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
_restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
player:rest(20) will rest for 20 seconds.&lt;br /&gt;
player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;stopPE();&amp;lt;/source&amp;gt;Pause the bot at that waypoint. The bot will not react anymore. Press DEL if you want to resume the bot. Similar functions are 'player.restrnd()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:sleep();&amp;lt;/source&amp;gt;Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:logout([true])&amp;lt;/source&amp;gt;Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( os.difftime(os.time(), player.BotStartTime) &amp;gt; 3600 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:target_NPC( [npc_name] );&amp;lt;/source&amp;gt;It will try to target the NPC 'npc_name' and open the dialog window. If it is a merchant and you have a ingame autorepair addon (e.g. [http://rom.curse.com/downloads/rom-addons/details/streamline.aspx Streamline]), it will autorepair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:mouseclickL(x, y [RoM window wide, RoM window high]);&amp;lt;/source&amp;gt;Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
== How to use the bot for running between the and NPC &amp;lt;-&amp;gt; blackboard  for delivering of daily quests ==&lt;br /&gt;
It starts in Harf. There you have the quest 'Winterspinnenarten' from the blackboard where you deliver 10 winter spider body liquids to the 'Lager im Winternachttal'.&lt;br /&gt;
&lt;br /&gt;
The waypoints are from the blackbard in Harf up to the camp. After each end of the waypoint file is a PAUSE. So you can handle with the NPC/blackboard and after that press 'DEL' to reverse the waypoints and run back.&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;RUN&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14389&amp;quot; z=&amp;quot;-380&amp;quot; type=&amp;quot;TRAVEL&amp;quot;&amp;gt;__WPL:setDirection( WPT_FORWARD );&lt;br /&gt;
	player:sleep();&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14531&amp;quot; z=&amp;quot;-253&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- #21 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-18500&amp;quot; z=&amp;quot;-2516 type=&amp;quot;TRAVEL&amp;quot; &amp;gt;__WPL:setDirection( WPT_BACKWARD );&lt;br /&gt;
	player:sleep();&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
The type of the waypoints is 'RUN' so the bot will not stop and not fight back, if getting aggro. Only the first an the last WP has type TRAVEL to fight back still sticking mobs.&lt;br /&gt;
&lt;br /&gt;
Some hints: If you deliver the quest with a low level char, than set your loot option (&amp;lt;option name=&amp;quot;LOOT&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;) in your profile to 'false'. That will prevent from coming closer to mob groups while looting. It also could be helpful, to reduce your option 'WAYPOINT_DEVIATION' or set it to 0 (and set back to a higher value for normal botting).&lt;br /&gt;
&lt;br /&gt;
== Automatic leveling with the Bot ==&lt;br /&gt;
Thats an example how to start with level 1 and change the botting place depending from your level.&lt;br /&gt;
&lt;br /&gt;
We start at the spawn point:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3779&amp;quot; z=&amp;quot;-8480&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 8 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3034&amp;quot; z=&amp;quot;-9034&amp;quot;&amp;gt;load_paths(&amp;quot;l2-3.xml&amp;quot;);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;At the last waypoint, we load the waypoint path file 'l2-3.xml' and if available the default returnpath 'l2-3_return.xml&amp;quot; and go to the closest waypoint from that waypoint file. We use waypoint type TRAVEL to not targeting mobs while moving to our area (not really neccessary here :-)  )&lt;br /&gt;
&lt;br /&gt;
Now we are at that place:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2206&amp;quot; z=&amp;quot;-9648&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2133&amp;quot; z=&amp;quot;-9796&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2224&amp;quot; z=&amp;quot;-9882&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 7 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
		if( player.Level &amp;gt; 4 ) then&lt;br /&gt;
			load_paths(&amp;quot;l5_goto_6.xml&amp;quot;);&lt;br /&gt;
	  	end;&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If we reach level 5, we load the next waypoint file. Read here for more Informations about [http://www.solarstrike.net/wiki/index.php5?title=RoM_Leveling automatic leveling]&lt;br /&gt;
&lt;br /&gt;
Read here for further informations [http://www.solarstrike.net/wiki/index.php5?title=RoM_Auto_repair about autorepair].&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=968</id>
		<title>RoM Working with waypoint files</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Working_with_waypoint_files&amp;diff=968"/>
				<updated>2011-08-08T08:30:00Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* List of functions */ added function __WPL:setDirection(..)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here some examples how to work with waypoint files. It shows examples for different types of waypoint files and some special solutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LUA code within a waypoint file ==&lt;br /&gt;
You can use you own lua code within the &amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt; tags. By doing that you can do nearly everything. And there are some prefabricated functions:&lt;br /&gt;
&lt;br /&gt;
To use some of that functions, simply put them into the waypoint tag:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!-- #20 --&amp;gt;&amp;lt;waypoint x=&amp;quot;799&amp;quot; z=&amp;quot;-426&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Caution!!! You must place the codes within the '&amp;lt;waypoint&amp;gt;&amp;lt;/waypoint&amp;gt;' tag. Not before and not after.'''&lt;br /&gt;
&lt;br /&gt;
'''This is wrong:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;player:harvest();&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2060&amp;quot; z=&amp;quot;-8216&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:harvest();&amp;lt;/source&amp;gt;Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;load_paths( [path] [,returnpath] );&amp;lt;/source&amp;gt;Load a new waypoint file and if available the default return path to that file. e.g. 'load_paths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( player.Level &amp;gt; 9 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something only if you have a given level. Can be usefull to load a new waypoint file only after you get that level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:reverse();&amp;lt;/source&amp;gt;Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&amp;lt;/source&amp;gt;Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them. Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;__WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&amp;lt;/source&amp;gt;Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:restrnd([probability [, minrest [, maxrest]]]);&amp;lt;/source&amp;gt;e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:rest( minrest [, maxrest[, time|full[, restaddrnd]]])&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
_resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
_restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
player:rest(20) will rest for 20 seconds.&lt;br /&gt;
player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;stopPE();&amp;lt;/source&amp;gt;Pause the bot at that waypoint. The bot will not react anymore. Press DEL if you want to resume the bot. Similar functions are 'player.restrnd()' and 'player.sleep()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:sleep();&amp;lt;/source&amp;gt;Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:logout([true])&amp;lt;/source&amp;gt;Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;if( os.difftime(os.time(), player.BotStartTime) &amp;gt; 3600 ) then&lt;br /&gt;
	printf(&amp;quot;do some other coding stuff&amp;quot;);&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:target_NPC( [npc_name] );&amp;lt;/source&amp;gt;It will try to target the NPC 'npc_name' and open the dialog window. If it is a merchant and you have a ingame autorepair addon (e.g. [http://rom.curse.com/downloads/rom-addons/details/streamline.aspx Streamline]), it will autorepair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:mouseclickL(x, y [RoM window wide, RoM window high]);&amp;lt;/source&amp;gt;Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
== How to use the bot for running between the and NPC &amp;lt;-&amp;gt; blackboard  for delivering of daily quests ==&lt;br /&gt;
It starts in Harf. There you have the quest 'Winterspinnenarten' from the blackboard where you deliver 10 winter spider body liquids to the 'Lager im Winternachttal'.&lt;br /&gt;
&lt;br /&gt;
The waypoints are from the blackbard in Harf up to the camp. After each end of the waypoint file is a PAUSE. So you can handle with the NPC/blackboard and after that press 'DEL' to reverse the waypoints and run back.&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;RUN&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14389&amp;quot; z=&amp;quot;-380&amp;quot; type=&amp;quot;TRAVEL&amp;quot;&amp;gt;__WPL:reverse();&lt;br /&gt;
	player:sleep();&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-14531&amp;quot; z=&amp;quot;-253&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- #21 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-18500&amp;quot; z=&amp;quot;-2516 type=&amp;quot;TRAVEL&amp;quot; &amp;gt;__WPL:reverse();&lt;br /&gt;
	player:sleep();&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
The type of the waypoints is 'RUN' so the bot will not stop and not fight back, if getting aggro. Only the first an the last WP has type TRAVEL to fight back still sticking mobs.&lt;br /&gt;
&lt;br /&gt;
Some hints: If you deliver the quest with a low level char, than set your loot option (&amp;lt;option name=&amp;quot;LOOT&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;) in your profile to 'false'. That will prevent from coming closer to mob groups while looting. It also could be helpful, to reduce your option 'WAYPOINT_DEVIATION' or set it to 0 (and set back to a higher value for normal botting).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Automatic leveling with the Bot ==&lt;br /&gt;
Thats an example how to start with level 1 and change the botting place depending from your level.&lt;br /&gt;
&lt;br /&gt;
We start at the spawn point:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;TRAVEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3779&amp;quot; z=&amp;quot;-8480&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 8 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-3034&amp;quot; z=&amp;quot;-9034&amp;quot;&amp;gt;load_paths(&amp;quot;l2-3.xml&amp;quot;);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&amp;lt;/source&amp;gt;At the last waypoint, we load the waypoint path file 'l2-3.xml' and if available the default returnpath 'l2-3_return.xml&amp;quot; and go to the closest waypoint from that waypoint file. We use waypoint type TRAVEL to not targeting mobs while moving to our area (not really neccessary here :-)  )&lt;br /&gt;
&lt;br /&gt;
Now we are at that place:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints type=&amp;quot;NORMAL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2206&amp;quot; z=&amp;quot;-9648&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2133&amp;quot; z=&amp;quot;-9796&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2224&amp;quot; z=&amp;quot;-9882&amp;quot;&amp;gt;player:restrnd(20, 1, 10);&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;!-- # 7 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-2391&amp;quot; z=&amp;quot;-9639&amp;quot;&amp;gt;&lt;br /&gt;
		if( player.Level &amp;gt; 4 ) then&lt;br /&gt;
			load_paths(&amp;quot;l5_goto_6.xml&amp;quot;);&lt;br /&gt;
	  	end;&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If we reach level 5, we load the next waypoint file. Read here for more Informations about [http://www.solarstrike.net/wiki/index.php5?title=RoM_Leveling automatic leveling]&lt;br /&gt;
&lt;br /&gt;
Read here for further informations [http://www.solarstrike.net/wiki/index.php5?title=RoM_Auto_repair about autorepair].&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=967</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=967"/>
				<updated>2011-08-08T08:16:48Z</updated>
		
		<summary type="html">&lt;p&gt;Pumbatoo: /* Waypoint File Functions */ added function __WPL:setDirection(..)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Functions ==&lt;br /&gt;
      loadPaths( [path] [,returnpath] );&lt;br /&gt;
Load a new waypoint file and if available the default return path to that file. e.g. 'loadPaths(&amp;quot;l7-9&amp;quot;);' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 changeProfileOption(_option, _value);&lt;br /&gt;
change profile options and print values in MM protocol&lt;br /&gt;
&lt;br /&gt;
 changeProfileSkill(_skill, _option, _value)&lt;br /&gt;
Change a profile skill option and print a message in the micromacro window. Especially useful for skill options that don't normally change and can't be changed in the skills section of the profile eg. CastTime or Cooldown.&lt;br /&gt;
&lt;br /&gt;
 levelupSkill(_skillname [, _times] )&lt;br /&gt;
&lt;br /&gt;
Levelup a Single Skill by Name. For the skillname look into the file /database/skills.xml. You can use that function only for skill, which have maintent the skilltab and skillnum values within the skills.xml entry. If the don't have that values, please look yourself for them and use the manual way. &lt;br /&gt;
&lt;br /&gt;
 levelupSkills1To10( [&amp;quot;loadonly&amp;quot;] );&lt;br /&gt;
&lt;br /&gt;
That function will levelup a internal given selection of useful skills on your way from 1-10. The selection of the skills is hard coded within functions.lua. That function will also load the skill into your profile skill list and use that skill via the MACRO function. If you restart the bot and want also want to use that skills and don't want to enter them manual into the profile skill list, then just use that function with the parameter 'loadonly' within the onLoad event: &lt;br /&gt;
&lt;br /&gt;
 openGiftbags1To10( [[_player_level] , _maxslot] );&lt;br /&gt;
open the level 1-10 giftbags and equipt the items.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 addMessage( message );&lt;br /&gt;
Send a message to the ingame system chat channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;RoMScript( _script );&lt;br /&gt;
&lt;br /&gt;
 example:&lt;br /&gt;
 local ret1, ret2 = RoMScript( &amp;quot;GetPlayerWorldMapPos();&amp;quot; );&amp;lt;/source&amp;gt;&lt;br /&gt;
Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return       values possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro( _script );&lt;br /&gt;
Same as &amp;quot;RoMScript. Additionally you will see a message in the MM window.&lt;br /&gt;
&lt;br /&gt;
 getQuestStatus( _questname )&lt;br /&gt;
This will return the status of the quest. It will return 'complete' if the quest is completed and ready to be turned in, 'incomplete' if you have accepted the quest but haven't completed it yet and 'not accepted' if you have not accepted the quest. The use of this function requires that the ingamefunctions folder be installed in the games addon folder.&lt;br /&gt;
&lt;br /&gt;
 waitForLoadingScreen( [_maxWaitTime] )&lt;br /&gt;
Waits for the loading screen to appear then disappear. Used after starting a teleport, entering your house, loading a new character, etc. Basically after any action that would cause the loading screen to appear. Replaces the need to add an overly large yrest(nnnnn). If the optional argument _maxWaitTime is specified and that many seconds has passed without the loading screen appearing, then it will stop waiting and return 'false', else it will return 'true'.&lt;br /&gt;
&lt;br /&gt;
 distance(x1, z1, y1, x2, z2, y2)&lt;br /&gt;
 distance(x1, z1, x2, z2)&lt;br /&gt;
Returns the distance between 2 points. Both forms of the command will work. If all 6 arguments are used then it will do a 3 dimensional calculation ie. will take into account the height of the points otherwise it will do a 2 dimensional calculation.&lt;br /&gt;
&lt;br /&gt;
== Event Monitor Functions ==&lt;br /&gt;
      EventMonitorStart(monitorName, event [,filter])&lt;br /&gt;
Tells the in-game-function's addon to start monitoring event &amp;quot;event&amp;quot; and saving them to a log under the name of &amp;quot;monitorName&amp;quot;. &amp;quot;monitorName&amp;quot; is just a name to identify the event monitor. If a filter is included then only events that pass the filter will be saved.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      EventMonitorStart(&amp;quot;LeaderChat&amp;quot;, &amp;quot;CHAT_MSG_PARTY&amp;quot;,&amp;quot;,,,MyLeaderName&amp;quot;)&lt;br /&gt;
This will monitor party chat and save any events that have the word &amp;quot;MyLeaderName&amp;quot; in the 4th argument which happens to be the chat senders name. &lt;br /&gt;
&lt;br /&gt;
      EventMonitorStop(monitorName)&lt;br /&gt;
This will stop monitoring events for &amp;quot;monitorName&amp;quot; and remove any log entries under that name.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorPause(monitorName)&lt;br /&gt;
This will pause the event monitor. It will not save any events under that name while paused. You can still retrieve the log entries saved under that name while it is paused.&lt;br /&gt;
&lt;br /&gt;
      EventMonitorResume(monitorName)&lt;br /&gt;
This will resume a paused monitor and start saving events again under that name.&lt;br /&gt;
&lt;br /&gt;
      local time, moreToCome, arg1, arg2, arg3, arg4, arg5, arg6 = EventMonitorCheck(monitorName[, returnFilter][, lastEntryOnly])&lt;br /&gt;
Use this to return data of an event saved under the name of &amp;quot;monitorName&amp;quot;. This function only returns data of 1 event at a time. By default it returns the first log entry under this name and then deletes it from the log. You can use the returnFilter to only return the event arguments you are interested in. If you only want the latest event and are not interested in older events then you can set lastEntryOnly = true. Then only the last entry in the log under that name will be returned and all other entries will be erased.&lt;br /&gt;
&lt;br /&gt;
The returned values are:&lt;br /&gt;
&lt;br /&gt;
'''time''' - The time the event occurred. I used os.time() to get this value but rombots version of this command returns a different value so I'm not sure how you can use this but I thought it needed to be included. Maybe it can be changed to a better format in the future.&lt;br /&gt;
&lt;br /&gt;
'''moreToCome''' - Is 'true' if there are more log entries under that name and 'false' if not. This would be useful to iterate though all the messages to collect them all.&lt;br /&gt;
&lt;br /&gt;
'''arg1, arg2, ... argn''' - These are the arguments returned by the event. If no returnFilter was specified then all arguments will be returned. If the returnFilter was used then only the requested arguments will be returned in the order requested.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
      local time, moreToCome, name, msg = EventMonitorCheck(&amp;quot;LeaderChat&amp;quot;, &amp;quot;4,1&amp;quot;)&lt;br /&gt;
This will return the next &amp;quot;LeaderChat&amp;quot; log entry. Note that I only want the 4th and 1st argument. The 4th argument is the sender and will be stored in the 'name' variable and the 1st argument is the message and will be stored in the 'msg' variable.&lt;br /&gt;
&lt;br /&gt;
== Player Functions ==&lt;br /&gt;
      player:harvest([id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harvest node and harvest that ie. wood, herbs and ore. For backward compatibility you can use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id but you should use player:target_Object() instead as it has more options related to opening objects.&lt;br /&gt;
Note: 'player:harvest(&amp;quot;test&amp;quot;)' is no longer supported, use 'rom/getid.lua' instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:restrnd([probability [, minrest [, maxrest]]]);&lt;br /&gt;
e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player:sleep()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:rest( minrest [, maxrest[, time|full[, restaddrnd]]]);&lt;br /&gt;
&lt;br /&gt;
minrest ( min time to rest in sec)&lt;br /&gt;
maxrest ( max time to in sec)&lt;br /&gt;
resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time&lt;br /&gt;
restaddrnd ( max random addition after being full in sec)&lt;br /&gt;
&lt;br /&gt;
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options:&lt;br /&gt;
Code:&lt;br /&gt;
      &amp;lt;option name=&amp;quot;HP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;option name=&amp;quot;MP_REST&amp;quot; value=&amp;quot;15&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Default value if not defined is 15% each.&lt;br /&gt;
&lt;br /&gt;
      examples:&lt;br /&gt;
      player:rest(20) will rest for 20 seconds.&lt;br /&gt;
      player:rest(60, 20) will rest between 60 and 80 seconds.&lt;br /&gt;
      player:rest(90, 40, &amp;quot;full&amp;quot;) will rest up to between 90 and 130 seconds, and stop resting if being full&lt;br /&gt;
      player:rest(90, 40, &amp;quot;time&amp;quot;) will rest up to between 90 and 130 seconds, and not stop resting if being full&lt;br /&gt;
      player:rest(20, 40, &amp;quot;full, 20&amp;quot;) will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:sleep();&lt;br /&gt;
Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:logout([true]);&lt;br /&gt;
Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:mouseclickL(x, y [RoM window wide, RoM window high]);&lt;br /&gt;
Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.&lt;br /&gt;
&lt;br /&gt;
      player:cast(&amp;quot;skill&amp;quot;|skill);&lt;br /&gt;
This function accepts either a skill name (ie. &amp;quot;MAGE_FIREBALL&amp;quot;) or a skill object (ie. settings.profile.skills[&amp;quot;MAGE_FIREBALL&amp;quot;]). If the parameter is a string, it must be listed in the players' profile.&lt;br /&gt;
&lt;br /&gt;
      player:checkSkills(_only_friendly);&lt;br /&gt;
This will check all skills that the player has loaded in his profile for those that are appropriate to use. _only_friendly should be either true or false. If true, it will only use helpful skills, such as healing, even while in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:checkPotions();&lt;br /&gt;
This is similar to player:checkSkills(). It will check if the player needs to use any potions and use them accordingly. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:hasBuff(_buffname);&lt;br /&gt;
This will return true if your player has the buff, false if not. Run player:updatebuffs() first if you need to be sure your buff list is up-to date. &lt;br /&gt;
Can also be used to check buffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasBuff(&amp;quot;buffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:hasDebuff(_debuffname);&lt;br /&gt;
This will return true if your player has the debuff, false if not. Run player:updatebuffs() first if you need to be sure your debuff list is up-to date. &lt;br /&gt;
Can also be used to check debuffs on target. You may need to create the target object first.&lt;br /&gt;
For example:&lt;br /&gt;
  local target = player:getTarget();&lt;br /&gt;
  target:updateBuffs()&lt;br /&gt;
  if target:hasDebuff(&amp;quot;debuffname&amp;quot;) then&lt;br /&gt;
  etc...&lt;br /&gt;
&lt;br /&gt;
      player:fight();&lt;br /&gt;
If the player has an enemy target, it will engage that target in combat. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:loot();&lt;br /&gt;
If the player has a dead enemy target, it will attempt to loot the corpse. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:lootAll();&lt;br /&gt;
Will attempt to loot all nearby lootable bodies. This is generally ''not'' needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      success, reason = player:moveTo(waypoint, ignoreCycleTargets);&lt;br /&gt;
This will attempt to move the player to the given waypoint. If ignoreCycleTarget is true, it will not attempt to target and engage nearby enemies while on the move. 'waypoint' may also be a unit (such as player.Target - to move to the player's target). If you have raw coordinates, such as 100,200 that you want to move to, use CWaypoint(100,200) for your 'waypoint'.&lt;br /&gt;
&lt;br /&gt;
This function will return whether or not it was successful and, if unsuccessful, the reason. 'success' will either be true or false, and 'reason' will be WF_TARGET(we abandoned movement because we've got a target), WF_COMBAT(we abandoned movement because we entered combat [typically; pulled an aggressive monster]), WF_DIST(for some reason or other, we actually started moving away from the waypoint [slid down a hill?]), or WF_STUCK(got stuck on something in the terrain).&lt;br /&gt;
&lt;br /&gt;
      player:waitForAggro();&lt;br /&gt;
This function causes the player to stop and wait for a maximum of 5 seconds for aggressive enemies to engage in combat with the player. This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:faceDirection(angle);&lt;br /&gt;
This will rotate the character to face the specified direction in ''radians''('''not''' degrees!). This is typically not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:turnDirection(angle);&lt;br /&gt;
This will rotate the character some amount rather than face a specific direction. If 'angle' is negative, the character will rotate 'left', and if 'angle' is positive, then the character will rotate 'right'. 'angle' should be specified in radians.&lt;br /&gt;
&lt;br /&gt;
      player:unstick();&lt;br /&gt;
Attempts to get the player out of being stuck on something. This is generally not needed by the end-user.&lt;br /&gt;
&lt;br /&gt;
      player:haveTarget();&lt;br /&gt;
Returns true if the player has a valid, attackable target.&lt;br /&gt;
&lt;br /&gt;
      player:update();&lt;br /&gt;
This causes the player to update all information (hp/mp/etc. from the game client). This should be used after causing the player to enter their home, teleport, log out and back in, etc.&lt;br /&gt;
&lt;br /&gt;
      player:clearTarget();&lt;br /&gt;
Causes the player to drop their current target.&lt;br /&gt;
&lt;br /&gt;
      player:isFriend(pawn);&lt;br /&gt;
Returns true if the given pawn (such as player.Pet or player.Target) are on the player's friend list inside their profile.&lt;br /&gt;
&lt;br /&gt;
      player:isInMobs(pawn);&lt;br /&gt;
Exactly like player:isFriend(), only it checks if the pawn is in the 'mobs' section of their profile.&lt;br /&gt;
&lt;br /&gt;
      player:logout(fc_shutdown);&lt;br /&gt;
Causes the player to attempt to log out of the game and, optionally, shut down their computer (if available). If fc_shutdown is true, it will attempt to shut down your computer after logging off.&lt;br /&gt;
&lt;br /&gt;
      player:findTarget();&lt;br /&gt;
Attempts to locate a nearby target, returning true if it does, otherwise false.&lt;br /&gt;
&lt;br /&gt;
      player:merchant(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. It will then buy, sell and repair based on the characters profile settings. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:openStore(_npcname, _option);&lt;br /&gt;
Attempts to open the store of a nearby NPC with the name given by '_npcname'. You can then issue your own buy and/or sell commands. If the 'open shop' option is not the first in the npc dialog, eg. house npcs, you can specify which option it is in the second argument '_option'. '_option' is optional and will default to 1 which is correct for most merchants.&lt;br /&gt;
&lt;br /&gt;
      player:target_NPC(_npcname);&lt;br /&gt;
This will attempt to target a nearby NPC with the name given by '_npcname' but not interact with them.&lt;br /&gt;
&lt;br /&gt;
      player:target_Object(_objname, _waittime, _harvestall, _donotignore, _evalFunc);&lt;br /&gt;
This will target an object similarly to target_NPC but this function has more options to cater for the different behaviors of different objects.&lt;br /&gt;
&lt;br /&gt;
_objname = name or id of object to target. Accepts partial names or a table of names and ids.(Required)&lt;br /&gt;
&lt;br /&gt;
_waittime = time to wait if the object takes time to action, in ms. By default will wait until casting bar is gone. Only really necessary if you want it to wait longer than it takes to collect.(Optional)&lt;br /&gt;
&lt;br /&gt;
_harvestall = true if you wish to collect all in the immediate area. Only use if the object disappears once collected. (Default is false ie. opens/collects only once)&lt;br /&gt;
&lt;br /&gt;
_donotignore = If false, will target an object once then move onto the next object. If true, will continue to target object until it disappears or moves away. Only set to true if the target disappears or moves away or you might end up in an infinite loop.(if _harvestall = true then the default is false, else it is true).&lt;br /&gt;
&lt;br /&gt;
_evalFunc = A user created custom function that can be used to evaluate whether objects are valid or not. Should except an address as an argument and return true or false. (Optional)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Mailbox&amp;quot;)''' -- Targets 'Mailbox' with no wait time afterward.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, 8000)''' -- Encourage hen to lay then wait 8 seconds even though the cast bar only appears for a couple of seconds. Done only once.&lt;br /&gt;
&lt;br /&gt;
'''player:target_Object (&amp;quot;Ranch Hen&amp;quot;, nil, true, true)''' -- Feed all nearby hens, waiting until the cast bar ends. And do not ignore the current hen when searching for the next closest.&lt;br /&gt;
&lt;br /&gt;
The example below targets all hens in the coop by checking their Z value, with no ignoring.&lt;br /&gt;
 -- The evaluate function&lt;br /&gt;
 function henInCoop (address)&lt;br /&gt;
  if CObject(address).Z &amp;gt; 3240 then&lt;br /&gt;
   return true&lt;br /&gt;
  else&lt;br /&gt;
   return false&lt;br /&gt;
  end &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 -- The target hen command&lt;br /&gt;
 player:target_Object(&amp;quot;Ranch Hen&amp;quot;, nil, true, true, henInCoop) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      player:findNearestNameOrId(_objnameorid, _evalFunc)&lt;br /&gt;
Finds the nearest object without targeting it. Accepts the items name or id as argument or a table of items and ids to search for. Returns the closest objects table or nil if not found. For a description on how to use _evalFunc, please read the description for player:target_Object() above.&lt;br /&gt;
&lt;br /&gt;
      player:mount();&lt;br /&gt;
Finds the first ''permanent'' mount in your ''known inventory'' (typically slots 1-60; item shop bag not checked) and, if found, mounts it. You may also check if player.Mounted is true or false if you want to know whether the player is mounted or not. Will respond to aggro if mounting is interrupted but will still mount once aggro is dealt with.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
Get the total quantity of an item in your inventory. You can use the item-id or the name of the item. As a second argument you can specify where to look. Accepted values for ''range'' are; 'all', 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. By default it searches just the 'bags'.&lt;br /&gt;
 &lt;br /&gt;
example:&lt;br /&gt;
 if( inventory:itemTotalCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemNameOrId, range)&lt;br /&gt;
This function is obsolete. It is kept for backward compatibility. It is functionally the same as using inventory:itemTotalCount(itemNameOrId, range)&lt;br /&gt;
&lt;br /&gt;
 inventory:findItem(itemNameOrId, range)&lt;br /&gt;
Finds the first item in your inventory by name or id and returns the item object. If it is a stackable item it will return the smallest stack of that item. As a second argument you can specify where to look. Please consult the 'inventory:itemTotalCount' entry for excepted values for 'range'. By default it will search 'all' the inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Finds an item in the inventory by name or id then uses it.&lt;br /&gt;
&lt;br /&gt;
 inventory:getMainHandDurability()&lt;br /&gt;
Returns the durability of the main-hand weapon as a percent value from 1 to 100.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. &lt;br /&gt;
&lt;br /&gt;
 inventory:storeBuyItem(nameIdOrIndex, quantity)&lt;br /&gt;
Buys 'quantity' of items from a store by name, id or store index. Assumes store is already open. If 'quantity' is not specified then it will buy 1 by default.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 inventory:storeBuyItem(&amp;quot;Gold-wrapped Belt&amp;quot;) -- Buy by item name&lt;br /&gt;
 inventory:storeBuyItem(221544, 1) -- Buy by item id&lt;br /&gt;
 inventory:storeBuyItem(3, 1) -- Buy by store index&lt;br /&gt;
All of these examples will do the same thing, buy 1 'Gold-wrapped Belt'.&lt;br /&gt;
&lt;br /&gt;
 item:moveTo(bag)&lt;br /&gt;
Moves the item to the specified bag. Accepted values for ''bag'' are; 'bags', 'bag1', 'bag2', 'bag3', 'bag4', 'bag5', 'bag6', 'magicbox' and 'itemshop'. If possible it will try to merge stackable items. This is particularly useful for moving itemshop items to the itemshop bag.&lt;br /&gt;
&lt;br /&gt;
== Waypoint File Functions ==&lt;br /&gt;
&lt;br /&gt;
 __WPL:reverse();&lt;br /&gt;
Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is strongly recommended to use '__WPL:setDirection(..)' instead of this function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setDirection( [WPT_FORWARD | WPT_BACKWARD] );&lt;br /&gt;
Set the direction in which order the waypoints should be proccessed. It is usefull to put that at the first and at the last waypoint if you want to run between two places. Remember to use WPT_FORWARD at the first and WPT_BACKWARD at the last waypoint to run between them.&lt;br /&gt;
Use this instead of '__WPL:reverse()' to avoid problems in your waypoint file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setWaypointIndex( number);&lt;br /&gt;
Set the waypoint # 'number' as next waypoint to reach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:getNearestWaypoint(player.X, player.Z);&lt;br /&gt;
Get back the number of the closest waypoint.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 __WPL:setForcedWaypointType( [[&amp;quot;NORMAL&amp;quot;] | [&amp;quot;TRAVEL&amp;quot;] | [&amp;quot;RUN&amp;quot;]]);&lt;br /&gt;
Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.&lt;br /&gt;
&lt;br /&gt;
== RoM API Functions ==&lt;br /&gt;
With the function sendMacro() or RoMScript() we can submit macros to the RoM API. For a complete list of RoM API functions, go to http://theromwiki.com/index.php/List_of_Functions&lt;br /&gt;
&lt;br /&gt;
Here are some important API functions you can use:&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Levelup a skill. First number is the tab (1=general, 2=general class skills, 4=only primary class skills). Second number is the number of the skill at the tab. You can test the numbers by entering following macro ingame:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;/script _SkillName=GetSkillDetail(4,3); SendSystemChat(_SkillName);&amp;lt;/source&amp;gt;That will print you the name of the given skill into the ingame system chat.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 /script SendSystemChat(tonumber(string.sub(GetBagItemLink(GetBagItemInfo(1)), 8, 12), 16));&lt;br /&gt;
Print the itemid of slot-nr 1 into the system chat. Change the slot number to the item you want to get informations about or move that item to slot #1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;GetBagItemCount(&amp;quot;..itemid..&amp;quot;)&amp;quot;)&lt;br /&gt;
Get back the quantity of an givem item ID in your bags.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 occupiedSlots, totalSlots = sendMacro(&amp;quot;GetBagCount();&amp;quot;);&lt;br /&gt;
Get back the number of total slots in your bag and the number of the occupied slot in your bag.&lt;br /&gt;
&lt;br /&gt;
== User Functions ==&lt;br /&gt;
Since version r413 users are able to use a userfunctions.lua file in the Rombot root directory to hold all of their own custom functions.&lt;br /&gt;
&lt;br /&gt;
If you find that you repeat a particular set of code in your waypoint files, you can create your own function with that code in the userfunctions.lua file and use it anywhere with a simple call to that function.&lt;br /&gt;
&lt;br /&gt;
eg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;------------------------------------------------&lt;br /&gt;
-- CancelBuff Script&lt;br /&gt;
-- buffname = name of buff as appears in player buffs&lt;br /&gt;
-- returns 'true' if buff was removed or 'false' if did not have buff.&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
function CancelBuff(buffname)&lt;br /&gt;
    if buffname == nil then&lt;br /&gt;
        cprintf(cli.yellow,&amp;quot;No buff specified. Please use 'CancelBuff(buffname)'.\n&amp;quot;)&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    local buffnum=1&lt;br /&gt;
    local buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    while buff ~= nil do&lt;br /&gt;
        if buff == buffname then&lt;br /&gt;
            sendMacro(&amp;quot;CancelPlayerBuff(&amp;quot;..buffnum..&amp;quot;);&amp;quot;)&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        buffnum=buffnum+1&lt;br /&gt;
        buff=RoMScript(&amp;quot;UnitBuff('player',&amp;quot;..buffnum..&amp;quot;)&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&amp;lt;/source&amp;gt;&lt;br /&gt;
With this function in my userfunctions.lua file I can cancel a buff with a 1 line command. For example, every time I want to dismount my Brown Horse I use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;CancelBuff(&amp;quot;Brown Horse&amp;quot;)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use, simply create a text file in the rombot root directory named userfunctions.lua and place your functions within it.&lt;br /&gt;
&lt;br /&gt;
Some user created custom functions can be found here: [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1125 New Feature: Userfunctions.lua]&lt;/div&gt;</summary>
		<author><name>Pumbatoo</name></author>	</entry>

	</feed>