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

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=894</id>
		<title>User Functions Repository</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=894"/>
				<updated>2011-06-15T10:55:49Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Other Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a listing of user functions collected from the forums. Below that is a separate list for other relevant files that are not specifically user functions.  Please remember that when adding items to the lists to also include a page for the relevant item, detailing it's usage, download, functions, details and the like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
'''Name:''' The name of the script. Click the name to go to the script's specific page.&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A brief description of the script.&lt;br /&gt;
&lt;br /&gt;
'''Version:''' The version of the script stored here.&lt;br /&gt;
&lt;br /&gt;
'''LKC Version:''' The '''L'''ast '''K'''nown '''C'''ompatiable Version, or the last revision of RoMbot this is known to work for.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' The creator of the script.&lt;br /&gt;
&lt;br /&gt;
== User Functions List ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1561 Rock5's Mail Mods] || General purpose mail handling functions. || 1.52 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1566 Rock5's catchCavy script] || Function to catch cavies. || 1.02 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1434 Rock5's Fusion Control Functions] || Functions for controlling the fusion addon and related functions. || 0.1 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931 Teleport Addon] || A script to use a hacked teleport, it's a memory hack so It can't be used for long distances. It is currently used to provide teleporting inside Miller's Ranch in a file I created (Distance&amp;lt;129). Other Zones/Instances may have a different &amp;quot;rubber-band&amp;quot; threshold. (thx to fobsauce)|| 1.2 || r549 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1977 Use Food] ||USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.|| 1.00 || r551 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1984 showDQ] ||This simple code Is used to print how many dailies you have left to do. It also may create an ingame macro. I find it useful to spam this while doing dailies so I know how far along am I at a simple glimpse of the screen. USAGE: showDQ([slot_nr,macro_name])|| 2.00 || r553 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1985 swapClass] ||Swaps classes at an NPC. This code was submitted to me by raff, I only made small changes to it so I give him full credit for it. Hasn't been tested by me. || 2.0 || N/A || raff &amp;amp; jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=16844#p16844 lootBodies] ||When called tries to loot all lootable bodies in range. &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; * Obsolete. Built into bot as of revision 597 * &amp;lt;/span&amp;gt;|| 1.1 || r554 || rock5&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2406 UseGoodie] ||Helps using housemaid potions, foods and should work also for other consumables.  || V3 || Unknown || JDuarteDJ &amp;amp; Giram &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2034 track player] ||Records player info to a file. Can be adapted to record itemcount and much more. Easily used for multiboting. || 1.1 || N/A || lisa&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2068 gameText] ||This is used to print any kind of message to the game. for detailed info see the topic. USAGE: gameText(msg[,kind,channel,color,item])|| 1.00 || r560 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2184 QuestByName] ||This is usefull to accept/complete quests by their quest name or parts of it.|| 1.00 || r570 || JackBlonder&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2207 Guild Donation] ||This userfunction will Donate your resources to your guild.|| 1.2 || Unknown || lisa&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1956 Unknown Gift Grind] || A waypoint file with the sole purpose of mass accepting and decorating the Snowflake Tree || 1.00 || r549 || jduartedj &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1931 Teleport Miller's Ranch Golden Eggs] || A waypoint file Modded from rock5's golden eggs script that uses teleport hack, and is made to optimize the duration of the script, also delivers now! || 1.2 || r562 || jduartedj   &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Eggs Script] ||Accepts and completes quest, collects feed sacks, feeds chickens, helps them lay and collects the eggs. ||2.0 || r513 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Milk Script] || Accepts and completes quest, collects grass, feeds goat and collects milk. || 1.2 || r472 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350#p10350 Autologin] || Options for auto login and character selection. || 1.3.1 || r464 || rock5&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2111&amp;amp;p=17607&amp;amp;sid=e31ee4b59fb283d0538073d4a810a846#p17607 Autologin 1.31 with boxes ] || Options for auto login and character selection wit account boxes. || 1.3.1 || r464 || swietlowka&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=2002 Assist_asHealer] || Waypointfile to let a healer assist the party. || 0.1 || r554 || JackBlonder &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931&amp;amp;start=83 Advanced Teleport Miller's Ranch Golden Eggs] || Waypoint files to collect a given number of fresh eggs before delivering the quest based on jduaredj's script || 1.11 || r561 || T_Zero&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2582 FDB Extractor and ROM .db LanguageFile Converter/Viewer] || fdb file extractor and db language converter/viewer || n/a || n/a || rock5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=893</id>
		<title>User Functions Repository</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=893"/>
				<updated>2011-06-09T05:05:44Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a listing of user functions collected from the forums. Below that is a separate list for other relevant files that are not specifically user functions.  Please remember that when adding items to the lists to also include a page for the relevant item, detailing it's usage, download, functions, details and the like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
'''Name:''' The name of the script. Click the name to go to the script's specific page.&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A brief description of the script.&lt;br /&gt;
&lt;br /&gt;
'''Version:''' The version of the script stored here.&lt;br /&gt;
&lt;br /&gt;
'''LKC Version:''' The '''L'''ast '''K'''nown '''C'''ompatiable Version, or the last revision of RoMbot this is known to work for.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' The creator of the script.&lt;br /&gt;
&lt;br /&gt;
== User Functions List ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1561 Rock5's Mail Mods] || General purpose mail handling functions. || 1.52 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1566 Rock5's catchCavy script] || Function to catch cavies. || 1.02 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1434 Rock5's Fusion Control Functions] || Functions for controlling the fusion addon and related functions. || 0.1 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931 Teleport Addon] || A script to use a hacked teleport, it's a memory hack so It can't be used for long distances. It is currently used to provide teleporting inside Miller's Ranch in a file I created (Distance&amp;lt;129). Other Zones/Instances may have a different &amp;quot;rubber-band&amp;quot; threshold. (thx to fobsauce)|| 1.2 || r549 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1977 Use Food] ||USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.|| 1.00 || r551 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1984 showDQ] ||This simple code Is used to print how many dailies you have left to do. It also may create an ingame macro. I find it useful to spam this while doing dailies so I know how far along am I at a simple glimpse of the screen. USAGE: showDQ([slot_nr,macro_name])|| 2.00 || r553 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1985 swapClass] ||Swaps classes at an NPC. This code was submitted to me by raff, I only made small changes to it so I give him full credit for it. Hasn't been tested by me. || 2.0 || N/A || raff &amp;amp; jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=16844#p16844 lootBodies] ||When called tries to loot all lootable bodies in range. &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt; * Obsolete. Built into bot as of revision 597 * &amp;lt;/span&amp;gt;|| 1.1 || r554 || rock5&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2406 UseGoodie] ||Helps using housemaid potions, foods and should work also for other consumables.  || V3 || Unknown || JDuarteDJ &amp;amp; Giram &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2034 track player] ||Records player info to a file. Can be adapted to record itemcount and much more. Easily used for multiboting. || 1.1 || N/A || lisa&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2068 gameText] ||This is used to print any kind of message to the game. for detailed info see the topic. USAGE: gameText(msg[,kind,channel,color,item])|| 1.00 || r560 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2184 QuestByName] ||This is usefull to accept/complete quests by their quest name or parts of it.|| 1.00 || r570 || JackBlonder&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2207 Guild Donation] ||This userfunction will Donate your resources to your guild.|| 1.2 || Unknown || lisa&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1956 Unknown Gift Grind] || A waypoint file with the sole purpose of mass accepting and decorating the Snowflake Tree || 1.00 || r549 || jduartedj &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1931 Teleport Miller's Ranch Golden Eggs] || A waypoint file Modded from rock5's golden eggs script that uses teleport hack, and is made to optimize the duration of the script, also delivers now! || 1.2 || r562 || jduartedj   &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Eggs Script] ||Accepts and completes quest, collects feed sacks, feeds chickens, helps them lay and collects the eggs. ||2.0 || r513 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Milk Script] || Accepts and completes quest, collects grass, feeds goat and collects milk. || 1.2 || r472 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350#p10350 Autologin] || Options for auto login and character selection. || 1.3.1 || r464 || rock5&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=2111&amp;amp;p=17607&amp;amp;sid=e31ee4b59fb283d0538073d4a810a846#p17607 Autologin 1.31 with boxes ] || Options for auto login and character selection wit account boxes. || 1.3.1 || r464 || swietlowka&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=2002 Assist_asHealer] || Waypointfile to let a healer assist the party. || 0.1 || r554 || JackBlonder &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931&amp;amp;start=83 Advanced Teleport Miller's Ranch Golden Eggs] || Waypoint files to collect a given number of fresh eggs before delivering the quest based on jduaredj's script || 1.11 || r561 || T_Zero&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Auto_repair&amp;diff=670</id>
		<title>RoM Auto repair</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Auto_repair&amp;diff=670"/>
				<updated>2011-01-25T15:11:57Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* General Autosell Options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Auto Repair at the merchant NPC =&lt;br /&gt;
