RoM Auto repair
For using the autorepair ingame, you need normaly to press the 'repair' button. You can install the ingame addon 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.
You can also doing that by using the function
player:merchant( npc_name );
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.
If you only want to target a NPC and do the further stuff by yourself you can use the function:
player:target_NPC( npc_name );
Now you have to create a waypoint file, which leads your character to the repair NPC
e.g. '5-7_bugs_repair.xml'
<waypoints>
<!-- Thats a demo to interact with the NPC York Harris in Logar -->
<!-- For autorepairs without mouseclicks you need the addon 'Streamline' -->
<!-- # 1 --><waypoint x="-12282" z="11183"></waypoint>
<!-- # 2 --><waypoint x="-12391" z="10982"></waypoint>
<!-- # 3 --><waypoint x="-12529" z="10941"></waypoint>
<!-- # 4 --><waypoint x="-808" z="-6067">
player:rest(4);
player:merchant("Tracy");
player:rest(4);
load_paths("5-7_bugs_repair_back");
</waypoint>
</waypoints>
After a short rest from 4 seconds, the bot will use the waypoint file '5-7_bugs_repair_back' to find back the way to the original boting place.
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.
<!-- #16 --><waypoint x="-12364" z="10939">
if( player.Fights-player.free_counter1 > 300 ) then
player.free_counter1 = player.Fights;
load_paths("5-7_bugs_repair.xml");
end
</waypoint>
<!-- #16 --><waypoint x="-12364" z="10939">
if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end;
if( os.difftime(os.time(), player.free_counter1) > 3600 )
player.free_counter1 = player.BotStartTime_nr;
load_paths("5-7_bugs_repair.xml");
end
</waypoint>