Перейти к содержанию

Дайджесты за январь-февраль

Обновления гайдов и аддонов

Январь Февраль

Мониторинг серверов и редактор аддонов

Представляем вам две легенды. То, о чем можно было только мечтать, стало реальностью.

Мониторинг серверов Редактор аддонов

Подсказки из игры на вашем сайте

Теперь вы можете отображать сведения о внутриигровых элементах простым наведением курсора мыши.

Подробнее

Апдейтер аддонов

Представляем вам программу для автообновления аддонов и делимся подробностями.

Подробнее Скачать

My ChatLog(name) is logging it twice per execution, is it something the event does?


Dragagon

Рекомендуемые сообщения

My ChatLog(name) is logging it twice per execution, is it something the event does? If it is, why does it do it twice?
I am also getting a lot of Fail (un)register event messages in my mods.txt, I don't see what I am doing different from past addons I made.
Any help or explainations would be appreciated.

 

function Main()

    raidMembersTable = userMods.GetGlobalConfigSection("RessCounter_settings")

    --ChatLog(userMods.GetGlobalConfigSection("RessCounter_settings"))

--common. RegisterEventHandler(RessRequest, "EVENT_RESURRECT_REQUESTED") --https://alloder.pro/md/LuaApi/EventResurrectRequested.html 

-- resurrecterName: WString is the name of the unit trying to revive the player.

-- unitId: ObjectId (not nil) - The ID of the unit trying to revive the player.

-- timeOutMs: number (integer) - how many milliseconds this prompt is valid

--common. RegisterEventHandler(ResurrectReply, "EVENT_RESURRECT_REQUESTED") --https://alloder.pro/md/LuaApi/FunctionAvatarResurrectReply.html

common. RegisterEventHandler(StartAction, "EVENT_ACTION_PROGRESS_START") --https://alloder.pro/md/LuaApi/EventActionProgressStart.html

common. RegisterEventHandler(OnChat, "EVENT_UNKNOWN_SLASH_COMMAND")

end

function StartAction(params)

--common. UnRegisterEvent("EVENT_ACTION_PROGRESS_START")

    name = userMods.FromWString(params.name)

    ChatLog(name)

local targetTrue = avatar. GetTarget()

    if targetTrue then

target = userMods.FromWString(object. GetName(avatar. GetTarget())) --Get target when start casting the ress.

    end

--ChatLog("\nEvent_action_progress_start parameters \nSpell: ".. name.." \nspellID: ".. tostring(spellId).." \nprogress: ".. progress.." \nDuration: ".. duration.." \nlaunchwhenready state: ".. tostring(launchWhenReady).." \nisPrecast: ".. tostring(isPrecast)..

--"\nisChannel: ".. tostring(isChannel))

    --ChatLog(target)

    if name == "Gift of Tensess" then

common. RegisterEventHandler(Interrupt, "EVENT_PROCESS_TERMINATED") -- https://alloder.pro/md/LuaApi/EventActionProcessTerminated.html

--common. RegisterEventHandler(FinishAction, "EVENT_ACTION_PROGRESS_FINISH") --https://alloder.pro/md/LuaApi/EventActionProgressFinish.html

        --name = ""

    end

   

end

mods.txt

Изменено пользователем Dragagon
Ссылка на комментарий
Поделиться на другие сайты

Event EVENT_ACTION_PROGRESS_START is invoked twice per action pretty much always. So it's ok to receive twice the amount of log messages.

You should not try to register the same handler for the same event more than once. And you should not try to unregister something you does not registered earlier. Keep track of what you are registering for what event yourself. There is no method to check events registrations.

Ссылка на комментарий
Поделиться на другие сайты

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Восстановить форматирование

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...

Важная информация

Пользуясь сайтом, вы принимаете Условия использования