Difference between revisions of "RoM Auto repair"
Line 31: | Line 31: | ||
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. | ||
+ | |||
+ | |||
+ | == Use a Durability Based AutoRepair = | ||
It could be based on the duration of your items:<source lang="xml"><!-- # 1 --><waypoint x="13752" z="6726"> | It could be based on the duration of your items:<source lang="xml"><!-- # 1 --><waypoint x="13752" z="6726"> | ||
Line 50: | Line 53: | ||
</onLeaveCombat></source> | </onLeaveCombat></source> | ||
+ | |||
+ | == Use a Time Based AutoRepair = | ||
It could be fight based:<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> | It could be fight based:<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> | ||
Line 58: | Line 63: | ||
</waypoint> | </waypoint> | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | == Use a Time Based AutoRepair = | ||
or time based;<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> | or time based;<source lang="xml"> <!-- #16 --><waypoint x="-12364" z="10939"> |
Revision as of 23:26, 14 October 2009
Contents
Auto Repair at the merchant NPC
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 Tracy -->
<!-- # 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:merchant("Tracy");
load_paths("5-7_bugs_repair_back");
</waypoint>
</waypoints>
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.
= Use a Durability Based AutoRepair
It could be based on the duration of your items:<!-- # 1 --><waypoint x="13752" z="6726">
if( player.free_flag1 == true ) then
player.free_flag1 = false;
loadPaths("5-7_bugs_repair.xml);
end
</waypoint>
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.
<onLeaveCombat>
local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if( dura < 0.9 ) then
player.free_flag1 = true;
end
</onLeaveCombat>
= Use a Time Based AutoRepair
It could be fight based: <!-- #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>
= Use a Time Based AutoRepair
or time based; <!-- #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>
You also could combine some of that methods.
Auto Sell at the merchant NPC
There are some expert options for your profile if you want to automaticly sale items to the merchant NPC.
INV_AUTOSELL_ENABLE | Allows you to enable or disable the Auto Sell function. Valid values are true|false.. |
INV_AUTOSELL_FROMSLOT | Starting bagslot for autosell. |
INV_AUTOSELL_TOSLOT | Ending bagslot for autosell. |
INV_AUTOSELL_QUALITY | Enter the item qualities you want to sell. Recommended value is "white, green". |
INV_AUTOSELL_IGNORE | Enter items names or part of the names of items, you don't want to sell. You can enter more than one item. Use commata as delimites. |
Use the normal 'player:merchant()' function in your waypoint file to autosale your items.