How do I get to access and send I/O-device information, more specifically mouse move and click (press and release), from and to a game-client?

StackOverflow https://stackoverflow.com/questions/14837676

Question

I am currently trying to make a program that will automatically accept a pop-up queue inside a game client. I have managed to get everything to work the way I want when not inside the client. However, when opening the game client, the robot class that I have used loses its ability to move, press and release the mouse. However, it seems as if it is still analyzing the colors at the pointer locally. That is; not inside the game client.

Here's a codefragment from the app.:

/analyzes the colors at the mouse pointer's position inside a loop. When it changes to a certain limit/the menu pops up, an if-sentence becomes true, and triggers a small delay, before the mouse clicks where the accept button is supposed to be/

p = MouseInfo.getPointerInfo().getLocation();

rgb = this.robot.getPixelColor(p.x, p.y);

/(this is the position where the accept button will be relative to all in-game clients in the 16:9 format)/

this.robot.mouseMove((int)(inGameScrnSize.width * 0.4575), (int)(inGameScrnSize.height * 0.4753));

robot.delay(100);

robot.mousePress(InputEvent.BUTTON1_MASK);

robot.mouseRelease(InputEvent.BUTTON1_MASK);


So my question is: How do I get to access and send I/O-device information from and to the game-client? Is this possible with the java Robot class?

Was it helpful?

Solution

I recall this being about how to control I/O from within the WoW-client with an algorithm written in Java, that would start the client from the desktop coordinate system. The problem is that once the robot-object is instantiated, it interprets all method calls as being in the coordinate system where it was instantiated, thus making it work if starting it once you are inside of the client coordinate system (which I got to work just fine), but not within two different coordinate systems consecutively. Therefore, instantiating a new robot-class after focus is switched to the second coordinate system should work just fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top