소스 검색

globals to locals

etisab 10 년 전
부모
커밋
3ac376e79b
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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'..