commit
f7c460ca9e
@ -0,0 +1,20 @@
|
|||||||
|
target/
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
release.properties
|
||||||
|
/.idea
|
||||||
|
*.iml
|
||||||
|
/.settings
|
||||||
|
/bin
|
||||||
|
/gen
|
||||||
|
/build
|
||||||
|
/gradle
|
||||||
|
/classes
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
*.gradle
|
||||||
|
gradlew
|
||||||
|
local.properties
|
||||||
|
node_modules/
|
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 931 B |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,26 @@
|
|||||||
|
package xyz.wbsite.sikulix;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import org.sikuli.script.FindFailed;
|
||||||
|
import org.sikuli.script.Match;
|
||||||
|
import org.sikuli.script.Screen;
|
||||||
|
import org.sikuli.script.Pattern;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
public class 屏幕找图 {
|
||||||
|
public static void main(String[] args) throws FindFailed {
|
||||||
|
Screen screen = new Screen();
|
||||||
|
Pattern button = new Pattern(new File("legend/文件夹.png")
|
||||||
|
.getAbsolutePath())
|
||||||
|
.similar(0.7f);
|
||||||
|
// 相似度阈值 0.8
|
||||||
|
Iterator<Match> all = screen.findAll(button);// 找到按钮位置
|
||||||
|
|
||||||
|
while (all.hasNext()){
|
||||||
|
Match next = all.next();
|
||||||
|
System.out.println(StrUtil.format("位置: {} 相似度: {}", next.getRect(), next.getScore()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package xyz.wbsite.sikulix;
|
||||||
|
|
||||||
|
import org.sikuli.script.FindFailed;
|
||||||
|
import org.sikuli.script.Screen;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class 识别文字 {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws FindFailed {
|
||||||
|
Screen screen = new Screen();
|
||||||
|
|
||||||
|
String text = screen.find(new File("legend/此电脑.png").getAbsolutePath()).text();
|
||||||
|
System.out.println("识别到文字: " + text);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package xyz.wbsite.sikulix;
|
||||||
|
|
||||||
|
import org.sikuli.script.Location;
|
||||||
|
import org.sikuli.script.Mouse;
|
||||||
|
|
||||||
|
public class 鼠标操作 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Mouse.move(new Location(100, 100));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue