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

Дайджест за октябрь-декабрь

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

Декабрь Ноябрь Октябрь

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

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

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

Бот статистики для Telegram

Удобная аналитика в телефоне.

Подробнее

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

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

Подробнее

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

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

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

LabCalendar


narinoa

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

6 часов назад, timbuktu93 сказал:

Hello,

i have an issue with the function OpenBoxFromPost(). It looks like the function goes through my bag, before the chest is added to it. So the addon seems to be faster than the game. So when i log "LogInfo(userMods.FromWString(info.name))" i can see in the mods.txt that there is no chest found in my bag. When i run the funtion manually again by removing the part and userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == GTL("Dungeon Keeper's Chest") from the function onEventAvatarItemTake(params) the chest can be opened perfectly. How can i trigger the for loop to search my bag AFTER the chest is placed in my bag?

If the problem is with the lead, then you can make a delay!
 

You need to wait 2-3 seconds before opening.

## We use a global flag and time:

local needOpenBox = false
local boxStartTime = 0

function onEventAvatarItemTake(params)
    if config['AutoUseWeaklyBoxes'] and userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == GTL("Dungeon Keeper's Chest") then
        needOpenBox = true
        boxStartTime = common.GetLocalDateTime().overallMs
    end
end

In `OnUpdateTimer` at the very beginning:

function OnUpdateTimer()
    if needOpenBox and common.GetLocalDateTime().overallMs - boxStartTime >= 3000 then
        needOpenBox = false
        boxStartTime = 0
        OpenBoxFromPost()
    end
    -- ... the rest of the OnUpdateTimer code ...
end

That's it! `OnUpdateTimer` is already being called once per second. Wait 3 seconds, then open it. We need to check!!! But that's only possible once a week. ))))

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

1 hour ago, Execryptor said:

If the problem is with the lead, then you can make a delay!
 

You need to wait 2-3 seconds before opening.

## We use a global flag and time:

local needOpenBox = false
local boxStartTime = 0

function onEventAvatarItemTake(params)
    if config['AutoUseWeaklyBoxes'] and userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == GTL("Dungeon Keeper's Chest") then
        needOpenBox = true
        boxStartTime = common.GetLocalDateTime().overallMs
    end
end

In `OnUpdateTimer` at the very beginning:

function OnUpdateTimer()
    if needOpenBox and common.GetLocalDateTime().overallMs - boxStartTime >= 3000 then
        needOpenBox = false
        boxStartTime = 0
        OpenBoxFromPost()
    end
    -- ... the rest of the OnUpdateTimer code ...
end

That's it! `OnUpdateTimer` is already being called once per second. Wait 3 seconds, then open it. We need to check!!! But that's only possible once a week. ))))

Thank you very much. This worked! I was able to test it without until next week, since i changed the function onEventAvatarItemTake for testing purposes a bit.

I just added or userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == "Rune Combiner" to the if statement and removed the { actionType = "ENUM_TakeItemActionType_Mail" } in the event handler. So it triggers any time i buy the rune combiner 🙂

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

17 часов назад, timbuktu93 сказал:

Thank you very much. This worked! I was able to test it without until next week, since i changed the function onEventAvatarItemTake for testing purposes a bit.

I just added or userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == "Rune Combiner" to the if statement and removed the { actionType = "ENUM_TakeItemActionType_Mail" } in the event handler. So it triggers any time i buy the rune combiner

Буду писать на Русском. ))) Переведешь. ))))
Ты проверял на своем.
Я проверил на том, что можно по почте отправить и что мне более доступно...
На Кадагане с мобов выпадает "Добротный джеб-преобразователь" и его можно по почте отправлять... На нем срабатывает с задержкой!!!
    ["Dungeon Keeper's Chest"] = "Сундучок хранителя подземелий",
    ["A good jab converter"] = "Добротный джеб-преобразователь",
Без задержки не открывает. Но и автор аддона в комментарии писал:
"--We can`t open the box immediately from the mail :C"
"--Мы не можем сразу открыть коробку, полученную по почте :C"
А вот с задержкой все нормально открывает.
Поэтому думаю это решит проблему. Но мне тоже нужно ждать когда придет письмо с аллода что бы проверить...
Тут используется таймер самого аддона. Он все равно тикает. Между делом и нам помогает. )))

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

49 minutes ago, Execryptor said:

