Quellcode durchsuchen

globals to locals

etisab vor 10 Jahren
Ursprung
Commit
3ac376e79b
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      BUILD/sendYo.lua

+ 3 - 3
BUILD/sendYo.lua

@@ -3,16 +3,16 @@ file.open("yorecipient.txt", "r")
 print("sending yo to "..file.readline())
 file.close()
 wifi.sleeptype(wifi.NONE_SLEEP)
+wifi.setmode(wifi.STATION)
 
 function generateContentString()
 	file.open("yorecipient.txt", "r")
 	return "api_token=0c6ac771-71fa-420f-810c-2853989a8ca6&username="..string.upper(file.readline())
 end
 
-wifi.setmode(wifi.STATION)
+local contentString = generateContentString()
+local contentLength = string.len(contentString)
 
-contentString = generateContentString()
-contentLength = string.len(contentString)
 http.post(
 	'https://api.justyo.co/yo/',
 	'Content-Type: application/x-www-form-urlencoded\r\n'..