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

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

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

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

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

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

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

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

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

Подробнее

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

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

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

How to run a String as lua sourecode or how to write a comandline for Allods


Гость Carnifex

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

A few months ago, I started to write an addon, but because of a lag of time a doesn't finished it yet and I think, I will not have the time for doing this in the near future. Because of this, I will share the beginnings (I know it is in a very early state and the most work is based on icreators work for how to add messages to the chat box with little modification) and maybe someone of you can continue it...

I started to write an addon, which runs every lua code, which you write in the in-game chat box after a "/cmd" (you can find some example here), which is unfortunately the whole functionality in the current version of the addon (look at the attachement).

But the intention of the addon was, to create a single place for all gui-less addon/scrips for allods online, splitted into to types: one which register events (you can turn then on and off...) e.g. AutoSetLootScheme and one you only run once after pressing the button (e.g. invite all players in range). So developers should get a new place to write little addon directly ingame and "normal" users a place to easily manage a catalog of gui-less addons.(Í also still planned to solve the problem with the double use of global variables by replacing all of them internal with ones mapped into a table indexed with the name of the addon...). But for all of this I have not enough time atm and I think the text is long enough so here is my prototype (It's very simple atm, so only a test of the basic idea):

Edit: Ok, I see Setras had a similar idea too, but nobody had created an addon out of it, but it would be in my opinion a nice to have tool also without the peer to peer updating thing.

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

Code:
Global( "ADDON_NAME", common.GetAddonName() )
common.RegisterEventHandler( function( event )
local a, b, addonname, text = string.find( userMods.FromWString( event.text ), "/script%s*(%a+) %s*(.+)" )
if addonname == ADDON_NAME then
common.LogInfo( ADDON_NAME, text )
assert( loadstring( text, "runtime call" ) )()
end
end, "EVENT_UNKNOWN_SLASH_COMMAND" )


Usage: type in chat line: "/script *AddonName* *code*"

Example:
Code:
/script MyAddon common.LogInfo( "Hello world!" )

Code:
/script MyAddon common.LogInfo( "My name is ", object.GetName( avatar.GetId() ), "." )
Ссылка на комментарий
Поделиться на другие сайты

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

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

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

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

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

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

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

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

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