in your browser.
Help with an unusual macro?
Return to board index
This post was from a user who has deleted their account.
Likely larger than the scope of a macro. It would have to handle whatever event fires when a trade completes. You could either use HighFive's guide and make a mini-addon to do it or use something like _DevPad and write it in there.
/run local f,C=CreateFrame("Frame")f:RegisterEvent("TRADE_CLOSED")f:RegisterEvent("PLAYER_MONEY")f:SetScript("OnEvent",function(s,e)if e=="PLAYER_MONEY" and C then print(format("G: %d",floor(C-GetMoney()/10000)))C=nil else C=GetMoney() end end)
Drycoded, but it could work? (244 chars) And only prints Gold
Disclaimer being, of course, that you have to hit that macro once every time you log in to any character you want it active on. Also, if you hit it more than once, it appears that it will just create more frames and handle the same event
is the number of times you've pressed it.
If I'm reading that wrong and the latter isn't the case, I apologize for saying it was.
Yep, pelf is correct. You should just make them globals and add "if not f then ... end".
I don't understand your logic, but this seems wrong: "e=="PLAYER_MONEY" and C". The 'and' operator has higher precedence than the '==' one. You could just make that "C and e=="PLAYER_MONEY"". Also, I suggest making "PLAYER_MONEY" a variable for maximum golfage.
If you need a script to run once upon login, don't throw it in a macro. Download
, insert the script into a new page (sans the leading /run) and click the arrow next to the page's name to have it auto-run on startup.
This also gives you the benefit of not having to squish things down so far. And syntax highlighting.
local f = CreateFrame('Frame')
if e=="PLAYER_MONEY" and C then
Yeah. That's what I said
. And there's the code for it. win/win
It's bugging me, so let me just fix it.local f = CreateFrame('Frame')
if e == "TRADE_CLOSED" then
else if C then
C = (C - GetMoney())/10000
if C > 0 then
print(format("Got %dg", floor(C)))
C = -C
print(format("Gave %dg", floor(C)))
BTW, I couldn't find the API to get your tradee's (Is this a word? It should be) name. What am I missing? :|
My guess (without looking) is that it's something you have to catch when the trade opens rather than closes.
how do i make it not whisper them and instead public!
You are not logged in. Please
to post a reply or
if you don't already have an account.
Connect with Wowhead
Other Fanbyte Sites
Hearthstone Top Decks
Final Fantasy XI
© 2021 Fanbyte