Post your best Lua script examples here

User avatar
By gerardwr
#3526
gerardwr wrote:
zeroday wrote:WOW, You guys are genius!


It takes one, to recognize one ;)

I like your Lua firmware, maybe the web server is a good example to show what the firmware can do. If you have thoughts or suggestions for the web server, fell free to list them here. If I manage to get the Lua script embedding in HTML working, I'll probably finish developing the web server, and concentrate on controlling ESP features with some HTML/LUA code.

zeroday wrote:can a js lib from cdnjs.cloudflare.com be added? little experience in web program.

I'm no js expert myself, but considering the fact that js is executed on the browser in your PC, I imagine the (low performance) ESP will not be a bottleneck. In the example of alonewolfx2 some simple js lines adding the jquery library is used, that seems to work.

zeroday wrote:: the restart issue is much likely a power problem. replace it with a good one(>500mA maybe) usually fix that.


I'll try that today. The last weeks I have lived with the required resets, but now it gets annoying.[/quote]
User avatar
By gerardwr
#3531
jim121049 wrote:
alonewolfx2 wrote:new version not working for me when i click html links. i used chrome and ie but its same issue. i dont know why?


Edit line #55 in the file "webserver.lua" from "line = print(line)" to "print(line)".


Thanks Jim,

I made some minor changes, and then my hardware went on strike. Apparently one "minor change" was to mess up my code.

Thanks for solving the problem for me, I'll correct it in the next version. This section require an update to execute embedded Lua statements anyway.

Way not post your experience and suggestions the web server code for us?
User avatar
By jim121049
#3536
gerardwr wrote:
jim121049 wrote:
alonewolfx2 wrote:new version not working for me when i click html links. i used chrome and ie but its same issue. i dont know why?


Edit line #55 in the file "webserver.lua" from "line = print(line)" to "print(line)".


Thanks Jim,

I made some minor changes, and then my hardware went on strike. Apparently one "minor change" was to mess up my code.

Thanks for solving the problem for me, I'll correct it in the next version. This section require an update to execute embedded Lua statements anyway.

Way not post your experience and suggestions the web server code for us?

I'll post when I have something to add but I'm way new to this.
What's supposed to happen when I click on "htmllua.html" in the webserver's list of files?