buyAuto: Difference between revisions

From OpenKore Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 2: Line 2:


== Syntax ==
== Syntax ==
  buyAuto [<item name>] {
  buyAuto <item name> {
        maxAmount (<amount>)
maxAmount <amount>
        minAmount [<amount>]
[minAmount <amount>]
        npc (<map name> <x> <y>)
npc <map name> <x> <y>
        distance [<number>]
[npc_steps <[[References#NPC Conversation Codes|NPC talk codes]]>]
        standpoint [<map name> <x> <y>]
[distance <number>]
        zeny [<amount>]
[standpoint <map name> <x> <y>]
[zeny <amount>]
        # [[References#Self Conditions|Self Conditions]]
[<[[References#Self Conditions|Self Conditions]]>]
  }
  }


Line 16: Line 17:
----
----


; buyAuto [<[[References#Item Names|item name]]>]
; buyAuto <[[References#Item Names|item name]]>
: This option specifies the item to automatically buy from a buy/sell NPC.
: This option specifies the item to automatically buy from a buy/sell NPC.




; maxAmount (<amount>)
; maxAmount <amount>
: 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 <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.
: 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.


Line 32: Line 33:




; npc (<[[References#Map Names|map name]]> <x> <y>)
; 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.
: 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_steps <[[References#NPC Conversation Codes|NPC talk 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.
: This option specifies how far Kore will stand from the item buy/sell NPC during auto-buy.




; standpoint [<[[References#Map Names|map name]]> <x> <y>]
; standpoint <[[References#Map Names|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.
: 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 [<[[References#Range Operators|range]]>]
; zeny <[[References#Range Operators|range]]>
: If this option is set, the item will only be bought if your zeny is within the specified range.  
: If this option is set, the item will only be bought if your zeny is within the specified range.  



Revision as of 19:35, 16 May 2010

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

Syntax

buyAuto <item name> {
	maxAmount <amount>
	[minAmount <amount>]
	npc <map name> <x> <y>
	[npc_steps <NPC talk codes>]
	[distance <number>]
	[standpoint <map name> <x> <y>]
	[zeny <amount>]
	
	[<Self Conditions>]
}

Attribute definitions


buyAuto <item name>
This option specifies the item to automatically buy from a buy/sell NPC.


maxAmount <amount>
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>
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.


npc_steps <NPC talk 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.


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
}