-->
Page 1 of 2

List and connect to network. 2 ways.

PostPosted: Tue Jan 26, 2016 7:07 pm
by Jokkepappa
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.

Re: List and connect to network. 2 ways.

PostPosted: Tue Jan 26, 2016 8:37 pm
by viscomjim
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.

Re: List and connect to network. 2 ways.

PostPosted: Tue Jan 26, 2016 9:19 pm
by Jokkepappa
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.

Re: List and connect to network. 2 ways.

PostPosted: Thu Jan 28, 2016 6:34 pm
by Mmiscool
Glad to see people putting together the pieces.

This is an excellent example.