openkore inventory "<item>" <condition> <amount> [, ...] Triggers when you have…
- User
openkore
inventory "" [, ...] Triggers when you have of in your inventory. Comma-separated arguments are treated as OR conditions. Multiple lines are treated as AND conditions.
do example macro
- Assistant
To create an example macro using OpenKore's inventory condition, we will create a scenario where the macro triggers certain actions if specific conditions related to inventory items are met. Let's write a simple macro that checks if you have at least 10 Red Potions or Blue Potions in your inventory, and if so, prompts you to restock if they're low.
Here's an example macro:
macro checkInventory { # Check if you have less than 10 Red Potions OR less than 10 Blue Potions # Note: '<' condition is interpreted as less than inventory "Red Potion" < 10, "Blue Potion" < 10 # If the condition is met (either less than 10 Red Potions or less than 10 Blue Potions), execute the following: call restockPotions } automacro restockPotions { run-once 1 timeout 10 call { # Print message to the console to remind the player they need to restock. log "You are low on potions. Consider restocking!" # You can add any desired actions here, such as auto-navigating to a shop if you're using navigation plugins # do move <coordinates of the potion shop> # If you prefer automatic actions, uncomment and customize the line below to possibly buy potions if an NPC interaction is set up # do talknpc <npc location> <dialogue sequence to purchase> } }Explanation:
- The
checkInventorymacro checks your inventory. inventory "Red Potion" < 10, "Blue Potion" < 10acts as a condition to evaluate whether the number of Red Potions or Blue Potions is less than 10.- If either condition is true,
call restockPotionsexecutes the macrorestockPotions. restockPotionsis an automacro that gets triggered only once every 10 seconds (to prevent it from spamming), displaying a reminder message to restock potions.
You can modify additional actions in the
restockPotionsautomacro if you want to automate your character to visit a shop or carry out other operations. - The
- User
can you do auto sell if no money then auto buy
- Assistant
Certainly! Let's create a macro in OpenKore that will automatically sell items to a designated NPC if your money falls below a certain threshold, and then, if there is enough money, proceed to buy necessary items. This setup involves using OpenKore's macro scripting language to automate selling and buying processes.
Here's an example of how you might set up this macro:
macro autoManageFunds { # Check if Gold amount is less than a specific threshold (for example, 1000 Zeny) if ($::zeny < 1000) { log "Low on funds. Initiating sell process." call autoSellItems } else { log "Sufficient funds. Proceeding to purchase items." call autoBuyItems } } automacro autoSellItems { run-once 1 # Define the NPC location and dialog sequence to sell items location <x> <y> # Replace <x> <y> with the selling NPC's location coordinates timeout 10 call { do move <npc_x> <npc_y> do talknpc <npc_x> <npc_y> c r0 # Customize dialog sequence to sell do sell [item1, item2, ...] # Replace with actual items you wish to sell log "Items sold." } } automacro autoBuyItems { run-once 1 # Define the NPC location and dialog sequence to buy items location <x> <y> # Replace <x> <y> with the buying NPC's location coordinates timeout 10 call { do move <npc_x> <npc_y> do talknpc <npc_x> <npc_y> b r0 # Customize dialog sequence to buy do buy [item] [amount] # Replace with item name and amount log "Items purchased." } }Explanation:
-
autoManageFunds: This macro checks your current Zeny amount.
- If your Zeny is below 1000, it calls
autoSellItemsto sell specified items. - If you have enough Zeny, it calls
autoBuyItemsto purchase necessary items.
- If your Zeny is below 1000, it calls
-
autoSellItems automacro:
- This automacro handles the process of selling items to a specific NPC.
- Replace
<npc_x> <npc_y>with the coordinates of the NPC you wish to sell to. - Fill in the
do sell [item1, item2, ...]with items you want to automatically sell.
-
autoBuyItems automacro:
- This automacro manages buying items from a specific NPC.
- Replace
<npc_x> <npc_y>with the coordinates for the NPC where you are buying from. - The
do buy [item] [amount]line should specify the item and the quantity you wish to purchase.
Notes:
- Update the NPC coordinates and dialog sequences (
c r0,b r0, etc.) according to your server's specifics. - Adjust the Zeny thresholds and item lists based on your needs.
- Ensure the NPC interactions are correct to ensure the macro performs as intended on your specific server.
-
- User
can you make config.txt to sell
sellAuto_npc_steps s
- Assistant
Certainly! In OpenKore, the
config.txtfile can be used to automate the selling of items to an NPC by specifying the steps needed to interact with the NPC. Below is an example configuration snippet that includes thesellAutosettings with a simple NPC dialog sequence usingsellAuto_npc_steps s.Example
config.txtfor Auto Selling:# Auto-sell settings sellAuto 1 # Enables or disables auto-sell sellAuto_npc <x> <y> # Replace <x> <y> with the coordinates of the NPC you want to sell to sellAuto_standpoint <x> <y># Standpoint for auto-selling. Replace <x> <y> if needed, otherwise leave empty. sellAuto_distance 5 # Maximum distance from NPC to start auto-selling sellAuto_npc_type 1 # The type of NPC; usually 1 for standard shop NPCs sellAuto_npc_steps s # Steps to talk to the NPC and initiate the sell. 's' is a standard open shop command in many servers. # Items to sell sellAuto_item Apple # Replace 'Apple' with items you wish to auto-sell sellAuto_item Fluffy_Rabbit_Tail # Add more items as needed # Further options sellAuto_enable 1 # Enables auto-sell feature sellAuto_maxPrice 0 # 0 means any price is accepted. Adjust if needed. sellAuto_repair 0 # Set to 1 if you want auto-repair functionality with the NPC # Potentially other related configuration itemsMaxWeight_sellOrStore 48 % # Start selling when reaching this weight percentageExplanation of Important Settings:
- sellAuto: When set to
1, it enables the auto-sell feature. - sellAuto_npc: Coordinates of the NPC you wish your bot to go to for selling items. Replace
<x> <y>with actual coordinates. - sellAuto_npc_steps: This defines the sequence of commands your bot sends to the NPC to open the sell dialogue.
's'is a common command across most servers to initiate a sale. - sellAuto_item: Lists all the items you want to sell automatically.
- sellAuto_distance: The max distance your bot can be from the NPC to start the selling process.
- itemsMaxWeight_sellOrStore: This sets an interval to sell (or store) items when your character reaches a specific weight capacity, ensuring you're not over-encumbered.
Tips:
-
NPC Steps: The command
soften works in most Ragnarok Online servers, but if your server’s interaction with NPCs is different, you may need to adjust the steps accordingly (e.g.,b r0 nfor buying or different scripts for private servers). -
Debugging: When testing this automation, monitor how the bot interacts with the NPC to ensure the
npc_stepsare correct, as some servers may require custom commands due to unique implementations. -
NPC Locations: Use the in-game map and bot console to determine the exact coordinates of the NPC for the settings.
By setting up your
config.txtfile carefully, you should be able to automate selling and efficiently manage your inventory and Zeny. Adjust the configuration to suit the specific requirements and customizations of your server. - sellAuto: When set to
- User
example sellAuto_npc_steps s
- Assistant
To implement
sellAuto_npc_steps s, you'll need to provide a configuration that accurately details the process of interacting with an NPC to sell items in your specific Ragnarok Online server. The commandsis used here to represent a simple sale action where the NPC dialog process is straightforward.Here's an example configuration snippet that encapsulates this:
# Example auto-sell configuration in config.txt sellAuto 1 # Enable auto-sell sellAuto_npc 150 150 # Coordinates of the NPC to sell to; replace with actual coordinates sellAuto_npc_steps s # Steps to initiate the sale, typically 's' for open shop command sellAuto_distance 5 # Maximum distance from NPC to start auto-selling sellAuto_npc_type 3 # Type of the NPC; 1 and 3 are common, adjust as necessary # Define items to sell sellAuto_item Apple # Auto-sell Apple, replace 'Apple' with actual item names sellAuto_item Jellopy # Add more items as needed sellAuto_enable 1 # Ensures that auto-sell is active sellAuto_maxPrice 0 # Accept any price, adjust if necessary sellAuto_repair 0 # No auto-repair, set to 1 if repairing is needed # Trigger to sell when inventory weight reaches certain percentage itemsMaxWeight_sellOrStore 48 %Explanation:
-
sellAuto_npc: Set the NPC's coordinates that your character will go to for selling items. You must replace
150 150with the NPC's actual map coordinates where you wish to sell items. -
sellAuto_npc_steps s: This indicates the dialog step your bot will send to the NPC to initiate selling.
- The
sstands for a single command typically used to open a sale dialog. This works if the NPC's dialog requires only a single step to start selling items. - If your server requires additional steps (e.g., navigating through a menu), you'll need to adjust this sequence accordingly.
- The
-
sellAuto_item: List all the items you are interested in selling automatically. You can add multiple
sellAuto_itemlines for each item. -
sellAuto_distance: Maximum allowed distance from your bot to the NPC to trigger the selling process. Adjust as needed based on your NPC placement and environment restrictions.
-
itemsMaxWeight_sellOrStore: Configures the bot to attempt to sell or store items when reaching a certain inventory weight capacity, helping in management if your inventory is near full.
This setup assumes a simple vending process with just one interaction step. If your server has a more complex interaction sequence with NPCs (such as pressing multiple dialogue options), you'll need to adjust
sellAuto_npc_stepsto include additional steps, likeb s0orc r1 nfor more complex interactions. Always test the setup to ensure correct behavior on your specific server. Debugging may involve observing how your bot interacts with the NPC to confirm that all steps are executed appropriately. -