Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Detect user clicks

Joined
Jan 23, 2017
Messages
13
I want my player to select a target ingame using the right click on it. How do I detect a user's clicks?

Thanks
 
Joined
Jan 23, 2017
Messages
13
Implementing the mouselistener interface and adding the instance to the bot's event dispatcher.
Thanks for your reply!
I got some of the code but I can't get this to work.
So far I've got this:

... implements MouseListener ...

@Override
public void onStart(String... arg0) {
getEventDispatcher().addListener(this);
}

@Override
public void mouseClicked(MouseEvent arg0) {
demo.logMessage(arg0.getButton() + "");
if(arg0.getButton() == MouseEvent.BUTTON2) {
demo.logMessage((Mouse.getTarget() == null) + "ttt");
}
}



the demo.logMessage is where my output goes to but there is no output in any case.
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
Thanks for your reply!
I got some of the code but I can't get this to work.
So far I've got this:

... implements MouseListener ...

@Override
public void mouseClicked(MouseEvent arg0) {
demo.logMessage(arg0.getButton() + "");
if(arg0.getButton() == MouseEvent.BUTTON2) {
demo.logMessage((Mouse.getTarget() == null) + "ttt");
}
}



the demo.logMessage is where my output goes to but there is no output in any case.
Have you added the listener to the bot's event dispatcher?
 
Joined
Jan 23, 2017
Messages
13
i'm not sure about it but since we moved on to using the official client, the input listeners may not be supported anymore.
@Party?

If that's the case I must say that this places RuneMate down many spots on the list. (starting from first place)

(I already knew this about the paintlistener which is actually deprecated too)
 
Can someone verify this is the case?
 
Joined
Mar 28, 2017
Messages
286
Just wanted to say I don't think it's been depreciated/not supported. Fonrus's visual developer shows information of the NPC/Object/Player the user clicks.
 
Top