Spaces:
Sleeping
Sleeping
Update turbowarp-server/qr-converter.py
Browse files
turbowarp-server/qr-converter.py
CHANGED
|
@@ -7,7 +7,7 @@ import scratchcommunication
|
|
| 7 |
import traceback
|
| 8 |
|
| 9 |
# --- Turbowarpクラウド接続 ---
|
| 10 |
-
PROJECT_ID = 1293416663
|
| 11 |
tw = scratchcommunication.TwCloudConnection(
|
| 12 |
project_id=PROJECT_ID,
|
| 13 |
username="server",
|
|
@@ -133,7 +133,10 @@ while True:
|
|
| 133 |
tw["n1"] = pkt
|
| 134 |
time.sleep(0.2)
|
| 135 |
# 次パケット送信待ち
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
| 137 |
time.sleep(0.1)
|
| 138 |
|
| 139 |
# 完了
|
|
|
|
| 7 |
import traceback
|
| 8 |
|
| 9 |
# --- Turbowarpクラウド接続 ---
|
| 10 |
+
PROJECT_ID = "1293416663"
|
| 11 |
tw = scratchcommunication.TwCloudConnection(
|
| 12 |
project_id=PROJECT_ID,
|
| 13 |
username="server",
|
|
|
|
| 133 |
tw["n1"] = pkt
|
| 134 |
time.sleep(0.2)
|
| 135 |
# 次パケット送信待ち
|
| 136 |
+
start = time.time()
|
| 137 |
+
while get_var("n1") != "11":
|
| 138 |
+
if time.time() - start > 10: # 10秒でタイムアウト
|
| 139 |
+
break
|
| 140 |
time.sleep(0.1)
|
| 141 |
|
| 142 |
# 完了
|