Данный сайт активно использует технологию JavaScript.
Пожалуйста, включите JavaScript в вашем браузере.
Тема «Classic»
Тема «Thottbot»
Help with an unusual macro?
Ответить
Вернуться на главную страницу форума
Сообщение от
1025907
This post was from a user who has deleted their account.
Сообщение от
pelf
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.
Сообщение от
janniie
/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
Сообщение от
pelf
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
n
times where
n
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.
Сообщение от
HighFive
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 golf
age.
Сообщение от
Neffi
If you need a script to run once upon login, don't throw it in a macro. Download
Devpad
, 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')
local C
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)
Сообщение от
pelf
Yeah. That's what I said
:)
. And there's the code for it. win/win
Сообщение от
HighFive
It's bugging me, so let me just fix it.local f = CreateFrame('Frame')
local C
f:RegisterEvent("TRADE_CLOSED")
f:RegisterEvent("PLAYER_MONEY")
f:SetScript("OnEvent",function(s,e)
if e == "TRADE_CLOSED" then
C=GetMoney()
else if C then
C = (C - GetMoney())/10000
if C > 0 then
print(format("Got %dg", floor(C)))
else
C = -C
print(format("Gave %dg", floor(C)))
end
C=nil
end
end)
BTW, I couldn't find the API to get your tradee's (Is this a word? It should be) name. What am I missing? :|
Сообщение от
pelf
My guess (without looking) is that it's something you have to catch when the trade opens rather than closes.
Сообщение от
Thearksrainbow
how do i make it not whisper them and instead public!
Сообщение от
kc99
<a href="
https://1680380.com/view/fcssq/index.html"
title="福彩双色球">福彩双色球</a>
<a href="
https://1680380.com/view/jisuft/pk10kai.html"
title="极速飞艇">极速飞艇</a>
Ответить
Вы не авторизованы.
Войдите
или
зарегистрируйтесь
, чтобы оставить сообщение.