Where can I get basic information about .lp files and how to write/use them? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Where can I get basic information about .lp files and how to write/use them? (/showthread.php?tid=4106) |
Where can I get basic information about .lp files and how to write/use them? - rbourgeon - 22.06.2022 Hello, I was very interested by this message and by the two scripts it contains: https://forum.logicmachine.net/showthread.php?tid=2680&pid=17210#pid17210 As I understand, it is possible to a .lp file stored at the path /www/user/filename.lp by running HTTP request http://<LM_IPadress>/user/filename.lp?parameter1=value1&...¶meterN=valueN. But there are a lot of things I don't understand:
RE: Where can I get basic information about .lp files and how to write/use them? - Daniel - 22.06.2022 https://forum.logicmachine.net/showthread.php?tid=85 RE: Where can I get basic information about .lp files and how to write/use them? - Erwin van der Zwart - 22.06.2022 An .lp file is a html file that contains client side LUA and when placed in the user folder you can open this .lp file with the browser If it contains only html code it would just show as an html page in the browser but when adding client side LUA into the HTML and JS code you get a powerful tool to do really cool stuf like fetching object, alert and storage data from the controller, run queries on the DB, setup a WS to get a stream of changes and the ability to write back to objects and storage. The <? .. ?> are used to “embed” the LUA code into the HTML and JS code. require(“apps”) loads lots of needed libs and are documented in the link above from Daniel. I think dbenv (lib to have acces / run a query on the DB of the controller) is now also included in apps and not needed to specify separately anymore but not 100% sure. |