Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WIFI = peripheral.wrap("back")
- function tlok()
- tlo = paintutils.loadImage("/aplikacje/SAPK/background.nfp")
- paintutils.drawImage(tlo, 1, 1)
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- io.write("SAPK - Application")
- term.setCursorPos(26,1)
- io.write("X")
- term.setCursorPos(7,4)
- term.setBackgroundColor(colors.lightGray)
- io.write("Otworz wejscie")
- term.setCursorPos(1,1)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- end
- tlok()
- while true do
- local event, button, x, y = os.pullEvent( "mouse_click" )
- if (button==1) and (x>=6) and (x<=21) and (y>=3) and (y<=4) then
- term.setCursorPos(1,1)
- term.clear()
- io.write("Podaj haslo: ")
- haslo = io.read()
- WIFI.transmit(50, 1, haslo)
- tlok()
- elseif (button==1) and (x==26) and (y==1) then
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- term.clear()
- term.setTextColor(colors.yellow)
- print(os.version())
- term.setTextColor(colors.white)
- break
- elseif (button==2) and (x>=6) and (x<=21) and (y>=3) and (y<=4) then
- WIFI.transmit(50, 1, "testEthernet")
- elseif (button==1) and (x>=6) and (x<=9) and (y>=7) and (y<=9) then
- WIFI.transmit(50, 1, "swiatlaWejscieWlacz")
- elseif (button==1) and (x>=18) and (x<=21) and (y>=7) and (y<=9) then
- WIFI.transmit(50, 1, "swiatlaWejscieWylacz")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement