What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[help needed] ProfessionBuddy card making profile

deusx

Member
Joined
Feb 1, 2010
Messages
206
Reaction score
5
Ok so i am on my way of making professionbuddy profile that mills herbs, and then makes fortune cards of ashen pigments and darkmoon cards out of burning embers.
Now my prob is when i mill the herbs and make blackfallow ink i have X amount of ink and i need PB to go buy the same amount of parchments in order to make fortune cards.
So i use a buy item method for parchments and try to put (InbagCount(blackfallow ID here)) as count argument but it won't accept it. That's cool, but you might want to add it in future releases.
So now i make a loop
Code:
while (InbagCount(blacfallow ink ID)>InbagCount(parchments ID)
buy item: parchment x 1
Won't work. It buys random amount of parchments and exits the loop. I.E i have 200 inks, he buys 15, 40, sometimes 100 parchments then exits loop.
Then i figure it might be lag issues between buying and item appearing in backpack so i add
Code:
while (InbagCount(blacfallow ink ID)>InbagCount(parchments ID)
buy item: parchment x 1
wait(false) timeout:2000
And still same problem. Random amounts of parchments are bought before loop is exited.

Anyone can help me out on this one?
 
Or at least code for custom action that will do buying
 
'k, got some quick 'n dirty code for you:

long version, in lua:
Code:
local tobuy = GetItemCount(ITEMIDOFYOURINKHERE);
local buyid = ITEMIDOFYOURPARCHMENTHERE;
if MerchantFrame:IsVisible() then
	local buyindex = nil;
	for i = 1,GetMerchantNumItems() do
		if GetMerchantItemLink(i) then
			if tonumber((select(2,strsplit(':', string.match(GetMerchantItemLink(i), 'item[%-?%d:]+'))))) == buyid then
				buyindex = i
			end
		end
	end
	if buyindex then
	for b = 1,tobuy do
		BuyMerchantItem(buyindex, 1);
	end
end

custom action, one line!:
Code:
Lua.DoString("local tobuy = GetItemCount(ITEMIDOFYOURINKHERE); local buyid = ITEMIDOFYOURPARCHMENTHERE; if MerchantFrame:IsVisible() then local buyindex = nil; for i = 1,GetMerchantNumItems() do if GetMerchantItemLink(i) then if tonumber((select(2,strsplit(':', string.match(GetMerchantItemLink(i), 'item[%-?%d:]+'))))) == buyid then buyindex = i end end end if buyindex then for b = 1,tobuy do BuyMerchantItem(buyindex, 1); end end");

I think you can figure out where you have to edit in the item id's of your parchment & ink.
This code is untested, so please test it before using it in a public profile.
 
why don't do an InbagCount(itemid) check and just buy stuff from ah ?
 
Back
Top