ICe 3 月之前
父节点
当前提交
7aca610583

+ 4 - 1
Readme.md

@@ -3,7 +3,10 @@
 - 939*529
 
 ## TODOlist
--
+- [ ] 遇到死循环自动跳过
+- [X] 每日徽章勾选修改
+- [X] 组织小怪进不去问题
+- [ ] 活动页签待实现
 
 # 应用程序说明文档
 

二进制
opencv/scene/fight/gym/cloud/notOpen.png


+ 18 - 0
pom.xml

@@ -173,6 +173,24 @@
                     <target>14</target>
                 </configuration>
             </plugin>
+            <!--执行玩后自动打一个快速补丁包-->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>3.3.0</version>
+                <executions>
+                    <execution>
+                        <id>run-zip-directory</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                        <configuration>
+                            <mainClass>com.sencorsta.rabs.util.ZipDirectory</mainClass>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
         <resources>
             <resource>

+ 1 - 1
src/main/java/com/sencorsta/rabs/obj/ai/scene/family/SceneMain_Family_Out_Boss.java

@@ -96,7 +96,7 @@ public class SceneMain_Family_Out_Boss extends BaseScene implements Scene {
                     }
                     ThreadUtil.sleep(1000);
                 }
-
+                ThreadUtil.sleep(5000);
                 moveToClick(PathOver, AiManage.getInstance().getCheckPoint());
                 ThreadUtil.sleep(6000);
 

+ 11 - 5
src/main/java/com/sencorsta/rabs/obj/ai/scene/family/SceneMain_Family_Out_Fight.java

@@ -30,7 +30,7 @@ public class SceneMain_Family_Out_Fight extends BaseScene implements Scene {
 
     @Override
     public void back() throws AWTException {
-        isTempDone=false;
+        isTempDone = false;
     }
 
     @Override
@@ -53,8 +53,10 @@ public class SceneMain_Family_Out_Fight extends BaseScene implements Scene {
         }
         return false;
     }
+
     @JsonIgnore
-    static int maxTime=3;
+    static int maxTime = 3;
+
     @Override
     public void think() throws AWTException {
         int count = getRecord().getData().getCount();
@@ -68,6 +70,10 @@ public class SceneMain_Family_Out_Fight extends BaseScene implements Scene {
                 moveToClick(PathSkip, AiManage.getInstance().getCheckPoint());
                 ThreadUtil.sleep(2000);
             }
+            if (checkHas(PathStart, AiManage.getInstance().getCheckPoint())) {
+                moveToClick(PathStart, AiManage.getInstance().getCheckPoint());
+                ThreadUtil.sleep(2000);
+            }
             ThreadUtil.sleep(1000);
         }
 
