ICe 3 months ago
parent
commit
ea53768567

+ 1 - 1
conf/config.properties

@@ -7,7 +7,7 @@ extendedState = 0
 appTheme = Darcula Theme
 [robot]
 selectedWindowTitle = sencorsta - sencorsta.com - 远程桌面连接
-lastUpdateTime = 1716343429864
+lastUpdateTime = 1717145729428
 [SceneData]
 SceneMain = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1716411600000,"resetType":"DAILY"}
 SceneMain_Challenge = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1716411600000,"resetType":"DAILY"}

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


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


+ 1 - 1
src/main/java/com/sencorsta/rabs/obj/ai/scene/explore/SceneMain_Explore_King_kings.java

@@ -124,7 +124,7 @@ public class SceneMain_Explore_King_kings extends BaseScene implements Scene {
                 moveToClick(PathSkip2, AiManage.getInstance().getCheckPoint());
                 ThreadUtil.sleep(2000);
             }
-            ThreadUtil.sleep(1000);
+            ThreadUtil.sleep(5000);
         }
         ThreadUtil.sleep(2000);
         randomToClick();

+ 5 - 0
src/main/java/com/sencorsta/rabs/obj/ai/scene/explore/SceneMain_Explore_World.java

@@ -90,6 +90,11 @@ public class SceneMain_Explore_World extends BaseScene implements Scene {
             //打开界面
             moveToClick(PathBoss, AiManage.getInstance().getCheckPoint(),new Point(682,-219));
             ThreadUtil.sleep(2000);
+
+            while (!checkHas(PathStart, AiManage.getInstance().getCheckPoint())){
+                moveToClick(PathBoss, AiManage.getInstance().getCheckPoint(),new Point(694,-290));
+                ThreadUtil.sleep(2000);
+            }
             moveToClick(PathStart, AiManage.getInstance().getCheckPoint());
             ThreadUtil.sleep(3000);
 

+ 141 - 0
src/main/java/com/sencorsta/rabs/obj/ai/scene/fight/SceneMain_Fight_Gym_Cloud.java

@@ -0,0 +1,141 @@
+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.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_Cloud extends SceneWhitSubRecord implements Scene {
+    @Override
+    public float getPriority() {
+        return 1.0f;
+    }
+
+    private static String PathEnter = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\cloud\\enter.png";
+    private static String PathCheck = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\cloud\\check.png";
+//    private static String PathNotOpen = System.getProperty("user.dir") + "\\opencv\\scene\\fight\\gym\\cloud\\notOpen.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, AiManage.getInstance().getCheckPoint());
+        ThreadUtil.sleep(2000);
+    }
+
+    int moveCount = 0;
+    boolean goRight = true;
+
+    @Override
+    public void open() throws AWTException {
+        while (!check()) {
+            AiManage.getInstance().updateWindow();
+            ThreadUtil.sleep(2000);
+            if (checkHas(PathEnter, AiManage.getInstance().getCheckPoint())) {
+                moveToClick(PathEnter, AiManage.getInstance().getCheckPoint());
+                continue;
+            }
+
+//            if (checkHas(PathNotOpen, AiManage.getInstance().getCheckPoint())) {
+//                getRecordSub().getData().setDone(true);
+//                break;
+//            }
+            if (goRight) {
+                moveToClick(PathMovePoint, AiManage.getInstance().getCheckPoint(), new Point(0, -50));
+            } else {
+                moveToClick(PathMovePoint, AiManage.getInstance().getCheckPoint(), new Point(-666, -50));
+            }
+            moveCount++;
+            if (moveCount > 5) {
+                moveCount = 0;
+                goRight = !goRight;
+            }
+        }
+    }
+
+    @Override
+    public boolean check() throws AWTException {
+        if (checkHas(PathCheck, AiManage.getInstance().getCheckPoint())) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public void think() throws AWTException {
+        int count = getRecord().getData().getCount();
+        if (count < maxTime) {
+            ThreadUtil.sleep(4000);
+            moveToClick(PathStart, AiManage.getInstance().getCheckPoint());
+            ThreadUtil.sleep(2000);
+            while (!checkHas(PathStart2, AiManage.getInstance().getCheckPoint())) {
+                if (checkHas(PathBuy, AiManage.getInstance().getCheckPoint())) {
+                    //没有次数了 今日结束
+                    getRecordSub().getData().setDone(true);
+                    moveToClick(PathClose, AiManage.getInstance().getCheckPoint());
+                    ThreadUtil.sleep(2000);
+                    return;
+                }
+
+                moveToClick(PathStart, AiManage.getInstance().getCheckPoint());
+                ThreadUtil.sleep(2000);
+            }
+            moveToClick(PathStart2, AiManage.getInstance().getCheckPoint());
+            ThreadUtil.sleep(2000);
+
+            while (!checkHas(PathOver, AiManage.getInstance().getCheckPoint())) {
+                if (checkHas(PathLose, AiManage.getInstance().getCheckPoint())) {
+                    //发现失败 直接放弃
+                    getRecord().getData().setCount(maxTime);
+                    randomToClick();
+                    ThreadUtil.sleep(2000);
+                    return;
+                }
+                moveToClick(PathSkip, AiManage.getInstance().getCheckPoint());
+                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;
+    }
+
+
+}