Macro to cancel all auctions in one click not working
  • sephirothsephiroth February 2009
    Hello everyone.

    I checked this wiki http://wiki.norganna.org/Auctioneer/Saving_Time_With_Macros and i found a really nice macro that should permit to cancel all my auctions in one click.

    -----------------------
    This macro from MentalPower cancels all auctions (the line is wrapped to enhance readability, remove the newlines when you use this):

    /script local o="owner"for i=1,GetNumAuctionItems(o)do
    local _,_,_,_,_,_,_,_,b=GetAuctionItemInfo(o,i)local
    t=GetAuctionItemTimeLeft(o,i)if(t==2)and(b==0)then CancelAuction(i)end end
    -----------------------

    Well, problem is i simply cannot make this macro work.

    I copy the text into a new macro, i create a name and an icon, i put the macro in one of my bars but when i click it... nothing happens. No errors generated, but the auctions are still all there. Am i missing something?

    Thanks, Cla.
  • DeckardDeckard February 2009
    Posted By: sephiroth
    Well, problem is i simply cannot make this macro work.

    Did you remove the new lines and make it one continuous macro line? Try that if you haven't. Also, make sure you have the AH open and you're viewing the Auctions tab when you run this macro, I think that's necessary too. I assume you were already doing that though.
  • sephirothsephiroth February 2009
    Yes. I copypasted the first line in the macro text pane. Then i pressed the space bar and i copypasted the second line. Then i pressed the space bar and i copypasted the third and last line.

    Ofc i tried to run the macro with the AH window opened and the Auctions tab selected, still nothing happens. :(

    Cla.
  • sephirothsephiroth February 2009
    Corrige.

    That macro still don't work, but probably the macro i need is

    ----------------------------
    This macro will cancel all auctions (a) that have not been sold, (b) that have no bids, and (c) that have less than 12hrs left:

    /script
    local o="owner" p=GetNumAuctionItems(o) i=p
    while (i>0) do
    local _,_,c,_,_,_,_,_,_,b,_,_=GetAuctionItemInfo(o,i) t=GetAuctionItemTimeLeft(o,i)
    if((c>0)and(b==0)and(t<4))then<br /> CancelAuction(i)
    end
    i=i-1
    end
    ------------------------------------

    In order to try it, what parameter i have to change to make it cancel the auctions that have less than 24 hours left?

    Cla.
  • sephirothsephiroth February 2009
    Ok, found it (that's t<8, probably for 48 hours its t<16) and... the macro works!!!<br />
    /cry
    /dance

    Still the first macro won't work :( but i don't recommend it since it probably also cancels the auctions sold and the auctions with bids.

    Cla.
  • HirsuteHirsute February 2009
    Developer
    You are actually missing a lot of spaces there that should have been there. Try the following, instead:
    /script local o="owner"for i=1,GetNumAuctionItems(o)
    do local _,_,_,_,_,_,_,_,b=GetAuctionItemInfo(o,i)
    local t=GetAuctionItemTimeLeft(o,i) if (t==2) and (b==0) then CancelAuction(i) end end


    Combine those three lines with a space between them (make sure there's a space between "o)" and "do" and between "i)" and "local")

    If this doesn't work, let's look at what the addon is supposed to do, to make sure that we're all on the same page:

    Posted By: sephiroth
    /script local o="owner"for i=1,GetNumAuctionItems(o)do


    This tells the game to cycle through all the auctions you have posted

    local _,_,_,_,_,_,_,_,b=GetAuctionItemInfo(o,i)


    This stores whether or not the auction has been sold in the variable "b"

    local t=GetAuctionItemTimeLeft(o,i)


    This stores which "time left" category the auction falls in (a number from 1 to 4) in the variable "t"

    if(t==2)and(b==0) then CancelAuction(i)end end


    This says: If there's a time left of "2" (30 minutes to 2 hours) for this auction and the auction has not been purchased (b == 0), then cancel the auction.

    So this macro will cancel all your auctions that haven't been purchased that have between 30 minutes and 2 hours left and haven't already sold. If trying the code I specified above doesn't cancel anything, make sure you have auctions that meet these conditions and post back.
  • HirsuteHirsute February 2009
    Developer
    Posted By: sephiroth
    Ok, found it (that's t<8, probably for 48 hours its t<16) and... the macro works!!!<br />

    /cry
    /dance

    Still the first macro won't work :( but i don't recommend it since it[strong]probably[/strong]also cancels the auctions sold and the auctions with bids.

    Cla.


    This is slightly incorrect. You can determine time left on auctions according to the following:

    Time left category--How much time left
    1--0 to 30 min
    2--30 min to 2 hours
    3--2 hours to 12 hours
    4--More than 12 hours

    You can't cancel only those auctions that have fewer than 24 hours left. You can cancel auctions that have fewer than 30 mins left (t == 1), those auctions that have fewer than 2 hours left (t<3), those auctions that have fewer than 12 hours left (t<4) or all auctions, regardless of time (t<5). You can cancel according to other time conditions (t==3 will cancel only those auctions that have between 2 and 12 hours, for example) as well, but the server doesn't tell the client which auctions have fewer than 24 hours left. It tells the client which addons have fewer than 12 hours, and which have more than 12, but you have no way of knowing if an auction that has more than 12 hours actually has 24, 27, 35, or 47 hours left. It's all just "More than 12"
  • YanickYanick March 2009
    If it may help, this is a macro I use to cancel all glyph auctions I own:

    /run local i=1;local n=1;while n ~= nil do local b=0;n,_,_,_,_,_,_,_,b=GetAuctionItemInfo("owner",i);if n~=nil and strfind(n,"^Glyph of") then CancelAuction(i) end i=i+1 end
  • QeyliaQeylia June 2009
    Ok got this to work finally.

    /script local o="owner" p=GetNumAuctionItems(o) i=p while (i>0) do local _,_,c,_,_,_,_,_,_,b,_,_=GetAuctionItemInfo(o,i)if ((c>0)and(b==0)) then CancelAuction(i) end i=i-1 end

    Now how can I incorporate the strfind(n,"^Glyph of") as in it like the code above so it only will cancel my glyphs and nothing else?

    I can't seem to get it work properly in the code below:

    /script ;local n=1;local o="owner" p=GetNumAuctionItems(o) i=p while (i>0) do local _,_,c,_,_,_,_,_,_,b,_,_=GetAuctionItemInfo(o,i)if strfind(n,"^Glyph of") and ((c>0)and(b==0)) then CancelAuction(i) end i=i-1 end
    local n=1
Privacy · Advertising
Norganna's AddOns Network · World Of Minecraft · WoM Realms · Auctioneer Addon · Gatherer Addon · Addon Forums · RDRCT