Post your best Lua script examples here

User avatar
By alonewolfx2
#3380
gerardwr wrote:
alonewolfx2 wrote:looks pretty :) but lua have ram problem. i think i dont use my project before solved.


Yes, I can understand that. I like a challenge, so I'm happy to experiment.

can you send new example? i would like to try
User avatar
By gerardwr
#3381
alonewolfx2 wrote:can you send new example? i would like to try


Sure, here it is "as is".
The zip file contains 3 files
- webserver.lua to upload to init.lua on the ESP
- 2 test HTML files to upload to the ESP

You can also upload your own .html files. They will show on the "home page", and be "clickable".

Clicking a .html file shows the standard page, INCLUDING the content of the HTML file. Next change I will make is that the HTML file is shown on a separate blank page.

Clicking a .lua file does nothing (yet). A next version will execute the LUA code in it.

If you have any thoughts, let me know.
Attachments
(1.45 KiB) Downloaded 382 times
User avatar
By alonewolfx2
#3383 its cool :) I did not know we could send html files directly. i think we can gpio operations or pwm on the webserver. right?
User avatar
By alonewolfx2
#3384 There's something missing. There's no header. It look likes normal html pages on ie or safari but chrome dont like :) we need header on webserver. (text/html)