#Please help!

17 messages · Page 1 of 1 (latest)

silk wigeon
#

I'm getting the error message in the picture shown, with this lua code. what am i doing wrong

function()
local gold = GetTradePlayerItemInfo(7)
if gold ~= nil and gold > 0 then
local message = "Thanks for the trade! You gave me " .. gold .. " gold!"
SendChatMessage(message, "SAY")
end
end

cloud perch
#

Init doesn't expect a function.
It wouldn't run when you have trade open though so the fix wouldn't be to get it working properly in Init

silk wigeon
#

@cloud perch I apologize, im new to this what do i need to do to fix it? could you possibly make a weakaura for me?

cloud perch
#

I'm afraid I'm too busy right now

#

!starterkit

daring krakenBOT
silk wigeon
#

what would i have to do to fix it

cloud perch
#

You need to use a custom trigger, running on the relevant events

silk wigeon
#

i made a custom trigger no lua errors but when i did the action it didnt work

cloud perch
#

Ensure it's running when you need it to. Use the correct event(s) and add prints to see how far the code gets

silk wigeon
#

okay thank you for the help, ill keep try i suppose im getting frustrated and overwhelmed trying to code

keen pumice
#

If you want this aura to work in the open world you can't use the "SAY" chat channel

#

"SAY" and "YELL" are only useable inside instances

#
Wowpedia

Frame Events are messages sent by the WoW client to UI code (via OnEvent script handlers), mostly in reaction to things occurring in the game world. For a general tutorial on setting up event handling in your addon, see Handling events and the Frame:RegisterEvent() method.
They can be debugged with the /etrace command.

silk wigeon
#

would i have to create an add on then?

keen pumice
#

no you can respond to events with custom triggers

silk wigeon
#

i know this alot to ask.. and i could pay someone for their time but can someone help me make one 😦