Difference between revisions of "RoM Waypoint file"

From SolarStrike wiki
Jump to: navigation, search
(Waypoint types)
(Waypoint types)
Line 43: Line 43:
 
| style="border-bottom:1px dotted #000000;" | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.
 
| style="border-bottom:1px dotted #000000;" | The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.
  
This should be used to travel to "safe" locations (ie. town).|}
+
This should be used to travel to "safe" locations (ie. town).
 +
|}
  
 
== Using LUA coding with your waypoint files ==
 
== Using LUA coding with your waypoint files ==

Revision as of 16:01, 1 September 2010

Working with waypoint files

Executing createpath.lua

Start MicroMacro and execute the rom/createpath.lua script by entering

rom/createpath.lua

into your MM window. You need a valid profile for your ingame charactername and have to set the dummy macro ingame. You could also execute the script with a forced profile

rom/createpath.lua profile:default

You just walk to each point you want in your waypoint list (try to avoid walking near any trees, fences, steep hills, etc.), and press NUMPAD 1. Once you've made your round (the waypoints should loop back and bring you near the start), press NUMPAD 3. Now type in the name you want to save it as (example: 'boars' would be good enough. Don't include any slashes, and the .xml extension is automatically applied).

The new created waypointfile boars.xml will look like:

<waypoints type="NORMAL" >
	<!-- # 1 --><waypoint x="-791" z="-8322"></waypoint>
	<!-- # 2 --><waypoint x="-737" z="-8155"></waypoint>
	<!-- # 3 --><waypoint x="-552" z="-8251"></waypoint>
	<!-- # 4 --><waypoint x="-540" z="-8412"></waypoint>
</waypoints>

Waypoint types

You can determine the targeting and attacking behaviour of the bot by using waypoint types. You can add the 'type' option at the top of the waypoint file or separately for each waypoint. The default value is 'NORMAL'. If you don't specify a type at the waypoint, the waypoint will inherit the type from the <WAYPOINTS> tag at the top of the file

<waypoints type="TRAVEL" >
	<!-- # 1 --><waypoint x="-791" z="-8322"></waypoint>
	<!-- # 2 --><waypoint x="-737" z="-8155" type="RUN"></waypoint>
	<!-- # 3 --><waypoint x="-552" z="-8251" type="RUN"></waypoint>
	<!-- # 4 --><waypoint x="-540" z="-8412"></waypoint>
</waypoints>
In this example, the waypoints #1 and #4 have the type 'TRAVEL' and the waypoints #2 and #3 have the type 'RUN'


NORMAL Default value for waypoints. The bot will try to target new mobs and attack them.
TRAVEL The bot will not targeting mobs but will fight back against aggressive enemies.

This should be used when attempting to run through groups of enemies and only bothering with those that attack you, such as when you are running out to your farming spot.

RUN The bot will not targeting mobs and will not stop if he gets aggro. He will just run until he reach a waypoint with one of the other waypoint types or get a stop command within the waypoint coding.

This should be used to travel to "safe" locations (ie. town).

Using LUA coding with your waypoint files

You can insert your own lua code within a waypoint file. The lua code will be executed after you reach that waypoint. Insert the code within the tags '<waypoint></waypoint>'. It would look like:

<waypoint x="-2462" z="-9625"></waypoint>
<waypoint x="-2391" z="-9639">
	if( player.Level > 2 ) then
		loadPaths("1-10Pioneers/l3t_3-4_bear");
  	end
</waypoint>
<waypoint x="-2144" z="-9585"></waypoint>


You may also make use of an onLoad event for this waypoint script. This Lua code will be executed when the waypoint script is loaded (either automatically or by calling __WPL:load()).

<waypoints>
  <onLoad>printf("Waypoint onLoad event test.\n");</onLoad>
  <waypoint x="0"  z="0"></waypoint>
</waypoints>



You can also insert so called flags into your waypoint file. The lua code will be executed after you reach that specific waypoint.


<waypoint x="-18507" z="-2650"> 	
       if(player.free_flag1 == true) then 

player.free_flag1 = false; loadPaths("harvest_repair"); end </waypoint>

<waypoint x="-18510" z="-3007">

if(player.free_flag2 == true) then player.free_flag2 = false; loadPaths("harvest_repair"); end</waypoint>

You have to enter specific events in your Profile.xml when the flags been triggered. Lua code could be inserte in the tabs <Onload>, <Ondeath>, <OnLeaveCombat>, <Onskillcast> and <onlevelup>. If your charater dies while botting, your equiped items suffers heave damage. It would be reasonable after resurect to go straight to a mercant npc and repair all equipment.

<onDeath> local dura = inventory:getMainHandDurability(); printf("Durability:%s\n", dura); if( dura < 0.6 ) then player.free_flag1 = true; end </onDeath>

This little Code checks the durability of your Mainweapon, which is on slot 15. You can do the same procedure for any equiped item as well. If your mainweapons durability falls below 60% (in code dura < 0.6) it will change the falg player.free_flag1 true so on the. If your now insert the subroutine in your harvest_return path on every waypoint the bot will direct change from harvest_return to harvest_repair.


See the list of functions that you can use for your own coding.