-
Member
Need help with macro for selling to vendor
Good day to all.
Please help me with macro to sell things from bags to vendor, sale should be in parts, for example 5 items at a time, because server has a limit on mass sale, when trying to use macro to sell all things throws out of the game.
I have a macro that sells everything at once, please help to remake it.
Code:
/run for bag=0,4,1 do for slot=1, GetContainerNumSlots(bag),1 do local name=GetContainerItemLink(bag,slot); if name and string.find(name,'ff9d9d9d') then UseContainerItem(bag,slot) end; end; end;
Wow version 1.12.1. Server lightshope.
Thank you in advance for your help!
P.S. Sorry for my english
-
Member
Understood himself. I had to write an addon that sells things at a set interval of time. Lay out, can anyone come in handy. I'm not a connoisseur in WoW programming, but how much I figured out, wrote so much, main thing that works. There is one problem, during the sale of things, the entire WoW interface hangs while the script is running. Can someone tell me how to make a delay without hanging the game interface.
Wait(sec) function:
Code:
function My_Wait(sec)
local My_currentTime = GetTime();
while ( My_currentTime + sec > GetTime() ) do
-- here we do not write anything
end
end
Selling Function: (Called from XML file in opening event of vendor window)
Code:
function sellthings()
for i = 1,8 do UseContainerItem(0,i) end
My_Wait(1) -- enter time in seconds
for i = 9,16 do UseContainerItem(0,i) end
My_Wait(1)
for i = 1,6 do UseContainerItem(1,i) end
My_Wait(1)
for i = 1,6 do UseContainerItem(2,i) end
My_Wait(1)
for i = 1,6 do UseContainerItem(3,i) end
My_Wait(1)
for i = 1,6 do UseContainerItem(4,i) end
end
Made this addon for myself, i think you will understand with slots of bags
P.S.
Once again i apologize for my english
Last edited by djanius; 11-26-2017 at 03:26 AM.
-
Post Thanks / Like - 1 Thanks
Deepoly (1 members gave Thanks to djanius for this useful post)