Jump to content

Digest Jan-Feb

We talk about what was done and updated in the past month. We help keep abreast of events.

January February

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

The Addons Updater

Let us to introduce the addons updating software and to share the details

Read more Download

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

Guest Carnifex

Recommended Posts

Guest 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.

Link to comment
Share on other sites

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" ) )()

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

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

/script MyAddon common.LogInfo( "My name is ", object.GetName( avatar.GetId() ), "." )
Link to comment
Share on other sites

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using our site you agree to the Terms of Use