WarcraftReamls.com
  FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister 
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 
LUA Error When Mailbox Is Opened...

 
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> CensusPlus UI Mod Bugs
View previous topic :: View next topic  
Author Message
BJRubino



Joined: 16 Feb 2007
Posts: 22
Location: Soquel, CA
WR Updates: 276,195
BJRubino WR Profile

PostPosted: Wed Sep 02, 2009 4:01 pm    Post subject: LUA Error When Mailbox Is Opened... Reply with quote

Hi,
I am getting the following error when I have a CensusPlus scan going and then I open the mailbox...

Addons\CensusPlus\CensusPlus.lua line 310: bad argument #1 to 'strmatch' (string expected, got nil)

Any idea on this one?

Thanks,
BJR
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Thu Sep 03, 2009 2:12 pm    Post subject: Reply with quote

After taking a quick glance at the code, it looks like a null (empty) chat message was sent by something, which CensusPlus isn't expecting (hence, the error). I don't get any errors when opening the mailbox, so what's causing it is likely an AddOn you have loaded that works with the mailbox in some manner (and, for some reason, is sending an empty chat message).

Does the census still run / complete after the error pops up? If so, then you should be able to safely ignore the error for now.

As for a fix, I am not sure if null chat messages are considered "valid", but CP should probably ignore them in any case. Since I don't know if it is more appropriate to immediately pass the null message up the chain or to go through the remainder of the code in the function for any state-change triggers, I'll just do a....

/rolliesignal

Smile
Back to top
View user's profile Send private message
BJRubino



Joined: 16 Feb 2007
Posts: 22
Location: Soquel, CA
WR Updates: 276,195
BJRubino WR Profile

PostPosted: Thu Sep 03, 2009 2:43 pm    Post subject: Thanks... Reply with quote

Heya,

Thanks for the info..I have a few addons that are mail related...so that could be the cause.
As to the scan, it does seem to finish the scan, the other problem I noticed though is that once this error comes up, the chat frame goes dead. Once I get the error, I am unable to see emotes, NPC dialog, chat channel posts (i.e. General, Trade, etc...) and anything printed from addons.

BJR
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Fri Sep 04, 2009 12:40 am    Post subject: Reply with quote

Hmm. I was hoping that wouldn't happen, but it unfortunately makes sense.

If you don't want to live without whichever mail-related addon is actually causing this, and Rollie doesn't pop by soon with another suggestion, I can give you a couple of lines to temporarily insert into the censusplus lua code that should bypass the error, anyway.

I don't know of a way to "reset" the code for just the chat frame, but if you reload the UI (/console reloadui), that will reset everything including the chat. Of course, that takes some time, depending on the number of add-ons you have, and it will throw another error the next time the same add-on sends another empty chat message.
Back to top
View user's profile Send private message
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Fri Sep 04, 2009 4:14 pm    Post subject: Reply with quote

I was taking a closer look at the CensusPlus function, and noticed a simple one line edit that would solve the problem. To test, I whipped up something to generate null chat messages, but I was unable to trigger the error. One of the other addons I have loaded is probably eating the null messages before they get to CP.

Anyway, I made the edit to CP, and scans are still working for me, so it should be safe for you to try, if you are willing.

Locate the file "CensusPlus.lua" located in the "Interface/AddOns/CensusPlus" directory, located within your WoW directory, and open it with a text editor.

If you are using Windows, then Notepad is not a good text editor! If you don't have anything else, then WordPad should work without mangling the file.

Anyway, in CensusPlus.lua, go to line 296. If your editor doesn't have a "go to line number" feature, then search for "-- Chat msg hook" (without the quotes), then scroll down eight lines. Here's what that part of the file looks like, with the relevant line marked with asterisks:
Code:
----------------------------------------------------------------------------------
--
-- Chat msg hook
--
---------------------------------------------------------------------------------
local function CP_HookAddMessage(frame)
   local AddMessage = frame.AddMessage;
   -- Create a closure to cleanly hook the AddMessage routine.
   frame.AddMessage =
   function (this, msg, r, g, b, id)
****      if( g_TrackUnhandled or g_IsCensusPlusInProgress ) then    ****
         local s, e;
         local results = { };
         local whoMsg = false;
--CensusPlus_Msg2( "Something : " .. msg );         

Edit or replace the highlighted line so that it looks like the following:
Code:
      if( (g_TrackUnhandled or g_IsCensusPlusInProgress) and msg ) then


Save the file (if offered a choice to convert it, keep it as plain text), and fire up WoW to see if the error has stopped. If you still get an error, or get another error, let us know.
Back to top
View user's profile Send private message
BJRubino



Joined: 16 Feb 2007
Posts: 22
Location: Soquel, CA
WR Updates: 276,195
BJRubino WR Profile

PostPosted: Fri Sep 04, 2009 6:54 pm    Post subject: Reply with quote

Thanks for the info; I will give it a try.

A few new things happened while I was playing. The error was always on my bank alt, so I was never killing mobs. While playing my main, I noticed that I also get the error when any type of loot comes up. For example, I got the error when I looted a mob and I also got it when I opened the NPC vendor window.

I am not sure if this help determine anything new about the error or not.

Anyways, thanks for your help & I will see if this change works for my situation.

Thanks,
BJR
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
BJRubino



Joined: 16 Feb 2007
Posts: 22
Location: Soquel, CA
WR Updates: 276,195
BJRubino WR Profile

PostPosted: Fri Sep 04, 2009 7:19 pm    Post subject: Reply with quote

OK, I think I found the culprit...I downloaded a mod from WoWInterface.com called "Cashier". This addon is supose to give you customizable gold gain/loss messages. It seems that if it is enabled, I get this CensusPlus error, but if I disable Cashier, the errors stop happening.

BJR
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Fri Sep 04, 2009 7:40 pm    Post subject: Reply with quote

I'm glad you found the (probable) culprit. With the additional information, it sounds like the addon is sending an empty chat message whenever it's triggered by a new window (frame) opening.

I'd say it's likely a bug with Cashier. My guess without looking at it is that it is looking for money loot events as well as vendor purchases / sales (and similar money from the mail), but is still sending a (blank) message even if your gold amount didn't change (i.e., it didn't set up the gain / loss message, but still tried to send the non-existent message).
Back to top
View user's profile Send private message
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Fri Sep 04, 2009 8:07 pm    Post subject: Reply with quote

FYI, I found what was masking the null messages for me, and verified that I get the same error as you with the "stock" CensusPlus, and that my change fixes it so the error doesn't appear any more.

In some of my own code, originally written in the 2.1 era, I notice I made sure I didn't ever send null messages to the chat frame, but I don't remember whether that was to avoid errors at the time, or whether I was just programming defensively. In any case, it appears that the current default chat handler doesn't care.
Back to top
View user's profile Send private message
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Mon Sep 07, 2009 7:16 pm    Post subject: Reply with quote

Thanks for the info on that one, I'll incorporate it in the next update!
Back to top
View user's profile Send private message Visit poster's website
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Wed Sep 09, 2009 1:42 am    Post subject: Reply with quote

Good deal! Glad I could help. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> CensusPlus UI Mod Bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
WarcraftRealms.com  


Powered by phpBB © 2001, 2005 phpBB Group