Quantcast
Massive buying macro - WoWInterface
Thread Tools Display Modes
08-18-20, 07:48 PM   #1
leftleft
A Murloc Raider
Join Date: Aug 2020
Posts: 6
Massive buying macro

/run C={GetCursorInfo()}if C and (C[1]=="merchant")then BuyMerchantItem(C[2],20)PickupMerchantItem(C[2])end
You have to pick a item from merchant's list and use this macro. Then you can buy that item by 20 units.
Of course, you can edit the quantity. You can test by 1 unit.



I used this macro to buy by 1000 units. Like this,
/run C={GetCursorInfo()}if C and (C[1]=="merchant")then BuyMerchantItem(C[2],1000)PickupMerchantItem(C[2])end
  Reply With Quote
08-19-20, 11:30 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,765
Stick a local in front of your declaration of the C variable so that your macro doesn't collide with any other poorly named leaked globals also named C in any addons you use.

Code:
/run local C={GetCursorInfo()}if C and (C[1]=="merchant")then BuyMerchantItem(C[2],20)PickupMerchantItem(C[2])end
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-31-20, 09:42 PM   #3
leftleft
A Murloc Raider
Join Date: Aug 2020
Posts: 6
It's a 3 option macro which could be used often.
You can buy 1000 units by executing this macro when pressing Ctrl key, 20 units when pressing Alt key. And default quantity is 100 units.

Code:
/run C={GetCursorInfo()}if C and (C[1]=="merchant")then a=100;if IsControlKeyDown()then a=1000;end;if IsAltKeyDown()then a=20;end;BuyMerchantItem(C[2],a)PickupMerchantItem(C[2])end
  Reply With Quote
09-01-20, 03:20 AM   #4
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 789
And without making your variables 'C' and 'a' local you can run in situations that are not predictable.

Especially when you have one of the following (luckily mostly outdated) addons
C: https://www.townlong-yak.com/globe/wut/#q:C
a: https://www.townlong-yak.com/globe/wut/#q:a
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
09-18-20, 10:05 PM   #5
leftleft
A Murloc Raider
Join Date: Aug 2020
Posts: 6
There is no 255 units limitation. You can buy 1000 units fully by executing this macro when pressing Ctrl key.
You can buy 100 units when pressing Alt key.
And to buy stack by stack, default quantity is the maximum stack size of that item.( e.g) 1, 20, 200)

Code:
/run C={GetCursorInfo()}if C and C[1]=="merchant"then i=C[2]p=GetMerchantItemMaxStack(i)a=p;if IsControlKeyDown()then a=1000;end;if IsAltKeyDown()then a=100;end;t=a/p;if a<p then t=1;p=a;end;for k=1,t do BuyMerchantItem(i,p)end;PickupMerchantItem(i)end

Last edited by leftleft : 09-18-20 at 10:07 PM.
  Reply With Quote
09-18-20, 10:35 PM   #6
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 946
is it me or is this guy just repeating himself
  Reply With Quote
09-19-20, 12:10 AM   #7
leftleft
A Murloc Raider
Join Date: Aug 2020
Posts: 6
If you can't see what's the difference, sorry, it may be not for you.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Massive buying macro

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

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