Difference between revisions of "RoM Auto repair"
Line 1: | Line 1: | ||
+ | = 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 [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 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 67: | Line 69: | ||
You also could combine some of that methods. | 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. | ||
+ | |||
+ | {| | ||
+ | |- style="padding: 8px;" | | ||
+ | | style="width: 200px; border-bottom:1px dotted #000000;" | INV_AUTOSELL_ENABLE | ||
+ | | style="border-bottom:1px dotted #000000;" | Allows you to enable or disable the Auto Sell function. Valid values are true|false.. | ||
+ | |- | ||
+ | | style="border-bottom:1px dotted #000000;" | INV_AUTOSELL_FROMSLOT | ||
+ | | style="border-bottom:1px dotted #000000;" | Starting bagslot for autosell. | ||
+ | |- | ||
+ | | style="border-bottom:1px dotted #000000;" | INV_AUTOSELL_TOSLOT | ||
+ | | style="border-bottom:1px dotted #000000;" | Ending bagslot for autosell. | ||
+ | |- | ||
+ | | style="border-bottom:1px dotted #000000;" | INV_AUTOSELL_QUALITY | ||
+ | | style="border-bottom:1px dotted #000000;" | Enter the item qualities you want to sell. Recommended value is "white, green". | ||
+ | |- | ||
+ | | style="border-bottom:1px dotted #000000;" | INV_AUTOSELL_IGNORE | ||
+ | | style="border-bottom:1px dotted #000000;" | 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. |
Revision as of 23:24, 14 October 2009
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.
<!-- # 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>
<!-- #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>
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.