# Item Limits

This plugin offers the possibility to limit the amount of an Item you can buy. With this you can choose the restock time as well.

For the Refresh Time there are the following options (they are case insensitive)

* "daily"
* "2daily"
* "weekly"
* "random" (between 1 and 7 Days)
* "never" (like it says, it'll never restock)

```ruby
def pbSomeMart
  pbPokemonMart(["Daily",
    [:POKEBALL, 15, 20], [:GREATBALL, 10, 15], [:ULTRABALL, 5, 10],
    [:POTION, 10, 15], [:SUPERPOTION, 8, 12], [:HYPERPOTION, 5, 8], [:MAXPOTION, 2, 5],
    :FULLRESTORE, [:REVIVE, 1, 4],
    [:ANTIDOTE, 5], :PARALYZEHEAL, :AWAKENING, :BURNHEAL, :ICEHEAL,
    :FULLHEAL,
    :REPEL, :SUPERREPEL, :MAXREPEL,
    :ESCAPEROPE
  ], useCat: true)
end
```

Each Item that you want to have a limit needs to be in it's own array \[ ] including the item, a min and a (optional) max value.&#x20;

* When you provide a min and a max value, the limit amount will be a random number between this min and max value generated by the script.
* When you don't provide a max value, the max value will be equal to the min value so the limit amount will always be the same.
* When you don't want a limit amount at all of an Item, simple leave it as it is (so without \[ ]).

<div align="left"><figure><img src="/files/uF0FuDIkQrHOMHt57CD1" alt="" width="375"><figcaption><p>Item Limit Max Buyable</p></figcaption></figure></div>

The max we can buy is 14, so once we do this, the Item will be out of stock.&#x20;

<div align="left"><figure><img src="/files/wE1T1lowlrICOAl4n5vN" alt="" width="375"><figcaption><p>Item Limit Out of Stock</p></figcaption></figure></div>

When we would try to buy another of this item, it would give us a message saying how long we have to wait for a restock.&#x20;

This depends on the days that have passed since the Item is out of stock and the Refresh Time you have set for this mart.&#x20;

<div align="left"><figure><img src="/files/nzeYoZmu6ZEQw406mPpC" alt="" width="375"><figcaption><p>Item Limit Out of Stock Message</p></figcaption></figure></div>

{% hint style="info" %}
If you want to quickly restock all stores, you can now use `forcePokemonMartRefresh` to refresh the stock of all stores.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arckytech.gitbook.io/arckys-poke-mart-guide/settings-and-setup-file/item-limits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