Буду писать на Русском. ))) Переведешь. ))))
Ты проверял на своем.
Я проверил на том, что можно по почте отправить и что мне более доступно...
На Кадагане с мобов выпадает "Добротный джеб-преобразователь" и его можно по почте отправлять... На нем срабатывает с задержкой!!!
    ["Dungeon Keeper's Chest"] = "Сундучок хранителя подземелий",
    ["A good jab converter"] = "Добротный джеб-преобразователь",
Без задержки не открывает. Но и автор аддона в комментарии писал:
"--We can`t open the box immediately from the mail :C"
"--Мы не можем сразу открыть коробку, полученную по почте :C"
А вот с задержкой все нормально открывает.
Поэтому думаю это решит проблему. Но мне тоже нужно ждать когда придет письмо с аллода что бы проверить...
Тут используется таймер самого аддона. Он все равно тикает. Между делом и нам помогает. )))

Yeah all good, i often use google translator when i use/modify addons 😉

Yes i have tested it, with the Rune Combiner. Everytime i buy it, it goes into the if statement and prints a debug message i set before. So im pretty sure it should work. But to be 100% sure, i need to wait until thursday.

And i know, why the DelayedCall function is not working for me. It has been added to the API in the current version. And on the EU server we are always behind. 

Maybe the author didnt know, that you can insert a delay before opening, or didnt know that this was the issue. It took a while till i found out that at the time the addon runs, it does not know the new item from the mailbox. To be honest, im pretty new to addons in Allods. So everything quite complicated for me haha. I didnt even know how to print something in chat/log until a few days before axaxax 🙂 

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

1 час назад, timbuktu93 сказал:

Yeah all good, i often use google translator when i use/modify addons 😉

Yes i have tested it, with the Rune Combiner. Everytime i buy it, it goes into the if statement and prints a debug message i set before. So im pretty sure it should work. But to be 100% sure, i need to wait until thursday.

And i know, why the DelayedCall function is not working for me. It has been added to the API in the current version. And on the EU server we are always behind. 

Maybe the author didnt know, that you can insert a delay before opening, or didnt know that this was the issue. It took a while till i found out that at the time the addon runs, it does not know the new item from the mailbox. To be honest, im pretty new to addons in Allods. So everything quite complicated for me haha. I didnt even know how to print something in chat/log until a few days before axaxax 🙂 

А я и не смотрел что там есть такое теперь.
Это из нового апи наверное. В архиве с клиентом его нету. Но тут на сайте есть.
common.DelayedCall - Проще и без лишних проверок.

function onEventAvatarItemTake(params)
    if config['AutoUseWeaklyBoxes'] and userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == GTL("Dungeon Keeper's Chest") then
        common.DelayedCall(3000, OpenBoxFromPost)
    end
end

Всё! При получении письма ждем 3 секунды и открываем. Никаких таймеров и проверок в OnUpdateTimer.
Проверил все работает.
Это когда у вас появится такое. )))

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

On 8/25/2026 at 4:17 PM, Execryptor said:

А я и не смотрел что там есть такое теперь.
Это из нового апи наверное. В архиве с клиентом его нету. Но тут на сайте есть.
common.DelayedCall - Проще и без лишних проверок.

function onEventAvatarItemTake(params)
    if config['AutoUseWeaklyBoxes'] and userMods.FromWString(itemLib.GetName(params.itemObject:GetId())) == GTL("Dungeon Keeper's Chest") then
        common.DelayedCall(3000, OpenBoxFromPost)
    end
end

Всё! При получении письма ждем 3 секунды и открываем. Никаких таймеров и проверок в OnUpdateTimer.
Проверил все работает.
Это когда у вас появится такое. )))

I know this function, VladikAllods mentioned it and told me to use it. But when i tried i got an error that he doesnt know this function. So i looked it up in the API and it was there. Yesterday i found out, that this has been added in 17.1 and we are playing on 16.3. So its working for your game version fine, but not for ours.

But i have just tested it and the box got opened automatically. Finally! Thanks for you help!

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

ВНИМАНИЕ!
Обязательна информация из \Personal\Logs\mods.txt для диагностики ошибки.
Иначе вам не помочь.
В игре включите в Меню → Интерфейс → Общие настройки → Запись ошибок пользовательских дополнений. Затем запустите аддон в игре.

Присоединяйтесь к обсуждению

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

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

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

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

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

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

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

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

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

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