ice hace 4 meses
padre
commit
41fc93d6b8

+ 42 - 29
conf/config.properties

@@ -1,36 +1,49 @@
 []
-windowX = 223
-windowY = 81
+windowX = 152
+windowY = 502
 windowWidth = 1351.0
 windowHeight = 717.0
 extendedState = 0
 appTheme = Darcula Theme
 [robot]
-selectedWindowTitle = sencorsta - sencorsta.com - 远程桌面连接
-lastUpdateTime = 1715392058877
+selectedWindowTitle = winServer - www.sencorsta.com:3389 - 远程桌面连接
+lastUpdateTime = 1715503822093
 [SceneData]
-SceneMain_Fight_VS_Quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Fight_Endless_Quick = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Fight = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Fight_VS = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Fight_Endless = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Qiyu_helper = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Qiyu = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Fight_Endless_Reward = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Qiyu_quest = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Qiyu_find = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_Home = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Mail = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_Home_Select = {"data":{"isDone":false,"count":6,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_Friend = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_Home_SelectRes = {"data":{"isDone":false,"count":4,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_Free = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Energy_buy = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Welfare = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Explore = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Explore_Leader = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Explore_Leader_quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Explore_King = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
-SceneMain_Explore_King_kings = {"data":{"isDone":false,"count":9,"done":false},"nextResetTime":1715202000000,"resetType":"DAILY"}
+SceneMain_Fight_VS_Quick = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Fight_Endless_Quick = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Fight = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Fight_VS = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Fight_Endless = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Qiyu_helper = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Qiyu = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Fight_Endless_Reward = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Qiyu_quest = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Qiyu_find = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_Home = {"data":{"isDone":false,"count":2,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Mail = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_Home_Select = {"data":{"isDone":false,"count":6,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_Friend = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_Home_SelectRes = {"data":{"isDone":false,"count":4,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_Free = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Energy_buy = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Welfare = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_Leader = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_Leader_quick = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_King = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_King_kings = {"data":{"isDone":false,"count":9,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Out_Boss = {"data":{"isDone":false,"count":3,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_Gift = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Info = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Out = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Challenge_Extreme = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_King_hell = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Out_Fight = {"data":{"isDone":false,"count":3,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Task = {"data":{"isDone":true,"count":99,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Help = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Explore_Gift_Evil = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Family_Out_BigBoss = {"data":{"isDone":true,"count":0,"done":true},"nextResetTime":1715547600000,"resetType":"DAILY"}
+SceneMain_Challenge = {"data":{"isDone":false,"count":0,"done":false},"nextResetTime":1715547600000,"resetType":"DAILY"}

BIN
opencv/scene/explore/Leader/quick/stage13_18.png


BIN
opencv/scene/explore/king/hell/over.png


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


+ 17 - 0
src/main/java/com/sencorsta/rabs/obj/ai/AiManage.java

@@ -182,4 +182,21 @@ public class AiManage {
             AppConfig.getInstance().saveAll();
         }
     }
+
+    public void forcePass() {
+        if (curScene!=null){
+            curScene.forcePass();
+        }
+    }
+
+    public void clearAllData() {
+        AppConfig.getInstance().getSetting().clear("SceneData");
+        AppConfig.getInstance().saveAll();
+    }
+
+    public void stop() {
+        thinkPoll.shutdown();
+        thinkPoll.shutdownNow();
+        AppConfig.getInstance().saveAll();
+    }
 }

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

@@ -253,4 +253,11 @@ public class BaseScene {
     public ResettableData.ResetType getType(){
         return ResettableData.ResetType.DAILY;
     };
+
+
+    public void forcePass() {
+        getRecord().getData().setDone(true);
+        getRecord().getData().setCount(99);
+        getChildren().forEach(Scene::forcePass);
+    }
 }

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

@@ -83,4 +83,8 @@ public interface Scene {
      */
     public ResettableData.ResetType getType();
 
+    /**
+     * 强制通过
+     */
+    void forcePass();
 }

+ 3 - 3
src/main/java/com/sencorsta/rabs/obj/ai/scene/challenge/SceneMain_Challenge_Extreme.java

@@ -60,17 +60,17 @@ public class SceneMain_Challenge_Extreme extends BaseScene implements Scene {
 
         //尝试加入别人的队伍
         moveToClick(PathJoin, 0.9);
-        ThreadUtil.sleep(3000);
+        ThreadUtil.sleep(6000);
         if (checkHas(PathJoin,0.9)){
             //如果还在此界面 点击创建
             moveToClick(PathCreate, 0.9);
             ThreadUtil.sleep(2000);
         }
         moveToClick(PathStart2, 0.9);
-        ThreadUtil.sleep(2000);
+        ThreadUtil.sleep(3000);
 
         moveToClick(PathStart2, 0.9);
-        ThreadUtil.sleep(2000);
+        ThreadUtil.sleep(3000);
 
         while (!checkHas(PathOver, 0.9)) {
             if (checkHas(PathSkip, 0.9)) {

+ 3 - 3
src/main/java/com/sencorsta/rabs/obj/ai/scene/explore/SceneMain_Explore_Leader_quick.java

@@ -62,7 +62,7 @@ public class SceneMain_Explore_Leader_quick extends BaseScene implements Scene {
             ThreadUtil.sleep(2000);
         }else {
             ThreadUtil.sleep(1000);
-            moveToClick(PathCancel, 0.9);
+            moveToClick(PathBack, 0.9);
             ThreadUtil.sleep(10000);
         }
         moveToClick(PathStage7_12, 0.9);
@@ -74,7 +74,7 @@ public class SceneMain_Explore_Leader_quick extends BaseScene implements Scene {
             ThreadUtil.sleep(2000);
         }else {
             ThreadUtil.sleep(1000);
-            moveToClick(PathCancel, 0.9);
+            moveToClick(PathBack, 0.9);
             ThreadUtil.sleep(10000);
         }
         moveToClick(PathStage13_18, 0.9);
@@ -86,7 +86,7 @@ public class SceneMain_Explore_Leader_quick extends BaseScene implements Scene {
             ThreadUtil.sleep(2000);
         }else {
             ThreadUtil.sleep(1000);
-            moveToClick(PathCancel, 0.9);
+            moveToClick(PathBack, 0.9);
             ThreadUtil.sleep(10000);
         }
 

+ 0 - 6
src/main/java/com/sencorsta/rabs/obj/ai/scene/family/SceneMain_Family.java

@@ -29,7 +29,6 @@ public class SceneMain_Family extends BaseScene implements Scene {
     private static String PathRightdoor2 = System.getProperty("user.dir") + "\\opencv\\scene\\family\\rightDoor2.png";
     private static String PathGoLeft = System.getProperty("user.dir") + "\\opencv\\scene\\family\\goLeft.png";
     private static String PathGoRight = System.getProperty("user.dir") + "\\opencv\\scene\\family\\goRight.png";
-    private static String PathPaper = System.getProperty("user.dir") + "\\opencv\\scene\\family\\paper.png";
 
     @Override
     public void back() throws AWTException {
@@ -46,11 +45,6 @@ public class SceneMain_Family extends BaseScene implements Scene {
                 continue;
             }
 
-            if (checkHas(PathPaper, 0.9)) {
-                moveToClick(PathPaper, 0.9, new Point(300, 0));
-                ThreadUtil.sleep(2000);
-            }
-
             if (checkHas(PathRightdoor, 0.9)||checkHas(PathRightdoor2, 0.9)) {
                 System.out.println("发现右边的门...");
                 moveToClick(PathGoLeft, 0.9, new Point(0, -50));

+ 8 - 0
src/main/java/com/sencorsta/rabs/obj/ai/scene/family/SceneMain_Family_Help.java

@@ -6,6 +6,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 org.opencv.core.Point;
 
 import java.awt.*;
 
@@ -30,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 PathPaper = System.getProperty("user.dir") + "\\opencv\\scene\\family\\help\\paper.png";
 
 
     @Override
@@ -47,6 +49,12 @@ public class SceneMain_Family_Help extends BaseScene implements Scene {
                 ThreadUtil.sleep(2000);
                 continue;
             }
+
+            if (checkHas(PathPaper, 0.9)) {
+                moveToClick(PathPaper, 0.9, new Point(300, 0));
+                ThreadUtil.sleep(2000);
+            }
+
         }
     }
 

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

@@ -10,7 +10,7 @@ import org.opencv.core.Point;
 import java.awt.AWTException;
 
 /**
- * 无尽
+ * 无尽 TODO ice 调整规则只有周2-6
  */
 @SceneAnnotation("SceneMain_Fight")
 public class SceneMain_Fight_Endless extends BaseScene implements Scene {

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

@@ -9,7 +9,7 @@ import com.sencorsta.rabs.obj.ai.api.Scene;
 import java.awt.AWTException;
 
 /**
- * 对决赛
+ * 对决赛 TODO ice 调整规则只有周1-5
  */
 @SceneAnnotation("SceneMain_Fight")
 public class SceneMain_Fight_VS extends BaseScene implements Scene {

+ 2 - 2
src/main/java/com/sencorsta/rabs/obj/ai/scene/mail/SceneMain_Mail.java

@@ -54,9 +54,9 @@ public class SceneMain_Mail extends BaseScene implements Scene {
     public void think() throws AWTException {
         if (checkHas(PathOneButton, 0.9)) {
             moveToClick(PathOneButton, 0.9);
-            ThreadUtil.sleep(3000);
+            ThreadUtil.sleep(4000);
             randomToClick();
-            ThreadUtil.sleep(3000);
+            ThreadUtil.sleep(4000);
 
             getRecord().getData().setDone(true);
         }

+ 20 - 49
src/main/java/com/sencorsta/rabs/ui/robot/RobotPanel.java

@@ -33,7 +33,6 @@ import java.awt.event.InputEvent;
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
 
 /**
  * @author daibin
@@ -42,8 +41,8 @@ public class RobotPanel extends JPanel {
     public boolean isThinking;
     JComboBox<String> windowComboBox = new JComboBox<>();
     private String selectedWindowTitle;
-    JButton gymFightButton = new JButton("道馆激斗");
-    JButton thinkButton = new JButton("智能判断");
+    JButton clearAllData = new JButton("清空数据");
+    JButton forcePass = new JButton("跳过当前场景");
     JButton aiButton = new JButton("ai");
     JButton debugButton = new JButton("debug");
     private JTextField regexTextField = new JTextField();
@@ -56,8 +55,8 @@ public class RobotPanel extends JPanel {
         controlPanel.add(regexTextField);
         controlPanel.add(windowComboBox);
         controlPanel.add(aiButton);
-        controlPanel.add(gymFightButton);
-        controlPanel.add(thinkButton);
+        controlPanel.add(clearAllData);
+        controlPanel.add(forcePass);
         controlPanel.add(debugButton);
         add(controlPanel, BorderLayout.NORTH);
 
@@ -82,52 +81,24 @@ public class RobotPanel extends JPanel {
 
         });
         aiButton.addActionListener(e -> {
-            AppConfig.getInstance().getSetting().setByGroup("selectedWindowTitle", "robot", (String) windowComboBox.getSelectedItem());
-            AppConfig.getInstance().saveAll();
-
-            AiManage aiManage = AiManage.getInstance();
-            aiManage.setWindowName((String) windowComboBox.getSelectedItem());
-            aiManage.run();
-        });
-        gymFightButton.addActionListener(e -> {
-            selectedWindowTitle = (String) windowComboBox.getSelectedItem();
-            if (selectedWindowTitle != null) {
-                try {
-                    OpenWindowToFront();
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_jj2.png", 0.9);
-                    ThreadUtil.sleep(500);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_dgjd.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_next.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_next2.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_flg.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_tj501.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_start.png", 0.9);
-
-                    ThreadUtil.sleep(10000);
-
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_pass.png", 0.9);
-                    ThreadUtil.sleep(2000);
-                    while (!checkHas(System.getProperty("user.dir") + "\\opencv\\template\\gym_success.png", 0.9)) {
-                        moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_pass.png", 0.9);
-                        ThreadUtil.sleep(2000);
-                    }
-                    moveToClick(System.getProperty("user.dir") + "\\opencv\\template\\gym_success.png", 0.9);
-                    ThreadUtil.sleep(2000);
-
-                } catch (Exception awtException) {
-                    awtException.printStackTrace();
-                }
+            if (isThinking){
+                isThinking=false;
+                AiManage.getInstance().stop();
+            }else {
+                AppConfig.getInstance().getSetting().setByGroup("selectedWindowTitle", "robot", (String) windowComboBox.getSelectedItem());
+                AppConfig.getInstance().saveAll();
+
+                AiManage aiManage = AiManage.getInstance();
+                aiManage.setWindowName((String) windowComboBox.getSelectedItem());
+                aiManage.run();
+                isThinking=true;
             }
         });
-        thinkButton.addActionListener(event -> {
-            isThinking = !isThinking;
-            AppConfig.getInstance().getSetting().setByGroup("selectedWindowTitle", "robot", (String) windowComboBox.getSelectedItem());
-            AppConfig.getInstance().saveAll();
+        clearAllData.addActionListener(e -> {
+            AiManage.getInstance().clearAllData();
+        });
+        forcePass.addActionListener(event -> {
+            AiManage.getInstance().forcePass();
         });
 
         logTextArea = new JTextArea();