public static void main(String[] args) throws InterruptedException {Buuuut It doest work at osu ... why?
Scanner scan;
scan = new Scanner(System.in);
//create robot
Robot robot = null;
try {
robot = new Robot();
} catch (AWTException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
//connect to my phonees ip/port
Socket kkSocket = new Socket("192.168.178.28", 4123);
PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(
new InputStreamReader(kkSocket.getInputStream()));
//infinite loop that waits for incoming numbers
while(true){
String str = in.readLine();
//if my phone sends a "1" i should press a and so on
if (str.equals("1")){robot.keyPress(KeyEvent.VK_A);}
if (str.equals("2")){robot.keyPress(KeyEvent.VK_B);}
if (str.equals("3")){robot.keyPress(KeyEvent.VK_C);}
if (str.equals("4")){robot.keyPress(KeyEvent.VK_D);}
System.out.println(str);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
At erery programm the input works but Osu! :/
Should i post this at bug report too?
Edit: Yes I know that it is wrong to throw over the main method