Buy items

Description

Buys items at an NPC until you meet the necessary amount given.
(Works together with the supply checker!)

Requirements

OTCv8 version: 1.6 (possibly lower, cannot guarantee compatibility with lower versions)
Tibia version: 8.00-11.00
Backpacks need to be open.
Additionally: Using the supply checker from this page: http://bot.otclient.ovh/books/scripts/page/supply-checker

Usage

Copy script: buyitems.lua to the config map in: %appdata%\OTClientV8\otclientv8\bot\YOURCONFIG

In the walker use the following code (can take away the lines with -- in front):

Without supply checker:

label:buyStars
follow:Atrad
function:function(waypoints)
  -- Here you put your item first and the amount second
  -- return buyItems(YOUR ITEM, YOUR MAX AMOUNT)  
  return buyItems(7368, 300)
end


With supply checker:

label:buyStars
follow:Atrad
function:function(waypoints)
  -- Here you put your item first and the amount second
  -- return buyItems(YOUR ITEM, YOUR MAX AMOUNT) 
  -- In this example we get from the supply checker the otherSupply1 (Assassin stars)  
  return buyItems(storage.otherSupply1.item, storage.otherSupply1max)
end

If you are using the supply checker, you can make use of the items put at the panel in the supply checker.

Author

DiscordSyndru#4623