Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | andreu33 |
func _on_YELLOW_request_completed(result, response_code, headers, body):
if response_code==0:
print("CAN NOT CONNECT TO THE SERVER.")
return
var response_body = JSON.parse(body.get_string_from_ascii()).result as Dictionary
var json = JSON.parse(body.get_string_from_ascii())
for i in response_body.fields:
data.append(i)
for ii in response_body.fields\[i\]\["arrayValue"\]\["values"\].size():
for iii in response_body.fields\[i\]\["arrayValue"\]\["values"\]\[ii -1\]:
data.append(response_body.fields\[i\]\["arrayValue"\]\["values"\]\[ii -1\]\[iii\])
print(data)
var num = int(data\[2\])
var num2
if data\[1\] == "true":
num2 = num / 5
else:
num2 = num
YELLOW\[int(data\[0\])\] = \[num2,data\[3\],data\[4\],data\[5\],data\[6\],data\[7\],data\[8\]\]
data.clear()
ganarate_yellow()
this is what it writes in print(data)
what it should write