소스 검색

!2 change collect type

pcacc 5 달 전
부모
커밋
baec0f8fda
2개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 3
      app_dongri.py
  2. 1 1
      dongri_task.py

+ 6 - 3
app_dongri.py

@@ -146,6 +146,7 @@ def restart_game():
     isGameBegin = True
     send_status("结束")
     config = read_cfg()
+    print("config", config)
     auto_task(config)
 
 def auto_participate():
@@ -192,8 +193,8 @@ def add_auto_task(isMaxCollect, isSimple = False):
         task_queue.appendleft(task_train(False))
         if isSimple:
             task_queue.appendleft(check_buildOrResearch())
-        #else:
-        #    task_queue.appendleft(task_collect(collectType, isSimple))
+        else:
+            task_queue.appendleft(task_collect(collectType, isSimple))
         task_queue.appendleft(task_checkStoreRoom())
         if not isSimple:
             task_queue.appendleft(task_checkConfilits())
@@ -239,7 +240,9 @@ def read_cfg():
 @socketio.on('begin_auto')
 def handle_auto(data):
     write_cfg(data)
-    auto_task(data)
+    config = read_cfg()
+    print("config", config)
+    auto_task(config)
 
 def auto_task(data):
     global autoTask

+ 1 - 1
dongri_task.py

@@ -264,7 +264,7 @@ class task_collect(dongri_task):
     def __init__(self, type = 0, isSimple = False):
         self.isSimple = isSimple
         if type == 0:
-            typeArr = [4,3,3,2,1]
+            typeArr = [4,4,3,3,3,2,2,2,1,1]
             type = typeArr[random.randint(0, len(typeArr) - 1)]
         elif type == 5:
             typeArr = [2,1]