Difference between revisions of "RoM Auto repair"
Line 10: | Line 10: | ||
e.g. '5-7_bugs_repair.xml' | e.g. '5-7_bugs_repair.xml' | ||
− | <source lang=" | + | <source lang="xml"><waypoints> |
<!-- Thats a demo to interact with the NPC York Harris in Logar --> | <!-- Thats a demo to interact with the NPC York Harris in Logar --> | ||
<!-- For autorepairs without mouseclicks you need the addon 'Streamline' --> | <!-- For autorepairs without mouseclicks you need the addon 'Streamline' --> | ||
Line 28: | Line 28: | ||
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. | 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. | ||
− | It could be fight based:<source lang=" | + | It could be fight based:<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> |
if( player.Fights-player.free_counter1 > 300 ) then | if( player.Fights-player.free_counter1 > 300 ) then | ||
player.free_counter1 = player.Fights; | player.free_counter1 = player.Fights; | ||
Line 36: | Line 36: | ||
</source> | </source> | ||
− | or time based;<source lang=" | + | or time based;<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> |
if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end; | if(player.free_counter1 == 0) then player.free_counter1 = os.time(); end; | ||
if( os.difftime(os.time(), player.free_counter1) > 3600 ) | if( os.difftime(os.time(), player.free_counter1) > 3600 ) |
Revision as of 18:00, 25 August 2009
For using the autorepair ingame, you need normaly to press the 'repair' button. You can do this by using the 'player:mouseclickL();' function within the bot. Or you just 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 open the ingame dialog window with a NPC with the function:
player:target_NPC( 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. It will also work while using multiple bots.
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:target_NPC("Tracy");
player:rest(4);
load_paths("5-7_bugs_repair_back");
</waypoint>
</waypoints>
If the merchant is found, the store window would open and streamline will autorepair. 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>