izuemon commited on
Commit
3cf8956
·
verified ·
1 Parent(s): 1f375cc

Update turbowarp-server/qr-converter.py

Browse files
Files changed (1) hide show
  1. turbowarp-server/qr-converter.py +5 -2
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
- while tw.get("n1") != 11:
 
 
 
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
  # 完了