&lt;br /&gt;
For using the autorepair ingame, you need normaly to press the 'repair' button. You can install the ingame addon [http://rom.curse.com/downloads/rom-addons/details/streamline.aspx Streamline]. Streamline will automaticly repair if you open a dialog window with a merchant and it will automaticly deliver quests, if you open a dialog with a quest NPC.&lt;br /&gt;
&lt;br /&gt;
You can also do that by using the function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;player:merchant( npc_name );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will try to target the nearest NPC's and find the NPC by name. After that, the bot will open the dialog window, autorepair and buy consumables depending from your profile options. It will also work while using multiple bots.&lt;br /&gt;
&lt;br /&gt;
If you only want to target a NPC and do the further stuff by yourself you can use the function:&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;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you have to create a waypoint file, which leads your character to the repair NPC&lt;br /&gt;
&lt;br /&gt;
e.g. '5-7_bugs_repair.xml'&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;waypoints&amp;gt;&lt;br /&gt;
   &amp;lt;!-- Thats a demo to interact with the NPC Tracy                         --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12282&amp;quot; z=&amp;quot;11183&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 2 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12391&amp;quot; z=&amp;quot;10982&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 3 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12529&amp;quot; z=&amp;quot;10941&amp;quot;&amp;gt;&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
	&amp;lt;!-- # 4 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-808&amp;quot; z=&amp;quot;-6067&amp;quot;&amp;gt;&lt;br /&gt;
		player:merchant(&amp;quot;Tracy&amp;quot;);&lt;br /&gt;
		loadPaths(&amp;quot;5-7_bugs_repair_back&amp;quot;);&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 bot will use the waypoint file '5-7_bugs_repair_back' to find back the way to the original boting place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have to insert some code into your boting waypoint file (in this example into the file '5-7_bugs.xml'), to give the bot the information when to repair. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use a Durability Based AutoRepair ==&lt;br /&gt;
&lt;br /&gt;
It could be based on the duration of your items:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!-- #  1 --&amp;gt;&amp;lt;waypoint x=&amp;quot;13752&amp;quot; z=&amp;quot;6726&amp;quot;&amp;gt;&lt;br /&gt;
	if( player.free_flag1 == true ) then &lt;br /&gt;
		player.free_flag1 = false; &lt;br /&gt;
		loadPaths(&amp;quot;5-7_bugs_repair.xml&amp;quot;);&lt;br /&gt;
	end&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you see, we don't check the duration directly in the waypoint file. Simply because the duration is dependent from your armor and by that, dependend from your character. Hence we check the duration in our characters profile and set just a flag, if we should go for repairing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;onLeaveCombat&amp;gt;&lt;br /&gt;
	local dura = inventory:getMainHandDurability();&lt;br /&gt;
	printf(&amp;quot;Durability:%s\n&amp;quot;, dura);&lt;br /&gt;
	if( dura &amp;amp;lt; 90 ) then&lt;br /&gt;
		player.free_flag1 = true;&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/onLeaveCombat&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use a Fight Based AutoRepair ==&lt;br /&gt;
&lt;br /&gt;
It could be fight based:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;	&amp;lt;!-- #16 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12364&amp;quot; z=&amp;quot;10939&amp;quot;&amp;gt;&lt;br /&gt;
	if( player.Fights-player.free_counter1 &amp;gt; 300 ) then&lt;br /&gt;
		player.free_counter1 = player.Fights;&lt;br /&gt;
		load_paths(&amp;quot;5-7_bugs_repair.xml&amp;quot;);&lt;br /&gt;
	end&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use a Time Based AutoRepair ==&lt;br /&gt;
&lt;br /&gt;
Or time based:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;	&amp;lt;!-- #16 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12364&amp;quot; z=&amp;quot;10939&amp;quot;&amp;gt;&lt;br /&gt;
	if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end;&lt;br /&gt;
	if( os.difftime(os.time(), player.free_counter1) &amp;gt; 3600 ) then&lt;br /&gt;
		player.free_counter1 = os.time();&lt;br /&gt;
		load_paths(&amp;quot;5-7_bugs_repair.xml&amp;quot;);&lt;br /&gt;
	end&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use a Items Based AutoRepair ==&lt;br /&gt;
&lt;br /&gt;
You also can check for an item amount like healing or mana potions. But I would recommend more to use a durability check and by that fill up enough of your potions &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;	&amp;lt;!-- #16 --&amp;gt;&amp;lt;waypoint x=&amp;quot;-12364&amp;quot; z=&amp;quot;10939&amp;quot;&amp;gt;&lt;br /&gt;
	if( 20 &amp;gt; inventory:itemTotalCount(&amp;lt;itemNameOrId&amp;gt;) ) then&lt;br /&gt;
		load_paths(&amp;quot;5-7_bugs_repair.xml&amp;quot;);&lt;br /&gt;
	end&lt;br /&gt;
	&amp;lt;/waypoint&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Replace &amp;lt;itemNameOrId&amp;gt; with the itemname or item-id of the potions you want to check. Be sure your cached inventory is up to date. See the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions#Inventory_and_Item_Functions inventory functions section] for more informatione about that.&lt;br /&gt;
&lt;br /&gt;
== Switch an item ==&lt;br /&gt;
&lt;br /&gt;
Instead of repairing your items, you could also switch a item based on the durabilty:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;onLeaveCombat&amp;gt;&lt;br /&gt;
   local dura = inventory:getMainHandDurability();&lt;br /&gt;
   printf(&amp;quot;Durability:%s\n&amp;quot;, dura);&lt;br /&gt;
   if( dura &amp;amp;lt; 0.9 ) then&lt;br /&gt;
      inventory:useItem(&amp;lt;itemNameOrId&amp;gt;);&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/onLeaveCombat&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Replace '&amp;lt;itemNameOrId&amp;gt;' with the itemname or itemid of the item you want to equipt. You have to be sure that your [http://www.solarstrike.net/wiki/index.php5?title=RoM_Functions#Inventory_and_Item_Functions inventory is up to date], because the funtion 'inventory:useItem(itemNameOrId);' uses the cached inventory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You also could combine some of that methods.&lt;br /&gt;
&lt;br /&gt;
= Auto Sell at the merchant NPC =&lt;br /&gt;
&lt;br /&gt;
==General Autosell Options==&lt;br /&gt;
&lt;br /&gt;
There are some expert options for your profile if you want to automatically sell items to the merchant NPC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;option name=&amp;quot;INV_AUTOSELL_ENABLE&amp;quot;	value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_FROMSLOT&amp;quot;		value=&amp;quot;61&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_TOSLOT&amp;quot;		value=&amp;quot;120&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_QUALITY&amp;quot;		value=&amp;quot;white,green&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_IGNORE&amp;quot;		value=&amp;quot;Pfeil,Elementar, III&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_TYPES&amp;quot;		value=&amp;quot;Weapons,Armor,Recipes,Others&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_TYPES_NOSELL&amp;quot;	value=&amp;quot;Cloth,Cooking&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;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; | INV_AUTOSELL_ENABLE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Allows you to enable or disable the Auto Sell function. Valid values are true|false.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_FROMSLOT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Starting bagslot for autosell. Bag 1 has slots 1-30, bag 2 has slots 31-60, ...&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_TOSLOT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Ending bagslot for autosell.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_QUALITY&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Enter the item qualities you want to sell. Recommended value is &amp;quot;white, green&amp;quot; ( white | green | blue | purple | orange | gold).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_IGNORE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Enter items names (or parts of the names) or item-Ids (not parts of the tooltip text !), you don't want to sell. You can enter more than one item. Use commata as delimites.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_TYPES&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Enter the item types you want to sell. You can view a list of the item types in the cache file &amp;quot;cache/itemtypestable.lua&amp;quot; once it has been created. If no types are specified then it will default to selling all.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_TYPES_NOSELL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Enter the item types you don't want to sell. This overrides the &amp;quot;INV_AUTOSELL_TYPES&amp;quot; option. So if you set INV_AUTOSELL_TYPES = &amp;quot;Armor&amp;quot; and INV_AUTOSELL_TYPES_NOSELL = &amp;quot;Cloth&amp;quot; then it will sell armor but not cloth armor.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use the normal 'player:merchant()' function in your waypoint file to autosale your items. The bagslot are starting from the top left with 1, 2, 3, ... in the first row, 6, 7, 8, ... in the second row, ...&lt;br /&gt;
&lt;br /&gt;
==Check Durability and Stats while using Autosell==&lt;br /&gt;
&lt;br /&gt;
You can also check the durability and/or stats of an item while selling it. We need to read the ingame tooltip to check the durability and the stats. That's at the moment not possible by only using the RoMScript() MACRO function. So we need a little ingame addon. That addon is named 'igf' (ingamefunctions). You found that addon in the bot folder 'rom/devtools/'.&lt;br /&gt;
&lt;br /&gt;
'''Please copy the folder 'ingamefunctions' into your RoM installation into the folder '\Runes of Magic\Interface\AddOns' to install that addon. And restart the RoM games client.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;option name=&amp;quot;INV_AUTOSELL_NOSELL_DURA&amp;quot;      value=&amp;quot;110&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_STATS_NOSELL&amp;quot;      value=&amp;quot; X,XI&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;option name=&amp;quot;INV_AUTOSELL_STATS_SELL&amp;quot;      value=&amp;quot;IX&amp;quot; /&amp;gt;&amp;lt;/source&amp;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; | INV_AUTOSELL_NOSELL_DURA&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Items with a durability eq or greater that value will not be sold.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_STATS_NOSELL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Items with that text strings in the right tooltip side will not be sold. Caution: It's only a very easy check. So that text strings are checked against the whole right side tooltip text. E.g. if you want to save the stat 'defense', also items with 'magical defense' will not be sold. Not only items with the stat 'defense'. Sry for that. If you set the value 'X', all stats with 'X' wouldn't be sold: 'X', 'IX', 'XI'.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | INV_AUTOSELL_STATS_SELL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | By using that items, you could overwrite the 'INV_AUTOSELL_STATS_NOSELL' value. e.g. if you set 'INV_AUTOSELL_STATS_NOSELL'=&amp;quot;X&amp;quot; you would not sell 'IX' stats. But if you know set 'INV_AUTOSELL_STATS_SELL=&amp;quot;IX&amp;quot; you would sell 'IX' stats and save all other stats with 'X'.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Debuging Option for Autosell==&lt;br /&gt;
&lt;br /&gt;
You can use the option:&lt;br /&gt;
 &amp;lt;option name=&amp;quot;DEBUG_AUTOSELL&amp;quot;      value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
to get some debuging options while using autosell.&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=649</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=649"/>
				<updated>2011-01-14T08:26:33Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Inventory and Item Functions */&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;
 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()&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).&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;
== 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;
      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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=648</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=648"/>
				<updated>2011-01-14T07:31:09Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Player Functions */&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;
 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()&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).&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;
== 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;
      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:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=647</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=647"/>
				<updated>2011-01-13T02:34:19Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* General Functions */&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;
 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()&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).&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;
== 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;
      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 target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more. 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:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=644</id>
		<title>User Functions Repository</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=644"/>
				<updated>2011-01-10T03:06:00Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a listing of addons(userfunctions) collected from the forums. A separate list is kept for other relevant files that are not specifically addons.  Please remember that when adding items to the lists to also include a page for the relevant item, detailing it's usage, functions, details and the like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
'''Name:''' The name of the addon. Click the name to go to the addon's specific page.&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A brief description of the addon.&lt;br /&gt;
&lt;br /&gt;
'''Version:''' The version of the addon stored here.&lt;br /&gt;
&lt;br /&gt;
'''LKC Version:''' The '''L'''ast '''K'''nown '''C'''ompatiable Version, or the last revision of RoMbot this is known to work for.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' The creator of the script.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' A download link for the addon.&lt;br /&gt;
&lt;br /&gt;
== Addon List ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1561 Rock5's Mail Mods] || General purpose mail handling functions. || 1.52 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1566 Rock5's catchCavy script] || Function to catch cavies. || 1.01 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1434 Rock5's Fusion Control Functions] || Functions for controlling the fusion addon and related functions. || 0.1 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931 Teleport Addon] || A script to use a hacked teleport, it's a memory hack so It can't be used for long distances. It is currently used to provide teleporting inside Miller's Ranch in a file I created (Distance&amp;lt;129). Other Zones/Instances may have a different &amp;quot;rubber-band&amp;quot; threshold. (thx to fobsauce)|| 1.00 || r549 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1977 Use Food] ||USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.|| 1.00 || r551 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1984 showDQ] ||This simple code Is used to print how many dailies you have left to do. It also may create an ingame macro. I find it useful to spam this while doing dailies so I know how far along am I at a simple glimpse of the screen. USAGE: showDQ([slot_nr,macro_name])|| 2.00 || r553 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1985 swapClass] ||Swaps classes at an NPC. This code was submitted to me by raff, I only made small changes to it so I give him full credit for it. Hasn't been tested by me. || 1.01 || N/A || raff&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=16844#p16844 lootBodies] ||When called tries to loot all lootable bodies in range. || 1.1 || r554 || rock5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1956 Unknown Gift Grind] || A waypoint file with the sole purpose of mass accepting and decorating the Snowflake Tree || 1.00 || r549 || jduartedj &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1931 Teleport Miller's Ranch Golden Eggs] || A waypoint file Modded from rock5's golden eggs script that uses teleport hack, and is made to optimize the duration of the script || 1.10 || r551 || jduartedj   &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Eggs Script] ||Accepts and completes quest, collects feed sacks, feeds chickens, helps them lay and collects the eggs. ||2.0 || r513 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Milk Script] || Accepts and completes quest, collects grass, feeds goat and collects milk. || 1.2 || r472 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350#p10350 Autologin] || Options for auto login and character selection. || 1.3.1 || r464 || rock5 &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=643</id>
		<title>User Functions Repository</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=643"/>
				<updated>2011-01-10T03:05:06Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Addon List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a listing of addons collected from the forums. A separate list is kept for other relevant files that are not specifically addons.  Please remember that when adding items to the lists to also include a page for the relevant item, detailing it's usage, functions, details and the like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
'''Name:''' The name of the addon. Click the name to go to the addon's specific page.&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A brief description of the addon.&lt;br /&gt;
&lt;br /&gt;
'''Version:''' The version of the addon stored here.&lt;br /&gt;
&lt;br /&gt;
'''LKC Version:''' The '''L'''ast '''K'''nown '''C'''ompatiable Version, or the last revision of RoMbot this is known to work for.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' The creator of the script.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' A download link for the addon.&lt;br /&gt;
&lt;br /&gt;
== Addon List ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1561 Rock5's Mail Mods] || General purpose mail handling functions. || 1.52 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1566 Rock5's catchCavy script] || Function to catch cavies. || 1.01 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1434 Rock5's Fusion Control Functions] || Functions for controlling the fusion addon and related functions. || 0.1 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931 Teleport Addon] || A script to use a hacked teleport, it's a memory hack so It can't be used for long distances. It is currently used to provide teleporting inside Miller's Ranch in a file I created (Distance&amp;lt;129). Other Zones/Instances may have a different &amp;quot;rubber-band&amp;quot; threshold. (thx to fobsauce)|| 1.00 || r549 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1977 Use Food] ||USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.|| 1.00 || r551 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1984 showDQ] ||This simple code Is used to print how many dailies you have left to do. It also may create an ingame macro. I find it useful to spam this while doing dailies so I know how far along am I at a simple glimpse of the screen. USAGE: showDQ([slot_nr,macro_name])|| 2.00 || r553 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1985 swapClass] ||Swaps classes at an NPC. This code was submitted to me by raff, I only made small changes to it so I give him full credit for it. Hasn't been tested by me. || 1.01 || N/A || raff&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=16844#p16844 lootBodies] ||When called tries to loot all lootable bodies in range. || 1.1 || r554 || rock5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1956 Unknown Gift Grind] || A waypoint file with the sole purpose of mass accepting and decorating the Snowflake Tree || 1.00 || r549 || jduartedj &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1931 Teleport Miller's Ranch Golden Eggs] || A waypoint file Modded from rock5's golden eggs script that uses teleport hack, and is made to optimize the duration of the script || 1.10 || r551 || jduartedj   &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Eggs Script] ||Accepts and completes quest, collects feed sacks, feeds chickens, helps them lay and collects the eggs. ||2.0 || r513 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Milk Script] || Accepts and completes quest, collects grass, feeds goat and collects milk. || 1.2 || r472 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350#p10350 Autologin] || Options for auto login and character selection. || 1.3.1 || r464 || rock5 &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=641</id>
		<title>User Functions Repository</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=User_Functions_Repository&amp;diff=641"/>
				<updated>2011-01-09T01:56:59Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Other Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a listing of addons collected from the forums. A separate list is kept for other relevant files that are not specifically addons.  Please remember that when adding items to the lists to also include a page for the relevant item, detailing it's usage, functions, details and the like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
'''Name:''' The name of the addon. Click the name to go to the addon's specific page.&lt;br /&gt;
&lt;br /&gt;
'''Description:''' A brief description of the addon.&lt;br /&gt;
&lt;br /&gt;
'''Version:''' The version of the addon stored here.&lt;br /&gt;
&lt;br /&gt;
'''LKC Version:''' The '''L'''ast '''K'''nown '''C'''ompatiable Version, or the last revision of RoMbot this is known to work for.&lt;br /&gt;
&lt;br /&gt;
'''Author:''' The creator of the script.&lt;br /&gt;
&lt;br /&gt;
'''Download:''' A download link for the addon.&lt;br /&gt;
&lt;br /&gt;
== Addon List ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1561 Rock5's Mail Mods] || General purpose mail handling functions. || 1.52 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1566 Rock5's catchCavy script] || Function to catch cavies. || 1.01 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1434 Rock5's Fusion Control Functions] || Functions for controlling the fusion addon and related functions. || 0.1 || Unknown || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1931 Teleport Addon] || A script to use a hacked teleport, it's a memory hack so It can't be used for long distances. It is currently used to provide teleporting inside Miller's Ranch in a file I created (Distance&amp;lt;129). Other Zones/Instances may have a different &amp;quot;rubber-band&amp;quot; threshold. (thx to fobsauce)|| 1.00 || r549 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1977 Use Food] ||USAGE: UseFood(_foodname[,_buffname]) _foodname is the name of the food and _buffname is meant to use when the buff hasn't got the same name as the food (e.g. house maid foods), note that this works for anything else you need to use and produces a buff.|| 1.00 || r551 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1984 showDQ] ||This simple code Is used to print how many dailies you have left to do. It also includes a simple macro code to use ingame. I find it useful to spam this while doing dailies so I know how far along am I at a simple glimpse of the screen.|| 1.00 || r553 || jduartedj&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&amp;amp;t=1985 swapClass] ||Swaps classes at an NPC. This code was submitted to me by raff, I only made small changes to it so I give him full credit for it. Hasn't been tested by me. || 1.01 || N/A || raff&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''To download refer to the linked pages.''&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Name || Description || Version || LKC Version || Author&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1956 Unknown Gift Grind] || A waypoint file with the sole purpose of mass accepting and decorating the Snowflake Tree || 1.00 || r549 || jduartedj &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1931 Teleport Miller's Ranch Golden Eggs] || A waypoint file Modded from rock5's golden eggs script that uses teleport hack, and is made to optimize the duration of the script || 1.10 || r551 || jduartedj   &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Eggs Script] ||Accepts and completes quest, collects feed sacks, feeds chickens, helps them lay and collects the eggs. ||2.0 || r513 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?f=21&amp;amp;t=1478 Miller's Ranch Milk Script] || Accepts and completes quest, collects grass, feeds goat and collects milk. || 1.2 || r472 || rock5 &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350#p10350 Autologin] || Options for auto login and character selection. || 1.3.1 || r464 || rock5 &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Configuration&amp;diff=639</id>
		<title>RoM Configuration</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Configuration&amp;diff=639"/>
				<updated>2011-01-03T17:12:56Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Profile - Options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two main settings files for RoM bot: settings.xml and your profile.&lt;br /&gt;
Profiles contain character-specific settings, while settings.xml contains hotkey settings and general preferences.&lt;br /&gt;
&lt;br /&gt;
== Settings.xml ==&lt;br /&gt;
Here is an example settings file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
	&amp;lt;hotkeys&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Cannot use modifiers --&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;MOVE_FORWARD&amp;quot; key=&amp;quot;VK_W&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;MOVE_BACKWARD&amp;quot; key=&amp;quot;VK_S&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;ROTATE_LEFT&amp;quot; key=&amp;quot;VK_A&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;ROTATE_RIGHT&amp;quot; key=&amp;quot;VK_D&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;STRAFF_LEFT&amp;quot; key=&amp;quot;VK_Q&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;STRAFF_RIGHT&amp;quot; key=&amp;quot;VK_E&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;JUMP&amp;quot; key=&amp;quot;VK_SPACE&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;TARGET&amp;quot; key=&amp;quot;VK_TAB&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;hotkey description=&amp;quot;TARGET_FRIEND&amp;quot; key=&amp;quot;VK_J&amp;quot; modifier=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/hotkeys&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;options&amp;gt;&lt;br /&gt;
		&amp;lt;option name=&amp;quot;ENABLE_FIGHT_SLOW_TURN&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;option name=&amp;quot;MELEE_DISTANCE&amp;quot; value=&amp;quot;45&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;option name=&amp;quot;LANGUAGE&amp;quot; value=&amp;quot;english&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;option name=&amp;quot;DEBUGGING&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Settings - Hotkeys===&lt;br /&gt;
The hotkey settings are mostly self-explanatory. MOVE_FORWARD, obviously, coresponds to the key that makes your character walk forward. This is &amp;quot;W&amp;quot; by default. Note that '''all''' keys must preceeded by 'VK_'.&lt;br /&gt;
&lt;br /&gt;
You may also notice the 'modifier'. Modifiers are keys such as CONTROL, SHIFT, or ALT.&lt;br /&gt;
&lt;br /&gt;
If your Runes of Magic bindings file (By default, is located at 'My Documents/Runes of Magic/bindings.txt') can be found and loaded, the RoM bot will instead use these settings so that you will not need to manually change your hotkey settings.&lt;br /&gt;
&lt;br /&gt;
===Settings - Options===&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; | ENABLE_FIGHT_SLOW_TURN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Allows you to enable or disable &amp;quot;slow turning&amp;quot; in combat. If you have click-to-move on, you should not need this. It should be set to either &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;. The default is &amp;quot;false&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | MELEE_DISTANCE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The distance at which to conduct melee combat. A value of 45 is good and should not be changed unless you have problems with being either too close or too far away for melee combat. Default: &amp;quot;45&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | LANGUAGE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Allows you to set your preferred language. Acceptable values are &amp;quot;english&amp;quot;, &amp;quot;deutsch&amp;quot;, &amp;quot;polish&amp;quot;, &amp;quot;russian&amp;quot; and &amp;quot;french&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | USE_CLIENT_LANGUAGE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | After loading the bot, we will automatically use the game clients language as bot language.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | DEBUGGING&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | This is a debugging option. When set to true, it will instantly exit on memory read errors and provide better debugging information. Default: &amp;quot;false&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Character Profiles ==&lt;br /&gt;
There are a few things you should know about character profiles first:&lt;br /&gt;
* They typically are named after the character that will use them&lt;br /&gt;
* They must be inside the 'rom/profiles' folder&lt;br /&gt;
* They must follow proper XML formatting&lt;br /&gt;
* They may contain custom Lua code&lt;br /&gt;
&lt;br /&gt;
There are many profile options that can be set so it is highly recommended you make a copy of the default profile (Default.xml) and modify that to your character's needs instead of starting from scratch.&lt;br /&gt;
&lt;br /&gt;
'''If you have extension hiding turned off,''' the .xml extension will not show on any of your files. If this is the case, '''do not''' add the .xml extension or you will end up with a file named something like Default.xml.xml. This may cause the profile to not be found and you may get errors. However, if you are able to see extensions, you should of course include the .xml extension when naming your profile.&lt;br /&gt;
&lt;br /&gt;
===Profile - Options===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;options&amp;gt;&lt;br /&gt;
	&amp;lt;option name=&amp;quot;HP_LOW&amp;quot;        value=&amp;quot;85&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;option name=&amp;quot;MP_LOW_POTION&amp;quot; value=&amp;quot;50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;option name=&amp;quot;HP_LOW_POTION&amp;quot; value=&amp;quot;40&amp;quot; /&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Healing and Potions'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | HP_LOW&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The percentage of health to use heal skills at&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | HP_LOW_POTION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The percentage of health to use potions at&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | MP_LOW_POTION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The percentage of mana to use mana potions at&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Resting'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | HP_REST&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If health falls below this percentage, then rest.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | MP_LOW&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If mana falls below this percentage, then rest.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Shopping options'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | HEALING_POTION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | How many healing potions should we have in the inventory after visiting a merchant.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | MANA_POTION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | How many mana potions should we have in the inventory after visiting a merchant.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | ARROW_QUIVER&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | How many arrow quivers should we have in the inventory after visiting a merchant.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | THROWN_BAG&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | How many thrown bags should we have in the inventory after visiting a merchant.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | POISON&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | How many poison should we have in the inventory after visiting a merchant.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Ammunition reload'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | RELOAD_AMMUNITION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Which kind of ammunition should we reload ( arrow | thrown | false) .&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Combat Options'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | COMBAT_TYPE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Either &amp;quot;melee&amp;quot; or &amp;quot;ranged&amp;quot;. Whichever best fits your character. Default: empty string (&amp;quot;&amp;quot;). When unset (default), it will determine this automatically based on your class. There is no need to change this.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | COMBAT_RANGED_PULL&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to attempt to &amp;quot;pull&amp;quot; enemies towards you with ranged skills while you are a melee-based class&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | COMBAT_DISTANCE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The distance to remain at when fighting. This only affects your character when COMBAT_TYPE is &amp;quot;ranged&amp;quot; or when you use COMBAT_RANGED_PULL as melee.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | MAX_FIGHT_TIME&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If you stop damaging a target within this amount of time, you will skip this target (prevents getting stuck).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | DOT_PERCENT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Use DOTs on this target only if it has more than this percentage of HP.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | ANTI_KS&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to avoid stealing other players' kills. true or false.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Waypoint and Movement'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | WAYPOINTS&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The filename (including .xml extension) of the waypoint script to use. Must reside in the 'waypoints' folder!&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | RETURNPATH&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The filename (including .xml extension) of the waypoint script to use for returning after death. Must reside in the 'waypoints' folder!&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | PATH_TYPE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The type of movement to use. Should be either 'waypoints' or 'wander'. See path types for more information.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | WANDER_RADIUS&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The distance that your character is allowed to &amp;quot;wander&amp;quot; freely when using wander mode.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | WAYPOINT_DEVIATION&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | A 'random' offset applied to each waypoint in your path giving it less of a bot-like appearance; suggested value of 50. Lower value means you stick closer to your normal path; 0 means no deviation.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | QUICK_TURN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to use quick turn mode. Quick turn mode emulates a click-to-move type movement style. This means your character does not stop to slowly turn around.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Level Difference'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | TARGET_LEVELDIF_ABOVE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The maximum level of enemy above your own to engage in combat. i.e. a value of 5 means you will attack monsters up to 5 levels above your own.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | TARGET_LEVELDIF_BELOW&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The maximum level of enemy below your own to engage in combat. i.e. a value of 5 means you will attack monsters up to 5 levels below your own.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Looting'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOOT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether you want to loot enemies or not. True or false.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOOT_IN_COMBAT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not you want to pick up loot when other enemies are still attacking you.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOOT_DISTANCE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The max distance away a corpse can be that you will attempt to loot.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOOT_PAUSE_AFTER&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | A percentage probability to attempt a short &amp;quot;rest&amp;quot; (to look more human) after looting an enemy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Harvesting'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom: 1px dotted #000000;&amp;quot; | HARVEST_DISTANCE&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px dotted #000000;&amp;quot; | The distance, in game units, that a harvestable must be from the player in order to engage harvesting it. Default: 120&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom: 1px dotted #000000;&amp;quot; | HARVEST_WOOD&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to harvest wood nodes. True or false.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom: 1px dotted #000000;&amp;quot; | HARVEST_HERB&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to harvest herb nodes. True or false.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom: 1px dotted #000000;&amp;quot; | HARVEST_ORE&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not to harvest ore nodes. True or false.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Log out &amp;amp; Resurrection Settings'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOGOUT_TIME&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Log out after this amount of time (in minutes). A value of 0 means you will not use this setting. Default: 0&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOGOUT_SHUTDOWN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If you want to have the computer automatically shutdown after automatically logging out. Default: false&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOGOUT_WHEN_STUCK&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If your character gets stuck and cannot unstuck himself, you can use this option to have him log off. Default: true&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | LOGOUT_SHUTDOWN&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | If you want to have the computer automatically shutdown after automatically logging out. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | RES_AUTOMATIC_AFTER_DEATH&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Whether or not your character should attempt resurrecting when he dies. Default: true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #C0C0FF; text-align: center;&amp;quot; | '''Egg Pet Settings'''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_ENABLE_CRAFT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Set to true if you want to craft with your pet. Default: false&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_CRAFT_SLOT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The pet slot to use if pet crafting is enabled. Default: nil&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_CRAFT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The type of materials you want your pet to craft &amp;quot;mining&amp;quot;, &amp;quot;woodworking&amp;quot;, &amp;quot;herbalism&amp;quot; or combination. Default: &amp;quot;mining,woodworking,herbalism&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_CRAFTINDEX&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | By default your pet will craft the highest materials possible. Use this option if you want it to craft lower level materials from the dropdown list. Default: nil&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_ENABLE_ASSIST&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Set to true if you want to summon your pet to assist you. Default: false&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 200px; border-bottom:1px dotted #000000;&amp;quot; | EGGPET_ASSIST_SLOT&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The pet slot to use if pet assist is enabled. Default: nil&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Profile - Friends===&lt;br /&gt;
The &amp;quot;Friends&amp;quot; list can be used to mark targets that you do not want to attack. This can be other players that may be marked for PVP, or targets that you want to ignore (ie. &amp;quot;Ystra Ferret&amp;quot;). You may also add players to your friend list to get the bot to assist them when it notices they are fighting something.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;friends&amp;gt;&lt;br /&gt;
		&amp;lt;!-- names of friends we help fighting or enemys we don't want to attack --&amp;gt;&lt;br /&gt;
		&amp;lt;friend name=&amp;quot;Jack&amp;quot; /&amp;gt; &amp;lt;!-- A player, lets assist him --&amp;gt;&lt;br /&gt;
		&amp;lt;friend name=&amp;quot;Jill&amp;quot; /&amp;gt; &amp;lt;!-- A player, do not attack her --&amp;gt;&lt;br /&gt;
		&amp;lt;friend name=&amp;quot;Ambas&amp;quot; /&amp;gt; &amp;lt;!-- Elite, avoid him --&amp;gt;&lt;br /&gt;
	&amp;lt;/friends&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use umlauts in your friends list, you have to use the escape character with the proper ascii code, since LUA can't handle umlauts (ü=\129, ä=\132, ö=\148, ...). For a mob named 'Kuhkäfer' if would look like &lt;br /&gt;
 &amp;lt;friend name=&amp;quot;Kuhk\132fer&amp;quot; /&amp;gt;&lt;br /&gt;
For more ASCII character look at the [http://www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/files/ascii.htm extended ASCII table].&lt;br /&gt;
&lt;br /&gt;
===Profile - Mobs===&lt;br /&gt;
The &amp;quot;Mobs&amp;quot; list can be used to limit the mobs we will attack. That can be helpful if you only want to attack one kind of mobs (e.g. for doing a daily). Leave the list empty if you don't want to restrict the bot.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;mobs&amp;gt;&lt;br /&gt;
		&amp;lt;!-- names of mobs we want to attack 				--&amp;gt;&lt;br /&gt;
		&amp;lt;mob name=&amp;quot;Fungus&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;mob name=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;mob name=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/mobs&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use umlauts in your list, you have to use the escape character with the proper ascii code, since LUA can't handle umlauts (ü=\129, ä=\132, ö=\148, ...). For a mob named 'Kuhkäfer' if would look like &lt;br /&gt;
 &amp;lt;mob name=&amp;quot;Kuhk\132fer&amp;quot; /&amp;gt;&lt;br /&gt;
For more ASCII character look at the [http://www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/files/ascii.htm extended ASCII table].&lt;br /&gt;
&lt;br /&gt;
===Profile - Hotkeys===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;hotkeys&amp;gt;&lt;br /&gt;
	&amp;lt;!-- to communicate with the RoM API / define ingame dummy macro at place 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;hotkey name=&amp;quot;MACRO&amp;quot;        key=&amp;quot;VK_0&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/hotkeys&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of revision 524, this option acts as a preference only. If the action key with this hotkey is available it will be used, otherwise it will automatically setup the first free available action key.&lt;br /&gt;
&lt;br /&gt;
Although your main hotkeys are configured either through settings.xml or your bindings.txt files, hotkeys for action bars are character or profile specific. &lt;br /&gt;
&lt;br /&gt;
We need only the hotkey to your [http://www.solarstrike.net/wiki/index.php5?title=RoM_Configuration#Settings_up_a_Macro ingame dummy macro].&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; | MACRO&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | The hotkey that we use to communicate with the [http://www.solarstrike.net/wiki/index.php5?title=RoM_Configuration#Settings_up_a_Macro ingame dummy macro]. We will call RoM API functions that way&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a former bot version before: You now can delete your 'old' hotkeys like RES_MACRO, LOGOUT_MACRO, ...) We don't need them anymore.&lt;br /&gt;
&lt;br /&gt;
===Profile - Skills===&lt;br /&gt;
The bot will only attempt to use skills that are noted in your profile. There are two different ways to set skills up: using the 'skills' tag (does not depend on class) or using 'skills_class' (where class is an actual in-game class) tags.&lt;br /&gt;
&lt;br /&gt;
When using the 'skills' tag, it does not mater which main class your character currently is. This works pretty well for non-class specific skills that you wish to use for either class combination. For example, MAGE_FIREBALL is usable as both a mage/priest and priest/mage. Placing MAGE_FIREBALL into this tag will allow it to be used as either mage or priest primary class.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;skills&amp;gt;&lt;br /&gt;
    &amp;lt;skill name=&amp;quot;MAGE_FIREBALL&amp;quot; hotkey=&amp;quot;VK_7&amp;quot; priority=&amp;quot;110&amp;quot; hpper=&amp;quot;30&amp;quot; inbattle=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/skills&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may often use different sets of skills for your two classes. This is when a class-specific skill tag is strongly suggested (that way you don't need to re-confgiure your profile every time you change classes). Skills placed inside this tag will only be used when it matches your primary class. For example, 'skills_mage' skills will only be used when mage is your primary class.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;skills_mage&amp;gt;&lt;br /&gt;
    &amp;lt;skill name=&amp;quot;MAGE_FLAME&amp;quot; hotkey=&amp;quot;VK_3&amp;quot; priority=&amp;quot;80&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/skills_mage&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;skills_priest&amp;gt;&lt;br /&gt;
    &amp;lt;skill name=&amp;quot;PRIEST_RISING_TIDE&amp;quot; hotkey=&amp;quot;VK_3&amp;quot; priority=&amp;quot;80&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/skills_priest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Hotkeys:'''&lt;br /&gt;
You can only use hotkeys without modifiers. Normaly that are the keys 'a-z' and '0-9'. If you want to use special keys like MINUS, PLUS, ... take a look into the file '\micromacro\lib\mods\keyboard\en_uk.lua' to find the right virtual keyname. Alternately you can assign the hotkey &amp;quot;MACRO&amp;quot;. In that case the skill will be cast by using the RoM API function 'CastSpellByName()' via the MACRO hotkey (it is not garanted, that all needed skill names are within the database file 'skills_local.xml').&lt;br /&gt;
&lt;br /&gt;
'''Skill over-rides:'''&lt;br /&gt;
You can over-ride a few options to your skills. Particularly, those skills you want to limit to only use in battle, or set to use at a certain health percent (such as heals). &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;padding: 8px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;width: 100px; border-bottom:1px dotted #000000;&amp;quot; | priority&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Higher priority means it will use it before other skills. Use 100+ for your opening attacks.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | hpper&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Percentage of HP to use the skill at. Your HP % must be below that level (or above if using '!' eg. &amp;quot;!50&amp;quot;) to use the skill. This will over-ride HP_LOW for heals!&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | manaper&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Percentage of Mana to use the skill at. Your Mana % must be below that level (or above if using '!' eg. &amp;quot;!50&amp;quot;) to use the skill.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | inbattle&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Either true or false. True means it only can be used in battle; false means if only can be used out of battle.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | targethp&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Targets HP in healthpoints has to be below this level to use the skill (or above if using '!' eg. &amp;quot;!2000&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | targethpper&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Targets HP in percentage has to be below this level to use the skill (or above if using '!' eg. &amp;quot;!50&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | rebuffcut&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Recast that skill x seconds before the cooldown/duration fades out. Thats usefull for your own buffs.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | cooldown&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Cooldown/duration value for that skill. If not set, we use the default value from the skill. You can overwrite that here for special situations.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | pullonly&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | True/False. Can only be used in the pull phase at the begin of a fight. They will not be used during the rest of the fight (only for melee classes if option 'COMBAT_RANGED_PULL' is set to 'true').&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | maxuse&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Skills with that option will only be used 'maxuse'-times within a fight.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | autouse&lt;br /&gt;
| style=&amp;quot;border-bottom:1px dotted #000000;&amp;quot; | Skills with autouse=false will not be automaticly casted from the Bot. Thats usefull if you want to cast a skill only in a event like '&amp;lt;onSkillCast&amp;gt;' .&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Profile - Events===&lt;br /&gt;
While botting, several events may be triggered. When these events are triggered, you may have custom Lua code executed. This code is placed directly in the event-specific tags inside your profile.&lt;br /&gt;
&lt;br /&gt;
Events include:&lt;br /&gt;
* onLoad : When the profile is loaded&lt;br /&gt;
* onDeath: When your character dies&lt;br /&gt;
* onLeaveCombat: When leaving combat&lt;br /&gt;
* onSkillCast: Triggered after your character uses a skill&lt;br /&gt;
&lt;br /&gt;
onSkillCast will, additionally, receive a Lua table ('arg1') that is a copy of the skill being cast. You can use this to query information about the skill. This can be useful in &amp;quot;skill chaining.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;onLoad&amp;gt;&lt;br /&gt;
        -- Load a waypoint path based on level&lt;br /&gt;
        if( player.Level &amp;gt; 10 ) then&lt;br /&gt;
            loadPaths(&amp;quot;some_path&amp;quot;);&lt;br /&gt;
        else&lt;br /&gt;
            loadPaths(&amp;quot;some_other_path&amp;quot;);&lt;br /&gt;
        end&lt;br /&gt;
    &amp;lt;/onLoad&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;onDeath&amp;gt;&lt;br /&gt;
        printf(&amp;quot;\a\a\a&amp;quot;); -- BEEP BEEP BEEP!&lt;br /&gt;
        pauseOnDeath();   -- Wait for me. Do not continue script execution&lt;br /&gt;
    &amp;lt;/onDeath&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;onLeaveCombat&amp;gt;&lt;br /&gt;
	if( player.Level &amp;gt; player.free_counter1) then&lt;br /&gt;
		player.free_counter1 = player.Level;&lt;br /&gt;
&lt;br /&gt;
		-- levelup skills&lt;br /&gt;
		-- 4 = third skill tab, 2 = mage flame&lt;br /&gt;
		if( player.Level == 2 ) then&lt;br /&gt;
			send_macro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
			yrest(1000);&lt;br /&gt;
			send_macro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
		else&lt;br /&gt;
			player.free_counter1 = player.Level;&lt;br /&gt;
			send_macro(&amp;quot;SetSpellPoint( 4, 2 );&amp;quot;);&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- open giftbag and equipt content&lt;br /&gt;
		-- updates first 18 bag slots / update all if empty&lt;br /&gt;
		open_giftbag(player.Level, 18);&lt;br /&gt;
	end&lt;br /&gt;
    &amp;lt;/onLeaveCombat&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;onSkillCast&amp;gt;&lt;br /&gt;
        if( arg1.Name == &amp;quot;PRIEST_HOLY_AURA&amp;quot; ) then&lt;br /&gt;
            yrest(1000);&lt;br /&gt;
            player:cast(&amp;quot;PRIEST_URGENT_HEAL&amp;quot;);&lt;br /&gt;
        end&lt;br /&gt;
    &amp;lt;/onSkillCast&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== In-Game Settings ==&lt;br /&gt;
In order for the bot to fully work, you will need to modify a few in-game settings. You should start with the Interface Settings and then set up your macro hotkey.&lt;br /&gt;
&lt;br /&gt;
===Interface Settings===&lt;br /&gt;
Bring up your interface settings under the System menu. Under control, make sure that '''Click-to-move''' and '''Self Cast''' are checked. Under Miscellaneous, also check '''Auto loot'''.&lt;br /&gt;
&lt;br /&gt;
===Settings up a Macro===&lt;br /&gt;
'''Important:''' As of revision 524, this step is no longer necessary. The bot can now create it's own macro in the first free available macro or find a previously setup macro. It will no longer accidentally over-write user macros either. It will also setup the actionbar key, using the user specified macro hotkey if available or the first empty key. &lt;br /&gt;
________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This macro is how the bot will interface with RoM's API. You should type ''/macro'' into the game's chat to bring up the macro window. Select the top-left most box and click '''New''', and in the new window that pops open click '''Save'''.&lt;br /&gt;
&lt;br /&gt;
It should now look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:rom_macro_screen.png]]&lt;br /&gt;
&lt;br /&gt;
Now, all you need to do is click and drag this new icon in your macro window into your hotkey bar and set your MACRO hotkey in [[RoM_Configuration#Profile_-_Hotkeys|profile hotkeys]] to reflect this change.&lt;br /&gt;
&lt;br /&gt;
Note that the macro slot directly to the right of the one you just created will also be used internally. Do not keep macros you intend to use there.&lt;br /&gt;
&lt;br /&gt;
== Expert Settings ==&lt;br /&gt;
&lt;br /&gt;
===Expert Profile - Options===&lt;br /&gt;
&lt;br /&gt;
 MAX_TARGET_DIST = 999,		-- maximum distance to select a target (helpfull to limit at small places)&lt;br /&gt;
 AUTO_ELITE_FACTOR = 4,		-- mobs with x * your HP value counts as 'Elite' and we will not target it&lt;br /&gt;
 SKILL_USE_PRIOR = 300,		-- cast x ms before cooldown is finished&lt;br /&gt;
 PK_COUNTS_AS_DEATH = true,	-- count playerkill's as death&lt;br /&gt;
 POTION_COOLDOWN = 15,		-- allways 15&lt;br /&gt;
 POTION_COOLDOWN_HP = 0,	-- will only be used if not 0, if 0 POTION_COOLDOWN will be used&lt;br /&gt;
 POTION_COOLDOWN_MANA = 0,	-- will only be used if not 0, if 0 POTION_COOLDOWN will be used&lt;br /&gt;
 WAYPOINTS_REVERSE = false,	-- use the waypoint file in reverse order&lt;br /&gt;
 MAX_DEATHS = 10,		-- maximal death if automatic resurrect befor logout&lt;br /&gt;
 WAIT_TIME_AFTER_RES = 8000,	-- time to wait after resurrection, needs more on slow PCs&lt;br /&gt;
 RETURNPATH_SUFFIX = &amp;quot;_return&amp;quot;,	-- suffix for default naming of returnpath&lt;br /&gt;
 USE_SLEEP_AFTER_RESUME = false, -- enter sleep mode after pressing pause/resume key&lt;br /&gt;
 IGNORE_MACRO_ERROR = false, 	-- ignore missing MACRO hotkey error (only temporary option while beta)&lt;br /&gt;
 DEBUG_INV = false,	 	-- to help to find the item use error (only temporary option  while beta)&lt;br /&gt;
 INV_MAX_SLOTS = 60,	 	-- maximal slots to update in the inventory:update()&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Harvesting Options ===&lt;br /&gt;
A more understandable explanation of the various harvesting options.&lt;br /&gt;
====HARVEST_SCAN_WIDTH====&lt;br /&gt;
By default, this value is set to 10. It appears to act as a percentage value, instead of a pixel value. 0-100 appears to be valid range of values. This setting determines what percentage of the screen is scanned.&lt;br /&gt;
====HARVEST_SCAN_HEIGHT====&lt;br /&gt;
See [[#HARVEST_SCAN_WIDTH|above]].&lt;br /&gt;
====HARVEST_SCAN_STEPSIZE====&lt;br /&gt;
This is a value in pixels and determines how large to skip in each scan. This value appears to only affect scanning in the horizontal direction. As this value increases, the faster the scan takes but the less accurate it becomes. By default it is set to 35.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Working_with_Quests&amp;diff=574</id>
		<title>Working with Quests</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Working_with_Quests&amp;diff=574"/>
				<updated>2010-11-15T14:56:24Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* RoM Api Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using RoMBot Functions with Quests ==&lt;br /&gt;
The number one RoMBot function you are going to need when trying to interact with quest interfaces is the sendMacro function and its relative the RoMScript function; Both of these functions allow the bot to communicate with the Runes of Magic client by running lua code through the in game macro. Functions that you will need will be listed below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''RoMScript( _script );'''&lt;br /&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;
'''sendMacro( _script );'''&lt;br /&gt;
&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;
&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 &lt;br /&gt;
&lt;br /&gt;
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;
'''player:target_Object(_objname, _waittime, _harvestall, _donotignore);'''&lt;br /&gt;
&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.(Required)&lt;br /&gt;
&lt;br /&gt;
_waittime = time to wait if the object takes time to open in ms. (Optional, default is 0)&lt;br /&gt;
&lt;br /&gt;
_harvestall = true if you wish to collect all in the immediate area.(Default is false ie. opens/collects only once)&lt;br /&gt;
&lt;br /&gt;
_donotignore = By default, when collecting multiple objects with the _harvestall option, the bot will ignore the current node when searching for the next nearest node so it can quickly move on to the next node while the current one is still disappearing. Set this option to 'true' if you don't want to ignore the current node because it requires more than 1 click to collect it. (Default is false).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
player:target_Object(&amp;quot;Harf Daily Quest Board&amp;quot;) -- Targets 'Harf Daily Quest Board' with no wait time afterward.&lt;br /&gt;
&lt;br /&gt;
player:target_Object(&amp;quot;Mysterious Mound&amp;quot;,3000) -- Target then wait 3 seconds for search to end. Done only once.&lt;br /&gt;
&lt;br /&gt;
player:target_Object(&amp;quot;Ranch Hen&amp;quot;, 8000, true, true) -- Feed all nearby hens, waiting 8s after each. And do not ignore the current hen when searching for the next closest.&lt;br /&gt;
&lt;br /&gt;
== RoM Api Functions ==&lt;br /&gt;
The following will be Runes of Magic Api functions that you can use with RoMScript and sendMacro to execute.&lt;br /&gt;
&lt;br /&gt;
'''Daily_count()'''&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
 local dqCount, dqPerDay = RoMScript(&amp;quot;Daily_count()&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Returns the number of dailies completed and the number of dailies allowed per day.&lt;br /&gt;
&lt;br /&gt;
More info: http://www.theromwiki.com/API:Daily_count&lt;br /&gt;
&lt;br /&gt;
'''OnClick_QuestListButton(1, index)'''&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;OnClick_QuestListButton(1, 3)&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Selects the quest in the index, ie quest 3 in the example.&lt;br /&gt;
&lt;br /&gt;
More info: http://www.theromwiki.com/API:OnClick_QuestListButton&lt;br /&gt;
&lt;br /&gt;
'''AcceptQuest()'''&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
 sendMacro(&amp;quot;AcceptQuest()&amp;quot;); yrest(750);&lt;br /&gt;
&lt;br /&gt;
Accepts the quest of the currently active quest window. Usually wants to be followed by a small wait.&lt;br /&gt;
&lt;br /&gt;
More info: http://www.theromwiki.com/API:AcceptQuest&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=562</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=562"/>
				<updated>2010-10-19T08:21:18Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Player Functions */&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;
 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;
== 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;
      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 target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more. 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 = By default the bot will ignore the current node when searching for the next nearest node so it can quickly move on to the next node while the current one is still disappearing. Set this option to 'true' if you don't want to ignore the current node because it requires more than 1 click to collect it. (Default is false).&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. It also accepts 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:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=Keyboard_Control&amp;diff=561</id>
		<title>Keyboard Control</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=Keyboard_Control&amp;diff=561"/>
				<updated>2010-10-19T06:34:53Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: Undo revision 560 by Rathabijian (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== keyboardPress ==&lt;br /&gt;
'''keyboardPress(key)'''&lt;br /&gt;
&lt;br /&gt;
'''keyboardPress(key, modifier)'''&lt;br /&gt;
&lt;br /&gt;
Simulates the pressing of the specified key. See [[Virtual Keys]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are running input in attached mode (through use of [[Process_Functions#attach|attach]]()) it will only send input to the target window, and will not interfere if you decide to switch windows.&lt;br /&gt;
&lt;br /&gt;
If the target program does not appear to be picking up input through the use of this function, you might try calling [[Keyboard_Control#keyboardSetDelay|keyboardSetDelay]]() somewhere in your script to increase the delay.&lt;br /&gt;
&lt;br /&gt;
'modifier' should be a second key (one of VK_CONTROL, VK_SHIFT, or VK_ALT) to use in a key combination such as ALT+1.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardPress( key.VK_ENTER ); -- The ENTER key will be pressed&lt;br /&gt;
keyboardPress( key.VK_1, key.VK_ALT ); -- Press ALT+1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keyboardHold ==&lt;br /&gt;
'''keyboardHold(key)'''&lt;br /&gt;
&lt;br /&gt;
Holds the specified key until it is pressed or released (either physically, or virtually). See [[Virtual Keys]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are running input in attached mode (through use of [[Process_Functions#attach|attach]]()) it will only send input to the target window, and will not interfere if you decide to switch windows.&lt;br /&gt;
&lt;br /&gt;
If the target program does not appear to be picking up input through the use of this function, you might try calling [[Keyboard_Control#keyboardSetDelay|keyboardSetDelay]]() somewhere in your script to increase the delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardHold( key.VK_A ); -- The A key will be held down&lt;br /&gt;
yrest(50);&lt;br /&gt;
keyboardRelease( key.VK_A ); -- The A key is now released &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== keyboardRelease ==&lt;br /&gt;
'''keyboardRelease(key)'''&lt;br /&gt;
&lt;br /&gt;
Releases the specified key. See [[Virtual Keys]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are running input in attached mode (through use of [[Process_Functions|attach]]()) it will only send input to the target window, and will not interfere if you decide to switch windows.&lt;br /&gt;
&lt;br /&gt;
If the target program does not appear to be picking up input through the use of this function, you might try calling [[Keyboard_Control#keyboardSetDelay|keyboardSetDelay]]() somewhere in your script to increase the delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardRelease( key.VK_A ); -- A is no longer being held&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== keyPressed ==&lt;br /&gt;
'''int keyPressed(key)'''&lt;br /&gt;
&lt;br /&gt;
Checks if a key is being held down or pressed. Returns a boolean: true if held/pressed, otherwise returns false. See [[Virtual Keys]] for more information.&lt;br /&gt;
&lt;br /&gt;
The check for this is done globally, meaning that you do not need to have the calling MicroMacro window, or it's attached window, focused for a keypress to register. If you only want to gather input from MicroMacro or it's attached window, use [[Keyboard_Control#keyPressedLocal|keyPressedLocal]]() instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if( keyPressed( key.VK_A ) ) then&lt;br /&gt;
  -- A is pressed. Do something!&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keyPressedLocal ==&lt;br /&gt;
'''int keyPressedLocal(key)'''&lt;br /&gt;
&lt;br /&gt;
Checks if a key is being held down or pressed. Returns a boolean: true if held/pressed, otherwise returns false. See [[Virtual Keys]] for more information.&lt;br /&gt;
&lt;br /&gt;
The check for this is done locally, meaning that you must have the calling MicroMacro window, or it's attached window, focused for a keypress to register. If you want to gather input globally, use [[Keyboard_Control#keyPressed|keyPressed]]() instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if( keyPressedLocal( key.VK_A ) ) then&lt;br /&gt;
  -- A is pressed. Do something!&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keyboardType ==&lt;br /&gt;
'''keyboardType(message)'''&lt;br /&gt;
&lt;br /&gt;
Types the message specified, as if typed by the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardType(&amp;quot;This is an example! ;)&amp;quot;);  -- This will output the following text: This is an example! ;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keyboardSetDelay ==&lt;br /&gt;
'''keyboardSetDelay(time)'''&lt;br /&gt;
&lt;br /&gt;
Sets the automatic delay between key presses and releases for functions like [[Keyboard_Control#keyboardType|keyboardType]]() or [[Keyboard_Control#keyboardPress|keyboardPress]](). 'time' is specified in miliseconds. If the target program does not appear to be picking up input well using the current delay, use this function to increase it and give the target program more time to detect the press/release. Note that it will then take longer to process the key press if you increase the delay.&lt;br /&gt;
&lt;br /&gt;
The default keyboard delay is 50ms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardSetDelay(100);&lt;br /&gt;
keyboardType(&amp;quot;This is an example! ;)&amp;quot;);&lt;br /&gt;
-- This will output the string with 100ms delay between each character&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== getKeyName ==&lt;br /&gt;
'''string getKeyName(key)'''&lt;br /&gt;
&lt;br /&gt;
Returns the symbolic name for the key specified. That is, passing key.VK_SPACE to getKeyName() will result in the function returning &amp;quot;SPACE&amp;quot;. This function is affected by your computer's language settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
printf(&amp;quot;Keyname: %s\n&amp;quot;, getKeyName(key.VK_SPACE));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keyboardBufferClear ==&lt;br /&gt;
'''keyboardBufferClear()'''&lt;br /&gt;
&lt;br /&gt;
Flushes any remaining characters left in the keyboard buffer. You typically would do this only before reading information from the standard input stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
keyboardBufferClear(); -- clear keyboard buffer&lt;br /&gt;
io.stdin:flush(); -- clear standard input buffer&lt;br /&gt;
&lt;br /&gt;
-- everything is clean, now time to read input.&lt;br /&gt;
printf(&amp;quot;Please enter your name: &amp;quot;);&lt;br /&gt;
local name = io.stdin:read();&lt;br /&gt;
&lt;br /&gt;
printf(&amp;quot;\n\nYour name is %s\n&amp;quot;, name); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=527</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=527"/>
				<updated>2010-07-07T18:22:22Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Player Functions */&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;
 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;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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);&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.(Required)&lt;br /&gt;
&lt;br /&gt;
_waittime = time to wait if the object takes time to open in ms. (Optional, default is 0)&lt;br /&gt;
&lt;br /&gt;
_harvestall = true if you wish to collect all in the immediate area.(Default is false)&lt;br /&gt;
&lt;br /&gt;
_donotignore = By default, when collecting multiple objects with the _harvestall option, the bot will ignore the current node when searching for the next nearest node. Set this option to 'true' if you don't want to ignore the current node. (Default is false).&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;Mysterious Mound&amp;quot;,3000) -- Target then wait 3 seconds for search to end. Done only once.&lt;br /&gt;
&lt;br /&gt;
player:target_Object(&amp;quot;Ranch Hen&amp;quot;, 8000, true, true) -- Feed all nearby hens, waiting 8s after each. And do not ignore the current hen when searching for the next closest.&lt;br /&gt;
&lt;br /&gt;
      player:findNearestNameOrId(_objnameorid)&lt;br /&gt;
Finds the nearest object without targeting it. Accepts the items name or id as argument. Returns the object or nil if not found.&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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=526</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=526"/>
				<updated>2010-07-07T13:29:50Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* General Functions */&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;
 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;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=525</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=525"/>
				<updated>2010-07-06T18:10:34Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* Player Functions */&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;
 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 '2' if the quest is completed and ready to be turned in, '1' if you have accepted the quest but haven't completed it yet and '0' if you have not accepted the quest. Some static variables have been set up to make it easier to use, COMPLETED, NOT_COMPLETED and NOT_ACCEPTED. For example:&lt;br /&gt;
  if getQuestStatus(&amp;quot;Strange Unity&amp;quot;) == COMPLETED then -- Turn in quest&lt;br /&gt;
&lt;br /&gt;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=524</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=524"/>
				<updated>2010-07-06T18:05:04Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: &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;
 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 '2' if the quest is completed and ready to be turned in, '1' if you have accepted the quest but haven't completed it yet and '0' if you have not accepted the quest. Some static variables have been set up to make it easier to use, COMPLETED, NOT_COMPLETED and NOT_ACCEPTED. For example:&lt;br /&gt;
  if getQuestStatus(&amp;quot;Strange Unity&amp;quot;) == COMPLETED then -- Turn in quest&lt;br /&gt;
&lt;br /&gt;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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 = CPawn(player.TargetPtr)&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 = CPawn(player.TargetPtr)&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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=523</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=523"/>
				<updated>2010-07-06T17:50:55Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: &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;
 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;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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 = CPawn(player.TargetPtr)&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 = CPawn(player.TargetPtr)&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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=458</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=458"/>
				<updated>2010-03-08T04:20:46Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: /* User Functions */&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;
 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;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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: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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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>Rock5</name></author>	</entry>

	<entry>
		<id>https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=457</id>
		<title>RoM Functions</title>
		<link rel="alternate" type="text/html" href="https://solarstrike.net/wiki/index.php?title=RoM_Functions&amp;diff=457"/>
				<updated>2010-03-08T03:22:42Z</updated>
		
		<summary type="html">&lt;p&gt;Rock5: &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;
 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;
== Player Functions ==&lt;br /&gt;
      player:harvest([&amp;quot;test&amp;quot;|id]);&lt;br /&gt;
Use 'player:harvest()' to scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). Use 'player:harvest(&amp;quot;test&amp;quot;)' to list id's of objects in front of you (e.g. quest objects), use 'player:harvest(id-nr)' to scan and use/open a object with that given object-id.&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: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;
      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);&lt;br /&gt;
Attempts to target and interact with a nearby NPC with the name given by '_npcname'. This may be used for buying potions, arrows, and more.&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: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.&lt;br /&gt;
&lt;br /&gt;
== Inventory and Item Functions ==&lt;br /&gt;
&lt;br /&gt;
 inventory:getItemCount(itemId)&lt;br /&gt;
&lt;br /&gt;
 examples:&lt;br /&gt;
 if( inventory:getItemCount(214536) &amp;gt; 25 ) then&lt;br /&gt;
    loadPaths(&amp;quot;deliver_quest&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
Get the quantity for a item directly from the games client.&lt;br /&gt;
&lt;br /&gt;
 inventory:itemTotalCount(itemNameOrId)&lt;br /&gt;
Get the quantity for a item from the cached inventory. You have to be sure, that your inventory is up to date to get the right values. You can use the item-id or the name of the item&lt;br /&gt;
&lt;br /&gt;
 inventory:useItem(itemNameOrId)&lt;br /&gt;
Use a item from the cached inventory.&lt;br /&gt;
&lt;br /&gt;
 inventory:update()&lt;br /&gt;
Update the whole inventory from the games client. Depending from you slots, that takes about 10-15 seconds. Nevertheless from using that function, the bot updates the whole inventory at the bot starting time and about 3-4 slots after every fight and about 10-15 slots while the bot is looting. &lt;br /&gt;
&lt;br /&gt;
By default the bot updates slot 1-60. If you want to use more slots please use the profile option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;120&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
Use the option&lt;br /&gt;
 &amp;lt;option name=&amp;quot;INV_MAX_SLOTS&amp;quot;	value=&amp;quot;0&amp;quot; /&amp;gt;	&amp;lt;!-- max slots for inventory scan --&amp;gt;&lt;br /&gt;
if you want to deactivate the inventory update.&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 usefull to put that at the first and at the last waypoint if you want to run between two places.&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;/div&gt;</summary>
		<author><name>Rock5</name></author>	</entry>

	</feed>