JocysCom / TextToSpeech

Jocys.com Text To Speech Monitor and WoW Addon - Reads quests and chat messages with text-to-speech voices.
https://www.jocys.com/TTS
GNU Lesser General Public License v3.0
28 stars 11 forks source link

error when someone messages me #31

Closed raykai closed 6 years ago

raykai commented 6 years ago

i get an error when someone messages me do note im using Elvui https://www.tukui.org/download.php?ui=elvui as so many other ppl do.

here is the error i get: 12x ...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW-7.3.0.lua:397: bad argument #1 to 'find' (string expected, got nil) [C]: in function `find' ...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW-7.3.0.lua:397: in function <...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW.lua:255>

Locals: (temporary) = nil (temporary) = "-" (*temporary) = "string expected, got nil"

VJocys commented 6 years ago

In new WoW Addon version 2.2.93 (2017-11-30) I changed:

dashIndex = string.find(arg2, "-"); to... if arg2 ~= nil then dashIndex = string.find(arg2, "-") end

I hope, this will solve the problem.

VJocys commented 6 years ago

Slightly updated code line 397 in WoW Addon version 2.2.95 if arg2 ~= nil then dashIndex = string.find(arg2, "-") else dashIndex = nil end

raykai commented 6 years ago

seems fixed ty

raykai commented 6 years ago

I'm still getting an error when some one battlenet message me:

2x ...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW-7.3.2.lua:489: Usage: UnitSex("unit")
[C]: in function `UnitSex'
...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW-7.3.2.lua:489: in function `JocysCom_SpeakMessage'
...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW-7.3.2.lua:417: in function <...ysCom-TextToSpeech-WoW\JocysCom-TextToSpeech-WoW.lua:255>

Locals:
(*temporary) = nil
VJocys commented 6 years ago

Updated code related to Battle.net messages in WoW Addon version 2.2.96 (2017-12-02). I guess, error occurred, when messages arrived from people, who were not in game at that moment, therefore in-game character name and everything related to that (like gender) was "nil".