Post your best Lua script examples here

User avatar
By gerardwr
#3921
zeroday wrote:Neat!! That's the true power of lua.


Yes it is!

BTW : The elua webserver is now ported to nodeMcu (see in the Examples section).

I think I will migrate my work on the webserver to this migrate elua code. The code looks very professional and a quick check shows that it works rather nicely!
User avatar
By derrij
#4064 will be great to have web user interface for connecting to WiFi network.
trying to make it like
Code: Select all <!DOCTYPE html>
<html>
<body>

<form action="wifi.html">
First name:<br>
<input type="text" name="SSID" value="Mickey">
<br>
Last name:<br>
<input type="text" name="PASS" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>

</body>
</html>


how to read user input?
Code: Select allif string.match(s, "wifi.html") == "wifi.html" then
conn:send(s)
 end


may be some one has done user interface and i trying to "make bicycle".

UPDATE:

And would like to have universal settings for upload URL.
Image

not sure what can handle this.
hard for me to parse and extract 3 necessary variables: host ,page , value
User avatar
By ddrscott
#11097
gerardwr wrote:BTW : The elua webserver is now ported to nodeMcu (see in the Examples section).


The only http examples I see are in: https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_modules/http, and that code doesn't look anything like the elua code at: http://wiki.eluaproject.net/lhttpd. Some functionality which is missing from the port are <%lua/> tag parsing and extension to content-type map.

Can you provide a link to the code that you ported?

Otherwise, I'll try to port from http://wiki.eluaproject.net/lhttpd.