Difference between revisions of "RoM Auto repair"
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
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 [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. | 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 [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. | ||
Line 11: | Line 7: | ||
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. | 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. | ||
− | e.g. | + | Now you have to create a waypoint file, which leads your character to the repair NPC |
+ | |||
+ | e.g. '5-7_bugs_repair.xml' | ||
<source lang="lua"><waypoints> | <source lang="lua"><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 you need the addon ' | + | <!-- 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> | </waypoint> | ||
</waypoints></source> | </waypoints></source> | ||
− | + | 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. | |
− | <source lang="lua">player | + | |
− | + | ||
+ | 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="lua"> <!-- #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> | ||
+ | </source> | ||
− | + | or time based;<source lang="lua"> <!-- #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> | ||
+ | </source> |
Revision as of 15:12, 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>