Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-23-22, 02:11 PM   #1
BustleNation
A Defias Bandit
Join Date: Nov 2022
Posts: 3
C_Timer.After() not sending messages in Open World

Hi all - I am very new to programming in general and would appreciate any insight or help

I am working on an addon that will tell a joke in two parts when a button is pressed. The second part coming after a 5 second delay. Doing some searching it seems like C_Timer.After() is what I'm looking for. Inside of an instance it works correctly. However in the open world it is giving me the error "Interface action failed because of an Addon"

Here is the code that I have:

Code:
f.JokeButton:SetScript("OnClick", function()
  f.JokeButton:Disable()
  SendChatMessage("Why did the chicken cross the road?", "SAY")
  C_Timer.After(5, function () SendChatMessage("to get to the other side", "SAY") end)
  C_Timer.After(5, function () f.JokeButton:Enable() end)
end)
The C_Timer.After works for re-enabling the button after 5 seconds - just not for saying the second part ("to get to the other side").


I'd appreciate any thoughts! Thanks!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » C_Timer.After() not sending messages in Open World


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off