Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Jokkepappa
#39785 Hey. Thought somebody would have use for these so i'll post them here:

With html table and javascript. Click the SSDI to select it. No need to type:

Image
Code: Select allwprint "SSID: "
textbox networkSSID
textboxID = HTMLID()
html |<script>function selectWifi(ssid){document.getElementById('|
html textboxID
html |').value = ssid;}</script>|

wprint "<br>Password: "
passwordbox networkPW
wprint "<br>"
button "Scan for networks" [doScan]
button "Connect" [connectWifi]
wprint "<br>"
wait

[doScan]
    n = wifi.scan()
    n = n - 1
    n = replace(n,".00","")
    html "Number of network found = "
    html n
    html |<table border="1">|
    for x = 1 to n
    html |<tr><td onClick="selectWifi('|
    html wifi.ssid(x)
    html |');">|
    html wifi.ssid(x)
    html "</td><td>"
    html wifi.rssi(x)
    html "</td></tr>"
    next x
    html |</table>|
wait

[connectWifi]
connect networkSSID networkPW
wait


And here with dropdown without javascript.
Image

Code: Select allbutton "Scan for networks" [doScan]
wprint "<br>"
wait

[doScan]
        let listWifis = ""
    n = wifi.scan()
    n = n - 1
    html "Number of network found = "
    html n

    for x = 1 to n
    let listWifis = listWifis & wifi.ssid(x)
    let listWifis = listWifis & ","
    next x
    wprint "<br>Select SSID: "
    dropdown listWifis selectedWifi
    wprint "<br>Password: "
    passwordbox networkPW
    button "Connect" [connectWifi]
   
wait

[connectWifi]
connect selectedWifi networkPW
wait


Hope this helps somebody.
User avatar
By Jokkepappa
#39794
viscomjim wrote:Hi Jokkepappa, all I can say is...

B R I L L I A N T!!!!

I will be playing with this tonight.

Thank you for this!!!!!! Great work.


You're welcome and have fun. I sure did.
User avatar
By Mmiscool
#39904 Glad to see people putting together the pieces.

This is an excellent example.