@@ -75,13 +81,13 @@ public class SceneMain_Family_Out_Fight extends BaseScene implements Scene {
         ThreadUtil.sleep(6000);
 
 
-        getRecord().getData().setCount(count+1);
-        isTempDone=true;
+        getRecord().getData().setCount(count + 1);
+        isTempDone = true;
     }
 
     @Override
     public boolean isDone() {
-        if (getRecord().getData().getCount()>=maxTime){
+        if (getRecord().getData().getCount() >= maxTime) {
             return true;
         }
         return isTempDone;

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

@@ -22,7 +22,7 @@ public class SceneMain_Fight_Gym_Cloud extends SceneWhitSubRecord implements Sce
 
     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 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";
@@ -50,16 +50,16 @@ public class SceneMain_Fight_Gym_Cloud extends SceneWhitSubRecord implements Sce
     public void open() throws AWTException {
         while (AiManage.getInstance().isRunning() && !check()) {
             AiManage.getInstance().updateWindow();
-            ThreadUtil.sleep(2000);
+            ThreadUtil.sleep(4000);
             if (checkHas(PathEnter, AiManage.getInstance().getCheckPoint())) {
                 moveToClick(PathEnter, AiManage.getInstance().getCheckPoint());
                 continue;
             }
 
-//            if (checkHas(PathNotOpen, AiManage.getInstance().getCheckPoint())) {
-//                getRecordSub().getData().setDone(true);
-//                break;
-//            }
+            if (checkHas(PathNotOpen, AiManage.getInstance().getCheckPoint()+0.08)) {
+                getRecordSub().getData().setDone(true);
+                break;
+            }
             if (goRight) {
                 moveToClick(PathMovePoint, AiManage.getInstance().getCheckPoint(), new Point(0, -50));
             } else {

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

@@ -48,7 +48,7 @@ public class SceneMain_Fight_Gym_Dragon extends SceneWhitSubRecord implements Sc
     public void open() throws AWTException {
         while (AiManage.getInstance().isRunning() && !check()) {
             AiManage.getInstance().updateWindow();
-            ThreadUtil.sleep(2000);
+            ThreadUtil.sleep(4000);
             if (checkHas(PathEnter, AiManage.getInstance().getCheckPoint())) {
                 moveToClick(PathEnter, AiManage.getInstance().getCheckPoint());
                 continue;

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

@@ -51,13 +51,13 @@ public class SceneMain_Fight_Gym_Wind extends SceneWhitSubRecord implements Scen
     public void open() throws AWTException {
         while (AiManage.getInstance().isRunning() && !check()) {
             AiManage.getInstance().updateWindow();
-            ThreadUtil.sleep(2000);
+            ThreadUtil.sleep(4000);
             if (checkHas(PathEnter, AiManage.getInstance().getCheckPoint())) {
                 moveToClick(PathEnter, AiManage.getInstance().getCheckPoint());
                 continue;
             }
 
-            if (checkHas(PathNotOpen, AiManage.getInstance().getCheckPoint()+0.9)) {
+            if (checkHas(PathNotOpen, AiManage.getInstance().getCheckPoint()+0.08)) {
                 getRecordSub().getData().setDone(true);
                 break;
             }

+ 83 - 0
src/main/java/com/sencorsta/rabs/util/ZipDirectory.java

@@ -0,0 +1,83 @@
+package com.sencorsta.rabs.util;
+
+import java.awt.Desktop;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.Comparator;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class ZipDirectory {
+    public static void zipDirectory(String sourceDirPath, String zipFilePath) throws IOException {
+        Path p = Paths.get(sourceDirPath);
+        try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(Paths.get(zipFilePath)))) {
+            Files.walk(p)
+                    .filter(path -> !Files.isDirectory(path))
+                    .forEach(path -> {
+                        ZipEntry zipEntry = new ZipEntry(p.relativize(path).toString());
+                        try {
+                            zs.putNextEntry(zipEntry);
+                            Files.copy(path, zs);
+                            zs.closeEntry();
+                        } catch (IOException e) {
+                            System.err.println("Error zipping file: " + path + ": " + e);
+                        }
+                    });
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            // 需要压缩的文件和文件夹路径
+            String sourceDirPath1 = "C:\\Users\\daibin\\Desktop\\rabs\\target\\rabs\\rabs.exe";
+            String sourceDirPath2 = "C:\\Users\\daibin\\Desktop\\rabs\\target\\rabs\\opencv\\scene";
+            String zipFilePath = "C:\\Users\\daibin\\Desktop\\rabs\\target\\rabs\\rabs.zip";
+
+            // 创建临时目录来包含要压缩的文件和文件夹
+            Path tempDir = Files.createTempDirectory("tempForZip");
+
+            // 复制文件到临时目录
+            Path tempFile1 = tempDir.resolve("rabs.exe");
+            Files.copy(Paths.get(sourceDirPath1), tempFile1, StandardCopyOption.REPLACE_EXISTING);
+
+            // 复制文件夹到临时目录
+            Path sourcePath2 = Paths.get(sourceDirPath2);
+            Path targetPath2 = tempDir.resolve("opencv\\scene");
+            Files.createDirectories(targetPath2);
+            Files.walk(sourcePath2).forEach(source -> {
+                try {
+                    Path target = targetPath2.resolve(sourcePath2.relativize(source).toString());
+                    if (Files.isDirectory(source)) {
+                        Files.createDirectories(target);
+                    } else {
+                        Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
+                    }
+                } catch (IOException e) {
+                    System.err.println("Error copying file/folder: " + source + ": " + e);
+                }
+            });
+
+            // 压缩临时目录
+            zipDirectory(tempDir.toString(), zipFilePath);
+
+            // 删除临时目录及其内容
+            Files.walk(tempDir)
+                    .sorted(Comparator.reverseOrder())
+                    .map(Path::toFile)
+                    .forEach(File::delete);
+
+            System.out.println("Files successfully zipped into: " + zipFilePath);
+
+
+            // 打开目录
+            Desktop desktop = Desktop.getDesktop();
+            desktop.open(new File(zipFilePath).getParentFile());
+        } catch (IOException e) {
+            System.err.println("Error creating zip file: " + e.getMessage());
+        }
+    }
+}