Page 1 of 1
Storage location LUA scripts
Posted: Friday 07 October 2016 19:46
by Pauls
Hi guys,
Normally LUA scripts are stored in "domoticz/scripts/lua".
I've written some lua scripts in the domoticz internal editor but they don't apear in folder "domoticz/scripts/lua".
Are those scripts stored somewere else?
I have search in the forum but not find the answer, maybe used wrong keywords....
Thanks in advance,
Pauls
Re: Storage location LUA scripts
Posted: Friday 07 October 2016 21:42
by Egregius
Those are stored in the database.
Re: Storage location LUA scripts
Posted: Friday 07 October 2016 22:34
by Pauls
Thanks,
And what is preferable, using the internal editor or using a text editor and store in the lua directory?
Personally i like the internal editor, but i don't know the downside of this.
Any recommandations to be aware of?
Re: Storage location LUA scripts
Posted: Saturday 08 October 2016 1:08
by Dnpwwo
I would check out the wiki, specifically
http://www.domoticz.com/wiki/Domoticz_a ... ua_scripts. But there is no compelling reason to go either way. Its a personal choice.
Functionally, storing them in the database via the editor or using the file system are the same. If you aren't particularly technical then the editor is good because the database is backed up over time and your scripts are too.
If you have an editor you particularly like you may prefer to use file based. If you go file based you need to version and backup your scripts yourself.
Re: Storage location LUA scripts
Posted: Saturday 08 October 2016 5:40
by Egregius
You could consider file based

I'm addicted to speed so I did a test once.
A file base script
A database script
A script in on/off action.
They were executed in that order. So if you have 100 file scripts the database script is only triggered after those.
One should also try not to have many script files. Try to combine them or use a placeholder that call's scripts outside the lua folder.
My test also pointed that that even 100 empty scripts cause a delay of about exactly the same amount of msec.
Re: Storage location LUA scripts
Posted: Saturday 08 October 2016 9:17
by Pauls
Thanks guys, especially for your patience.
I've read that section multiple time, but probably to much focussed on the coding itself!
I will stick to the internal Ace editor, till now it served me well.