
So I think I am getting my head wrapped around esp8266 basic. I wonder if someone can confirm that my assumptions below are correct (or incorrect).
1. All variables are global
2. All labels are global i.e. you can gosub any [label] no matter which script file you are in
3. The "default" script always runs at start up
4. Currently there is no way to list script files through the web interface
5. Currently there is no way to read the status of an output pin
6. Comments in code start with " ' "
7. When a user goes to the index url they are presented with the last state of the "canvas" the script is not re-run? i.e. just loading http://mylocalesp82266 does nothing other than displaying the screen buffer?
Here is my "Hello World" The hardware device is a an outlet with a relay attached to pin 14 of the esp8266 it is designed to turn my Chrsitmas tree on and off.
Script File: default
'//stat is the tracking variable for the output pin state it is set here because on power on pin 14 will always be in a known state and from there we track the variable every time we change states
let stat = 0
let pin = 14
load outlet '//load outlet file
Script File: outlet
[main]
if stat = 1 then goto [ison] '// if it's on display the lit Christmas tree image with a turn off button
if stat = 0 then goto [isoff]'//if it is off display the unlit Christmas tree image with a turn on button
let stat = 0
goto [main]
wait
[isoff] '//Display the unlit Christmas tree image with a turn on button
cls
'//The wprint below makes the image zoom to fill the mobile screen size
wprint "<meta name='viewport' content='width=device-width, initial-scale=2'>"
image "treeoff.png"
wprint "<br>"
button "Turn on" [turnon]
wait
[ison] '// Display the lit Christmas tree image with a turn off button
cls
wprint "<meta name='viewport' content='width=device-width, initial-scale=2'>"
image "treeon.png"
wprint "<br>"
button "Turn off" [turnoff]
wait
[turnon] '//turn it on
po pin 1
let stat = 1
goto [main]
[turnoff] '//turn it off
let stat = 0
po pin 0
goto [main]
Image Files:
Tree off

Tree on

I know this code is a bit crude any comments or suggestions would be greatly appreciated.
Thanks,
J