initial
This commit is contained in:
commit
0df77ed3d6
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>de.mrbesen</groupId>
|
||||||
|
<artifactId>OSCAAutoSub</artifactId>
|
||||||
|
<version>0.1-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
</project>
|
|
@ -0,0 +1,125 @@
|
||||||
|
package de.mrbesen.oscaautosub;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class OscaAutoSub {
|
||||||
|
|
||||||
|
|
||||||
|
static int tabcount = 3;
|
||||||
|
static Scanner scan = new Scanner(System.in);
|
||||||
|
static Robot bot;
|
||||||
|
|
||||||
|
public static void main(String[] args) throws AWTException {
|
||||||
|
bot = new Robot();
|
||||||
|
|
||||||
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
|
bot.keyRelease(KeyEvent.VK_ENTER);
|
||||||
|
bot.keyRelease(KeyEvent.VK_TAB);
|
||||||
|
bot.keyRelease(KeyEvent.VK_DOWN);
|
||||||
|
System.out.println("Exit");
|
||||||
|
}));
|
||||||
|
|
||||||
|
tabback();
|
||||||
|
|
||||||
|
for(int tabnr = 0; tabnr < tabcount; tabnr++) {
|
||||||
|
runtab();
|
||||||
|
nexttab();
|
||||||
|
System.out.println("next tab");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("fill everything in pls");
|
||||||
|
scan.next();
|
||||||
|
tabback();
|
||||||
|
|
||||||
|
|
||||||
|
for(int tabnr = 0; tabnr < tabcount; tabnr++) {
|
||||||
|
applytime();
|
||||||
|
nexttab();
|
||||||
|
System.out.println("next tab");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Done");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void runtab() {
|
||||||
|
pressTimes(KeyEvent.VK_TAB, 19); //auf ankündigungs button
|
||||||
|
press(KeyEvent.VK_ENTER);
|
||||||
|
sleep(20);
|
||||||
|
|
||||||
|
pressTimes(KeyEvent.VK_TAB, 26); //elemente tab
|
||||||
|
press(KeyEvent.VK_ENTER);
|
||||||
|
sleep(2);//auklappen animation
|
||||||
|
press(KeyEvent.VK_ENTER);
|
||||||
|
System.out.println("\telemente tab");
|
||||||
|
sleep(10);
|
||||||
|
|
||||||
|
press(KeyEvent.VK_DOWN);
|
||||||
|
press(KeyEvent.VK_ENTER); //benachrichtigugen verwalten
|
||||||
|
System.out.println("\tverwalten");
|
||||||
|
sleep(10);
|
||||||
|
|
||||||
|
//pressTimes(KeyEvent.VK_TAB, 25); //benachrichtigung hinzufügen
|
||||||
|
press(KeyEvent.VK_ENTER); //hinzufügen
|
||||||
|
sleep(10);
|
||||||
|
System.out.println("\thinzufügen");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void tabback() {
|
||||||
|
bot.keyPress(KeyEvent.VK_ALT);
|
||||||
|
bot.keyPress(KeyEvent.VK_TAB);
|
||||||
|
sleep();
|
||||||
|
|
||||||
|
bot.keyRelease(KeyEvent.VK_TAB);
|
||||||
|
bot.keyRelease(KeyEvent.VK_ALT);
|
||||||
|
sleep();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void applytime() {
|
||||||
|
pressTimes(KeyEvent.VK_TAB, 4);
|
||||||
|
press(KeyEvent.VK_DOWN); //1mal täglich
|
||||||
|
press(KeyEvent.VK_TAB); //zeiger auf Uhr
|
||||||
|
//pressTimes(KeyEvent.VK_UP, 24); //00:00 auswählen
|
||||||
|
//pressTimes(KeyEvent.VK_DOWN, 9); //09:00 auswählen
|
||||||
|
press(KeyEvent.VK_0);
|
||||||
|
press(KeyEvent.VK_9); //09:00 wählen
|
||||||
|
press(KeyEvent.VK_TAB);
|
||||||
|
press(KeyEvent.VK_ENTER);//ok
|
||||||
|
sleep(20);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void nexttab() {
|
||||||
|
bot.keyPress(KeyEvent.VK_CONTROL);
|
||||||
|
bot.keyPress(KeyEvent.VK_PAGE_DOWN);
|
||||||
|
sleep();
|
||||||
|
bot.keyRelease(KeyEvent.VK_CONTROL);
|
||||||
|
bot.keyRelease(KeyEvent.VK_PAGE_DOWN);
|
||||||
|
sleep();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void pressTimes(int keycode, int times) {
|
||||||
|
for(int i = 0; i < times; i ++) {
|
||||||
|
press(keycode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void press(int keycode) {
|
||||||
|
bot.keyPress(keycode);
|
||||||
|
sleep();
|
||||||
|
bot.keyRelease(keycode);
|
||||||
|
sleep();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sleep(int n) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(120 * n);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sleep() {
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue