Unofficial World of Warcraft Forums  
Please respect other members. Please do not post links or information about hacking/warez/cheats.
Read the rules of these forums as we rarely warn before banning. Lost or need RSS check the forum map.

Quick Site Nav
Navigation
Worldofwar.Net
WoW Forums
WoWDigger WoW Database
Articles
Community Blogs
WoW Info
Wrath of the Lich King Info
Primary Professions
Secondary Professions
Maps
Classes
PvP
A-Z Index
Guides
Submit Guides
List Guides
UI/Mods
Latest Mods
Submit Mod
List Macros
Submit Macro
Media Gallery
Gallery Home
Upload Pics
Community WoW Shots
Community BC Shots
Player Pics
Official WoW Shots
Official BC Shots


Donate and get extra forum perks
Support WoW:IncGamers

Go Back   Unofficial World of Warcraft Forums > WoW Community Forums > UI Customisation > UI/Mod Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-05-2006, 10:37 AM   #1
cypsyan
WoW: IncGamers Member
 
Join Date: May 2006
Location: noumea
Posts: 7
Auto-buying

hi everyone im looking for the script line that will able my addon to auto-buy reagent for my charac(a mage) when talking to a reagent vendor...
if anyone can tell me how to write it...
thx a lot
cypsyan is offline   Reply With Quote
Old 12-05-2006, 03:17 PM   #2
Heloxian
WorldofWar.Net Member
 
Join Date: Jan 2006
Location: Netherlands
Posts: 264
Yeah some autobuy for candles for my priest would be very nice, havent found an addon that does this tho.
Heloxian is offline   Reply With Quote
Old 08-11-2008, 09:23 PM   #3
LordAstiroth
WorldofWar.Net Member
 
Join Date: Dec 2006
Location: Houston,TX
Posts: 11
Quote:
Originally Posted by Heloxian View Post
Yeah some autobuy for candles for my priest would be very nice, havent found an addon that does this tho.
Hmm, kind of complicated guys... it takes 3 parts: part 1 is it a reagent vendor? part 2 which reagents? part 3 are you missing reagents?

local IsReagentVendor = false
local IsRepairVendor = CanMerchantRepair()
local NeedReagents = false

if GetItemCount(L["Arcane Powder"]) < addon.db.profile.RestockPowder or
GetItemCount(L["Rune of Teleportation"]) < addon.db.profile.RestockTeleport or
GetItemCount(L["Rune of Portals"]) < addon.db.profile.RestockPortals then
NeedReagents = true
end
if NeedReagents and addon.db.profile.Restock then
for i = 1, GetMerchantNumItems(), 1 do
local name, texture, price, quantity, numAvailable, isUsable, extendedCost = GetMerchantItemInfo(i)
if (name == L["Arcane Powder"] or name == L["Rune of Teleportation"] or name == L["Rune of Portals"]) then
if addon.db.profile.RestockConfirm then
StaticPopup_Show("RESTOCK_REAGENTS")
else
WittyMage:RestockReagents()
end
IsReagentVendor = true
break;
end
end
end
LordAstiroth is offline   Reply With Quote
Old 23-11-2008, 04:13 PM   #4
belleboomGD
WorldofWar.Net Member
 
Join Date: Apr 2006
Posts: 75
I use ReagentRestocker for this and I'm sure you could check their code (it can sell greys for you as well). A simple macro solution to buy 10 each of Arcane Powder and Rune of Portals would look something like this:

/run for i=1,GetMerchantNumItems() do local n,t,p,q,r,s,v=GetMerchantItemInfo(i) if (strfind(n,"Arcane Powder") or strfind(n,"Rune of Portals")) then BuyMerchantItem(i,10) end end

Last edited by belleboomGD; 23-11-2008 at 04:22 PM..
belleboomGD is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Advertisement System V2.5 By   Branden