ICe 4 месяцев назад
Родитель
Сommit
6519f6622c

+ 43 - 42
conf/config.properties

@@ -7,46 +7,47 @@ extendedState = 0
 appTheme = Darcula Theme
 [robot]
 selectedWindowTitle = sencorsta - sencorsta.com - 远程桌面连接
-lastUpdateTime = 1715738488764
+lastUpdateTime = 1715825183799
 [SceneData]
-SceneMain = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Challenge = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Challenge_Extreme = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy_Free = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715760000000,"resetType":"SPECIAL_RULES"}
-SceneMain_Energy_Friend = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy_Home = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy_Home_Select = {"data":{"isDone":false,"count":6,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy_Home_SelectRes = {"data":{"isDone":false,"count":4,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Energy_buy = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_Gift = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_Gift_Evil = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_King = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_King_hell = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_King_kings = {"data":{"isDone":false,"count":9,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_Leader = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Explore_Leader_quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Help = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Info = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Out = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Out_BigBoss = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Out_Boss = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Out_Fight = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Family_Task = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_Endless = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_Endless_Quick = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_Endless_Reward = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_Gym = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_Gym_Dragon = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_VS = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Fight_VS_Quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Mail = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Qiyu = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Qiyu_find = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Qiyu_helper = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Qiyu_quest = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Role = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
-SceneMain_Welfare = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715806800000,"resetType":"DAILY"}
+SceneMain = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Challenge = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Challenge_Extreme = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy_Free = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715860800000,"resetType":"SPECIAL_RULES"}
+SceneMain_Energy_Friend = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy_Home = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy_Home_Select = {"data":{"isDone":false,"count":6,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy_Home_SelectRes = {"data":{"isDone":false,"count":4,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Energy_buy = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_Gift = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_Gift_Evil = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_King = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_King_hell = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_King_kings = {"data":{"isDone":false,"count":9,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_Leader = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Explore_Leader_quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Help = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Info = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Out = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Out_BigBoss = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Out_Boss = {"data":{"isDone":false,"count":3,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Out_Fight = {"data":{"isDone":false,"count":3,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Family_Task = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_Endless = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_Endless_Quick = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_Endless_Reward = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_Gym = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_Gym_Dragon = {"record":{"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1716757200000,"resetType":"WEEKLY_DOUBLE"},"recordSub":{"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}}
+SceneMain_Fight_Gym_Wind = {"record":{"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1716757200000,"resetType":"WEEKLY_DOUBLE"},"recordSub":{"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}}
+SceneMain_Fight_VS = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Fight_VS_Quick = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Mail = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Qiyu = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Qiyu_find = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Qiyu_helper = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Qiyu_quest = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715860800000,"resetType":"SPECIAL_RULES"}
+SceneMain_Role = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}
+SceneMain_Welfare = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715893200000,"resetType":"DAILY"}

BIN
opencv/scene/family/help/piece2_dark.png


BIN
opencv/scene/fight/gym/check.png


BIN
opencv/scene/fight/gym/dragon/buy.png


BIN
opencv/scene/fight/gym/dragon/close.png


BIN
opencv/scene/fight/gym/wind/check.png


BIN
opencv/scene/fight/gym/wind/enter.png


BIN
opencv/scene/qiyu/quest/refersh.png


BIN
opencv/scene/welfare/enter.png


+ 5 - 1
src/main/java/com/sencorsta/rabs/obj/ai/api/BaseScene.java

@@ -239,8 +239,12 @@ public class BaseScene {
      * @return
      */
     public void loadData(String dataJson) {
+        ResettableData.ResetType newResetType = record.getResetType();
         record = Jsons.fromJsonString(dataJson, new TypeReference<ResettableData<BaseStatus>>() {
         });
+        if (!record.getResetType().equals(newResetType)){
+            record.setResetType(newResetType);
+        }
         record.maybeReset();
     }
 
@@ -284,7 +288,7 @@ public class BaseScene {
      */
     public ResettableData.ResetType getType(){
         return ResettableData.ResetType.DAILY;
-    };
+    }
 
 
     public void forcePass() {

+ 0 - 7
src/main/java/com/sencorsta/rabs/obj/ai/api/Scene.java

@@ -82,13 +82,6 @@ public interface Scene {
      */
     float getPriority();
 
-
-
-    /**
-     * 重置
-     */
-    public ResettableData.ResetType getType();
-
     /**
      * 强制通过
      */

+ 65 - 0
src/main/java/com/sencorsta/rabs/obj/ai/api/SceneWhitSubRecord.java

@@ -0,0 +1,65 @@
+package com.sencorsta.rabs.obj.ai.api;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.sencorsta.rabs.obj.ai.status.fight.BaseStatus;
+import com.sencorsta.rabs.util.ResettableData;
+import com.sencorsta.utils.object.Jsons;
+import lombok.Getter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 带复杂存储场景逻辑
+ */
+public class SceneWhitSubRecord extends BaseScene {
+    /**
+     * 子记录
+     */
+    @Getter
+    ResettableData<BaseStatus> recordSub = new ResettableData<>(getSubType(), BaseStatus::new);
+
+    private ResettableData.ResetType getSubType() {
+        return ResettableData.ResetType.DAILY;
+    }
+
+    /**
+     * 返回持久化数据
+     *
+     * @return 数据
+     */
+    @Override
+    public String getData() {
+        Map<String, ResettableData<BaseStatus>> dataMap = new HashMap<>();
+        dataMap.put("record", record);
+        dataMap.put("recordSub", recordSub);
+        return Jsons.toJsonString(dataMap);
+    }
+
+    /**
+     * 加载持久化数据
+     */
+    @Override
+    public void loadData(String dataJson) {
+        try {
+            Map<String, ResettableData<BaseStatus>> dataMap = Jsons.fromJsonString(dataJson, new TypeReference<Map<String, ResettableData<BaseStatus>>>() {
+            });
+            ResettableData.ResetType newResetType = record.getResetType();
+            record = dataMap.get("record");
+            if (!record.getResetType().equals(newResetType)){
+                record.setResetType(newResetType);
+            }
+            record.maybeReset();
+            ResettableData.ResetType resetTypeSub = recordSub.getResetType();
+            recordSub = dataMap.get("recordSub");
+            if (!recordSub.getResetType().equals(resetTypeSub)){
+                recordSub.setResetType(resetTypeSub);
+            }
+            recordSub.maybeReset();
+        } catch (Exception e) {
+            System.out.println(this.getClass().getSimpleName() + "检测到数据转换异常,修改过格式? = " + e);
+        }
+    }
+
+
+}

+ 9 - 2
src/main/java/com/sencorsta/rabs/obj/ai/scene/family/SceneMain_Family_Help.java

@@ -31,6 +31,7 @@ public class SceneMain_Family_Help extends BaseScene implements Scene {
     private static String PathGive = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\give.png";
     private static String PathPiece1 = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\piece1.png";
     private static String PathPiece2 = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\piece2.png";
+    private static String PathPiece2Dark = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\piece2_dark.png";
     private static String PathPaper = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\paper.png";
 
     private static String PathRightdoor = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\rightDoor.png";
@@ -115,8 +116,14 @@ public class SceneMain_Family_Help extends BaseScene implements Scene {
         moveToClick(PathAsk, 0.9);
         ThreadUtil.sleep(2000);
 
-        moveToClick(PathPiece2, 0.9);
-        ThreadUtil.sleep(3000);
+        if (checkHas(PathPiece2,0.9)) {
+            moveToClick(PathPiece2, 0.9);
+            ThreadUtil.sleep(3000);
+        }else {
+            moveToClick(PathPiece2Dark, 0.9);
+            ThreadUtil.sleep(3000);
+        }
+
 
         moveToClick(PathSendAsk, 0.9);
         ThreadUtil.sleep(3000);

+ 0 - 1
src/main/java/com/sencorsta/rabs/obj/ai/scene/fight/SceneMain_Fight.java

@@ -15,7 +15,6 @@ import java.awt.AWTException;
  */
 @SceneAnnotation("SceneMain")
 public class SceneMain_Fight extends BaseScene implements Scene {
-    @JsonIgnore
     @Override
     public float getPriority() {
         return 2.0f;

+ 32 - 6
src/main/java/com/sencorsta/rabs/obj/ai/scene/fight/SceneMain_Fight_Gym_Dragon.java

@@ -5,6 +5,8 @@ import com.sencorsta.rabs.annotation.SceneAnnotation;
 import com.sencorsta.rabs.obj.ai.AiManage;
 import com.sencorsta.rabs.obj.ai.api.BaseScene;
 import com.sencorsta.rabs.obj.ai.api.Scene;
+import com.sencorsta.rabs.obj.ai.api.SceneWhitSubRecord;
+import com.sencorsta.rabs.util.ResettableData;
 import org.opencv.core.Point;
 
 import java.awt.AWTException;
@@ -13,7 +15,12 @@ import java.awt.AWTException;
  * 对决赛
  */
 @SceneAnnotation("SceneMain_Fight_Gym")
-public class SceneMain_Fight_Gym_Dragon extends BaseScene implements Scene {
+public class SceneMain_Fight_Gym_Dragon extends SceneWhitSubRecord implements Scene {
+    @Override
+    public float getPriority() {
+        return 3.0f;
+    }
+
     private static String PathEnter = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\enter.png";
     private static String PathCheck = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\check.png";
     private static String PathBack = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\back.png";
@@ -23,6 +30,8 @@ public class SceneMain_Fight_Gym_Dragon extends BaseScene implements Scene {
     private static String PathSkip = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\skip.png";
     private static String PathOver = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\over.png";
     private static String PathLose = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\lose.png";
+    private static String PathBuy = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\buy.png";
+    private static String PathClose = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\close.png";
     private int maxTime = 20;
 
 
@@ -71,7 +80,15 @@ public class SceneMain_Fight_Gym_Dragon extends BaseScene implements Scene {
             ThreadUtil.sleep(4000);
             moveToClick(PathStart, 0.9);
             ThreadUtil.sleep(2000);
-            while (!checkHas(PathStart2, 0.9)){
+            while (!checkHas(PathStart2, 0.9)) {
+                if (checkHas(PathBuy, 0.9)) {
+                    //没有次数了 结束
+                    getRecordSub().getData().setDone(true);
+                    moveToClick(PathClose, 0.9);
+                    ThreadUtil.sleep(2000);
+                    return;
+                }
+
                 moveToClick(PathStart, 0.9);
                 ThreadUtil.sleep(2000);
             }
@@ -79,10 +96,11 @@ public class SceneMain_Fight_Gym_Dragon extends BaseScene implements Scene {
             ThreadUtil.sleep(2000);
 
             while (!checkHas(PathOver, 0.9)) {
-                if (checkHas(PathLose, 0.9)){
+                if (checkHas(PathLose, 0.9)) {
                     //发现失败 直接放弃
-
-                    getRecord().getData().setCount(maxTime);
+                    getRecordSub().getData().setCount(maxTime);
+                    randomToClick();
+                    ThreadUtil.sleep(2000);
                     return;
                 }
                 moveToClick(PathSkip, 0.9);
@@ -100,7 +118,15 @@ public class SceneMain_Fight_Gym_Dragon extends BaseScene implements Scene {
 
     @Override
     public boolean isDone() {
-        return getRecord().getData().getCount()>=maxTime;
+        return getRecord().getData().getCount() >= maxTime||getRecordSub().getData().isDone();
+    }
+
+    /**
+     * 重置
+     */
+    @Override
+    public ResettableData.ResetType getType() {
+        return ResettableData.ResetType.WEEKLY_DOUBLE;
     }
 
 }

+ 135 - 0
src/main/java/com/sencorsta/rabs/obj/ai/scene/fight/SceneMain_Fight_Gym_Wind.java

@@ -0,0 +1,135 @@
+package com.sencorsta.rabs.obj.ai.scene.fight;
+
+import cn.hutool.core.thread.ThreadUtil;
+import com.sencorsta.rabs.annotation.SceneAnnotation;
+import com.sencorsta.rabs.obj.ai.AiManage;
+import com.sencorsta.rabs.obj.ai.api.BaseScene;
+import com.sencorsta.rabs.obj.ai.api.Scene;
+import com.sencorsta.rabs.obj.ai.api.SceneWhitSubRecord;
+import com.sencorsta.rabs.util.ResettableData;
+import org.opencv.core.Point;
+
+import java.awt.AWTException;
+
+/**
+ * 对决赛
+ */
+@SceneAnnotation("SceneMain_Fight_Gym")
+public class SceneMain_Fight_Gym_Wind extends SceneWhitSubRecord implements Scene {
+    @Override
+    public float getPriority() {
+        return 2.0f;
+    }
+
+    private static String PathEnter = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\wind\\enter.png";
+    private static String PathCheck = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\wind\\check.png";
+
+    //下面的直接共用一套资源
+    private static String PathBack = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\back.png";
+    private static String PathMovePoint = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\movePoint.png";
+    private static String PathStart = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\start.png";
+    private static String PathStart2 = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\start2.png";
+    private static String PathSkip = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\skip.png";
+    private static String PathOver = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\over.png";
+    private static String PathLose = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\lose.png";
+    private static String PathBuy = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\buy.png";
+    private static String PathClose = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\dragon\\close.png";
+    private int maxTime = 20;
+
+
+    @Override
+    public void back() throws AWTException {
+        moveToClick(PathBack, 0.9);
+    }
+
+    int moveCount = 0;
+    boolean goRight = true;
+
+    @Override
+    public void open() throws AWTException {
+        while (!check()) {
+            AiManage.getInstance().updateWindow();
+            ThreadUtil.sleep(2000);
+            if (checkHas(PathEnter, 0.9)) {
+                moveToClick(PathEnter, 0.9);
+                continue;
+            }
+            if (goRight) {
+                moveToClick(PathMovePoint, 0.9, new Point(0, -50));
+            } else {
+                moveToClick(PathMovePoint, 0.9, new Point(-666, -50));
+            }
+            moveCount++;
+            if (moveCount > 5) {
+                moveCount = 0;
+                goRight = !goRight;
+            }
+        }
+    }
+
+    @Override
+    public boolean check() throws AWTException {
+        if (checkHas(PathCheck, 0.9)) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public void think() throws AWTException {
+        int count = getRecord().getData().getCount();
+        if (count < maxTime) {
+            ThreadUtil.sleep(4000);
+            moveToClick(PathStart, 0.9);
+            ThreadUtil.sleep(2000);
+            while (!checkHas(PathStart2, 0.9)) {
+                if (checkHas(PathBuy, 0.9)) {
+                    //没有次数了 今日结束
+                    getRecordSub().getData().setDone(true);
+                    moveToClick(PathClose, 0.9);
+                    ThreadUtil.sleep(2000);
+                    return;
+                }
+
+                moveToClick(PathStart, 0.9);
+                ThreadUtil.sleep(2000);
+            }
+            moveToClick(PathStart2, 0.9);
+            ThreadUtil.sleep(2000);
+
+            while (!checkHas(PathOver, 0.9)) {
+                if (checkHas(PathLose, 0.9)) {
+                    //发现失败 直接放弃
+                    getRecord().getData().setCount(maxTime);
+                    randomToClick();
+                    ThreadUtil.sleep(2000);
+                    return;
+                }
+                moveToClick(PathSkip, 0.9);
+                ThreadUtil.sleep(4000);
+            }
+            ThreadUtil.sleep(6000);
+            randomToClick();
+
+            ThreadUtil.sleep(12000);
+
+            getRecord().getData().setCount(count + 1);
+        }
+    }
+
+
+    @Override
+    public boolean isDone() {
+        return getRecord().getData().getCount() >= maxTime||getRecordSub().getData().isDone();
+    }
+
+    /**
+     * 重置
+     */
+    @Override
+    public ResettableData.ResetType getType() {
+        return ResettableData.ResetType.WEEKLY_DOUBLE;
+    }
+
+
+}

+ 16 - 2
src/main/java/com/sencorsta/rabs/obj/ai/scene/qiyi/SceneMain_Qiyu_quest.java

@@ -5,6 +5,7 @@ import com.sencorsta.rabs.annotation.SceneAnnotation;
 import com.sencorsta.rabs.obj.ai.AiManage;
 import com.sencorsta.rabs.obj.ai.api.BaseScene;
 import com.sencorsta.rabs.obj.ai.api.Scene;
+import com.sencorsta.rabs.util.ResettableData;
 
 import java.awt.*;
 
@@ -23,6 +24,7 @@ public class SceneMain_Qiyu_quest extends BaseScene implements Scene {
     private static String PathList = System.getProperty("user.dir") + "\\opencv\\scene\\qiyu\\quest\\list.png";
     private static String PathTake = System.getProperty("user.dir") + "\\opencv\\scene\\qiyu\\quest\\take.png";
     private static String PathListBack = System.getProperty("user.dir") + "\\opencv\\scene\\qiyu\\quest\\listBack.png";
+    private static String PathRefersh = System.getProperty("user.dir") + "\\opencv\\scene\\qiyu\\quest\\refersh.png";
 
     @Override
     public void back() throws AWTException {
@@ -70,11 +72,13 @@ public class SceneMain_Qiyu_quest extends BaseScene implements Scene {
                 moveToClick(PathEnter, 0.9, new org.opencv.core.Point(-5, 20));
                 ThreadUtil.sleep(3000);
                 randomToClick();
+                ThreadUtil.sleep(2000);
             }
             if (checkHas(PathFinish, 0.9)) {
                 moveToClick(PathFinish, 0.9, new org.opencv.core.Point(-5, 20));
                 ThreadUtil.sleep(3000);
                 randomToClick();
+                ThreadUtil.sleep(2000);
             }
         }
         if (checkHas(PathDailyJob, 0.9)) {
@@ -86,10 +90,12 @@ public class SceneMain_Qiyu_quest extends BaseScene implements Scene {
         if (checkHas(PathList, 0.9)) {
             moveToClick(PathList, 0.9);
             ThreadUtil.sleep(2000);
-            //最多点6
-            for (int i = 0; i < 6; i++) {
+            //最多点4
+            for (int i = 0; i < 4; i++) {
                 if (checkHas(PathTake, 0.9)) {
                     moveToClick(PathTake, 0.9);
+                }else {
+                    moveToClick(PathRefersh, 0.9);
                 }
                 ThreadUtil.sleep(2000);
             }
@@ -104,4 +110,12 @@ public class SceneMain_Qiyu_quest extends BaseScene implements Scene {
         return getRecord().getData().isDone();
     }
 
+
+    /**
+     * 重置
+     */
+    @Override
+    public ResettableData.ResetType getType(){
+        return ResettableData.ResetType.SPECIAL_RULES;
+    }
 }

+ 1 - 0
src/main/java/com/sencorsta/rabs/obj/ai/scene/role/SceneMain_Role.java

@@ -71,6 +71,7 @@ public class SceneMain_Role extends BaseScene implements Scene {
             moveToDrop(PathDropPoint, 0.9, new Point(0, 100), new Point(-850, 100));
             ThreadUtil.sleep(100);
         }
+        ThreadUtil.sleep(3000);
         //点击等级最低的角色
         moveToClick(PathDropPoint,0.9,new Point(0, 100));
         ThreadUtil.sleep(2000);

+ 4 - 0
src/main/java/com/sencorsta/rabs/ui/robot/RobotPanel.java

@@ -114,15 +114,19 @@ public class RobotPanel extends JPanel {
         SwingUtilities.invokeLater(() -> logTextArea.append(text));
     }
 
+    private PrintStream originalOut = System.out;
+    private PrintStream originalErr = System.err;
     private void redirectSystemStreams() {
         OutputStream out = new OutputStream() {
             @Override
             public void write(int b) {
+                originalOut.write(b);
                 updateTextArea(String.valueOf((char) b));
             }
 
             @Override
             public void write(byte[] b, int off, int len) {
+                originalOut.write(b, off, len);
                 updateTextArea(new String(b, off, len));
             }
 

+ 14 - 1
src/main/java/com/sencorsta/rabs/util/ResettableData.java

@@ -7,7 +7,9 @@ import cn.hutool.core.date.LocalDateTimeUtil;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.sencorsta.rabs.obj.ai.api.Status;
 import lombok.AllArgsConstructor;
+import lombok.Getter;
 import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 import java.util.Date;
 import java.util.function.Supplier;
@@ -17,6 +19,8 @@ import java.util.function.Supplier;
 public class ResettableData<T extends Status> {
     private T data;
     private long nextResetTime;  // 下一次重置的时间戳
+    @Getter
+    @Setter
     private ResetType resetType = ResetType.DAILY;
 
     public enum ResetType {
@@ -35,7 +39,16 @@ public class ResettableData<T extends Status> {
         WEEKLY {
             @Override
             long getNextResetTime() {
-                return DateUtil.beginOfDay(DateUtil.nextWeek()).offset(DateField.HOUR, 5).getTime();
+                return DateUtil.beginOfWeek(DateUtil.nextWeek()).offset(DateField.HOUR, 5).getTime();
+            }
+        },
+        /**
+         * 每2周重置
+         */
+        WEEKLY_DOUBLE {
+            @Override
+            long getNextResetTime() {
+                return DateUtil.beginOfWeek(DateUtil.offsetWeek(new DateTime(), 2)).offset(DateField.HOUR, 5).getTime();
             }
         },
         /**