Thread Tools Display Modes
04/29/18, 08:03 AM   #1
motorheadabega
Join Date: Apr 2018
Posts: 2
EVENT_CHAT_MESSAGE_CHANNEL issues since yesterday?

Hello , this is my first post to this forum.

I have been dabbling in lua addon scripting for ESO for a couple of weeks now and everything was coming along well. I really enjoy it. Everything was working (or at least failing with expected error messages) yesterday afternoon. At some point last night I noticed that I was not getting any output from my EVENT_CHAT_MESSAGE_CHANNEL handler.

I was tired and did not want to take apart my (rather medium sized) script, so I disabled it and wrote a new test stub as follows:

Code:
chatlog = {}
chatlog.name = "chatlog"

function chatlog:OnAddOnLoaded(event, name)
    if name == "chatlog" then chatlog:Initialize() end
end

function chatlog:Initialize()
    EVENT_MANAGER:RegisterForEvent(self.name, EVENT_CHAT_MESSAGE_CHANNEL, self.OnChatMessage)
end

function chatlog:OnChatMessage(event, channel, from, message)
  d(self.name .. ": OnChatMessage was tripped")
end

EVENT_MANAGER:RegisterForEvent(chatlog.name, EVENT_ADD_ON_LOADED, chatlog.OnAddOnLoaded)
with barebones manifest as follows:

Code:
## Title: chatlog
## Description: chat log analyzer
## APIVersion: 100022

chatlog.lua
Which did not produce any output either, so I gave up and went to bed. Now in the light of day it still does not provide output. This minimal code still looks fine to me, however, and I could swear I was successfully handling this event as recently as yesterday afternoon.

Does anyone know if there has been a change to how this event is handled? or if I'm doing it wrong? Is it working for you?

Any advice appreciated.

Thanks.

Last edited by motorheadabega : 04/29/18 at 08:17 AM. Reason: Clarifying that it still does not provide output today
  Reply With Quote
04/29/18, 08:13 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by motorheadabega View Post
Hello , this is my first post to this forum.

I have been dabbling in lua addon scripting for ESO for a couple of weeks now and everything was coming along well. I really enjoy it. Everything was working (or at least failing with expected error messages) yesterday afternoon. At some point last night I noticed that I was not getting any output from my EVENT_CHAT_MESSAGE_CHANNEL handler.

I was tired and did not want to take apart my (rather medium sized) script, so I disabled it and wrote a new test stub as follows:

*snip*

Which did not produce any output either, so I gave up and went to bed. Now in the light of day this minimal code still looks fine to me, and I could swear I was successfully handling this event as recently as yesterday afternoon.

Does anyone know if there has been a change to how this event is handled? or if I'm doing it wrong? Is it working for you?

Any advice appreciated.

Thanks.
Hi.

your OnAddOnLoaded is not correct that way:
chatlog:OnAddOnLoaded(event, name) => chatlog.OnAddOnLoaded(event, name)

Otherwise this has three parameters (the implicit self)
  Reply With Quote
04/29/18, 09:07 AM   #3
motorheadabega
Join Date: Apr 2018
Posts: 2
ThankYouThankYouThankYouThankYouThankYouThankYou

ThankYouThankYou

Your comment not only set me straight, but explained how I got so turned around late last night.

I am still struggling with the dot vs colon thing.

Many thanks again.

Cheers,
  Reply With Quote
04/29/18, 10:20 AM   #4
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
votan already explained it, but I'll give an example:

lua Code:
  1. str = "HELLO"
  2.  
  3. string.lower(str) -- uses lower's parent class string and applies the function to our argument str. GOOD
  4. str:lower() -- passes str to lower and lower assumes str is a string. GOOD
  5. str.lower() -- str does not have any functions and this will fail. BAD
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » EVENT_CHAT_MESSAGE_CHANNEL issues since yesterday?

Thread Tools
Display Modes

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