Difference between revisions of "buyAuto"

From OpenKore Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by 8 users not shown)
Line 1: Line 1:
; buyAuto [<[[References#Item Names|item name]]>]
+
Automatically buys specified item from a buy/sell NPC when the defined conditions are met.
: Kore can automatically buy an item from a buy/sell NPC when the amount of that certain item goes below a minimum value. This option specifies the item to automatically buy from a buy/sell NPC.
 
  
'''Syntax:'''
+
== Syntax ==
  buyAuto [<item name>] {
+
  buyAuto <item name> {
        maxAmount (<amount>)
+
maxAmount <[[number]]>
        minAmount [<amount>]
+
isMarket <[[boolean]]>
        npc (<map name> <x> <y>)
+
[minAmount <[[number]]>]
        distance [<number>]
+
npc <[[References#Map_Names|map name]]> <x> <y>
        standpoint [<map name> <x> <y>]
+
[npc_steps <[[NPC conversation codes]]>]
        zeny [<amount>]
+
[distance <[[number]]>]
+
[standpoint <[[References#Map_Names|map name]]> <x> <y>]
        # [[References#Self Conditions|Self Conditions]]
+
[zeny <[[References#Range_Operators|range]]>]
 +
[onlyIdentified <boolean>]
 +
[disabled <boolean>]
 +
[<[[:Category:Self Condition|Self Conditions]]>]
 
  }
 
  }
  
 +
=== Attribute definitions ===
  
''' Attribute definitions: '''
+
; buyAuto <item name>
 +
: This option specifies the item to automatically buy from a buy/sell NPC.
  
:; maxAmount (<amount>)
+
; maxAmount <number>
:: This option specifies the maximum amount of item in inventory that you need. Kore will buy an amount equal to the difference between the specified maximum amount and the current amount in inventory.
+
: This option specifies the maximum amount of item in inventory that you need. Kore will buy an amount equal to the difference between the specified maximum amount and the current amount in inventory.
  
:; minAmount [<amount>]
+
; minAmount <number>
:: If this option is set, this specifies the minimum amount of item in inventory before the auto-buy sequence is automatically triggered. Kore will go to the NPC when the number of the specified items left in inventory is less than or equal to this amount.
+
: If this option is set, this specifies the minimum amount of item in inventory before the auto-buy sequence is automatically triggered. Kore will go to the NPC when the number of the specified items left in inventory is less than or equal to this amount.
  
::: '''''Note:'''''
+
:: '''Note:'''
:::* If you don't want Kore to automatically go back to town to buy this item, but you DO want Kore to buy this item when it's in town for another reason, then leave minAmount empty.
+
::* If you don't want Kore to automatically go back to town to buy this item, but you DO want Kore to buy this item when it's in town for another reason, then leave minAmount empty.
:::* Once Kore is in auto-buy sequence, Kore will automatically check the rest of the buyAuto blocks if you need to buy the items specified in those blocks.
+
::* Once Kore is in auto-buy sequence, Kore will automatically check the rest of the buyAuto blocks if you need to buy the items specified in those blocks.
  
:; npc (<[[References#Map Names|map name]]> <x> <y>)
 
:: This option specifies the location of a buy/sell NPC that sells the item. This NPC must have the item available for purchase.
 
  
:; distance (<number>)
+
; npc <map name> <x> <y>
:: This option specifies how far Kore will stand from the item buy/sell NPC during auto-buy.
+
: This option specifies the location of a buy/sell NPC that sells the item. This NPC must have the item available for purchase.
  
:; standpoint [<[[References#Map Names|map name]]> <x> <y>]
+
; isMarket <boolean>
:: If this option is set, Kore will stand on the specified location when buying this item instead of anywhere near the item buy/sell NPC itself. The attribute distance will be ignored.
+
: This option specifies if NPC type is [https://ragnarok.gamepedia.com/Para_Market Para Market].
  
:; zeny [<[[References#Range Operators|range]]>]
+
; npc_steps <NPC conversation codes>
:: If this option is set, the item will only be bought if your zeny is within the specified range.  
+
: Specifies the NPC talk sequence. If not set, sequence for default store/sell NPC "b e" is used.
  
 +
; distance <number>
 +
: This option specifies how far Kore will stand from the item buy/sell NPC during auto-buy.
  
''' Examples '''
+
; standpoint <map name> <x> <y>
 +
: If this option is set, Kore will stand on the specified location when buying this item instead of anywhere near the item buy/sell NPC itself. The attribute distance will be ignored.
  
* Go to town to buy 70 Orange Potions when there are no more in the inventory.
+
; zeny <[[References#Range_Operators|range]]>
 +
: If this option is set, the item will only be bought if your zeny is within the specified range.
 +
 
 +
; onlyIdentified <boolean>
 +
: With this key buyauto will only sum identified items. Appeared in [https://github.com/OpenKore/openkore/pull/3645 PR#3645].
 +
 
 +
== Examples ==
 +
Go to town to buy 70 Orange Potions when there are no more in the inventory.
 
  buyAuto Orange Potion {
 
  buyAuto Orange Potion {
 
  maxAmount 70
 
  maxAmount 70
Line 50: Line 62:
 
  }
 
  }
  
* Buy 100 Red Potions when Kore is in a town
+
Buy 100 Red Potions when Kore is in a town
 
  buyAuto Red Potion {
 
  buyAuto Red Potion {
 
  maxAmount 100
 
  maxAmount 100
Line 60: Line 72:
 
[[Category:config.txt]]
 
[[Category:config.txt]]
 
[[Category:items]]
 
[[Category:items]]
 +
[[Category:config block]]

Latest revision as of 00:31, 20 January 2023

Automatically buys specified item from a buy/sell NPC when the defined conditions are met.

Syntax

buyAuto <item name> {
	maxAmount <number>
	isMarket <boolean>
	[minAmount <number>]
	npc <map name> <x> <y>
	[npc_steps <NPC conversation codes>]
	[distance <number>]
	[standpoint <map name> <x> <y>]
	[zeny <range>]
	[onlyIdentified <boolean>]
	[disabled <boolean>]
	[<Self Conditions>]
}

Attribute definitions

buyAuto <item name>
This option specifies the item to automatically buy from a buy/sell NPC.
maxAmount <number>
This option specifies the maximum amount of item in inventory that you need. Kore will buy an amount equal to the difference between the specified maximum amount and the current amount in inventory.
minAmount <number>
If this option is set, this specifies the minimum amount of item in inventory before the auto-buy sequence is automatically triggered. Kore will go to the NPC when the number of the specified items left in inventory is less than or equal to this amount.
Note:
  • If you don't want Kore to automatically go back to town to buy this item, but you DO want Kore to buy this item when it's in town for another reason, then leave minAmount empty.
  • Once Kore is in auto-buy sequence, Kore will automatically check the rest of the buyAuto blocks if you need to buy the items specified in those blocks.


npc <map name> <x> <y>
This option specifies the location of a buy/sell NPC that sells the item. This NPC must have the item available for purchase.
isMarket <boolean>
This option specifies if NPC type is Para Market.
npc_steps <NPC conversation codes>
Specifies the NPC talk sequence. If not set, sequence for default store/sell NPC "b e" is used.
distance <number>
This option specifies how far Kore will stand from the item buy/sell NPC during auto-buy.
standpoint <map name> <x> <y>
If this option is set, Kore will stand on the specified location when buying this item instead of anywhere near the item buy/sell NPC itself. The attribute distance will be ignored.
zeny <range>
If this option is set, the item will only be bought if your zeny is within the specified range.
onlyIdentified <boolean>
With this key buyauto will only sum identified items. Appeared in PR#3645.

Examples

Go to town to buy 70 Orange Potions when there are no more in the inventory.

buyAuto Orange Potion {
	maxAmount 70
	minAmount 0
	npc morocc 147 102
	distance 8
}

Buy 100 Red Potions when Kore is in a town

buyAuto Red Potion {
	maxAmount 100
	minAmount
	npc morocc 147 102
	distance 8
}