import java.awt.*;
import java.awt.event.KeyEvent;
/**
* @Author: HortonWei@foxmail.com
* @Date: 2021/2/27 1:57
* 金庸群侠传5 自动化脚本
*/
public class RobotTest {
public static Robot robot;
static {
try {
robot = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws InterruptedException {
openBoxGame();
}
// 绝情谷大厅开宝箱按键游戏
public static void openBoxGame() throws InterruptedException {
Integer[] integers = new Integer[]{
KeyEvent.VK_Q, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT, KeyEvent.VK_A, KeyEvent.VK_X, KeyEvent.VK_D,
KeyEvent.VK_W, KeyEvent.VK_UP, KeyEvent.VK_X, KeyEvent.VK_Q, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT,
KeyEvent.VK_A, KeyEvent.VK_X, KeyEvent.VK_D, KeyEvent.VK_W, KeyEvent.VK_UP, KeyEvent.VK_X
};
Thread.sleep(5000);
for (Integer keyCode : integers) {
Thread.sleep(100);
robot.keyPress(keyCode);
robot.keyRelease(keyCode);
}
}
}
游戏中有一个开宝箱游戏,需要在极短的时间内按下指定的按键,可以使用此脚本通关。
使用方法:运行脚本后立即回到游戏,进入开宝箱倒计时。