Rawrstin Posted May 27, 2016 Share Posted May 27, 2016 if (mouse.getListener().mouseClicked()) { } not quite sure what I'm doing wrong here.. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 27, 2016 Share Posted May 27, 2016 Add this to your onStart() method bot.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { } }); 1 Quote Link to comment Share on other sites More sharing options...
Woody Posted May 27, 2016 Share Posted May 27, 2016 You should implement MouseListener public class YOUR_CLASS_NAME extends Script implements MouseListener Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 27, 2016 Share Posted May 27, 2016 You should implement MouseListener public class YOUR_CLASS_NAME extends Script implements MouseListener I believe your main class which extends the "Script" class already has a Mouselistener implemented. I never had to implement it before.. Quote Link to comment Share on other sites More sharing options...
Woody Posted May 27, 2016 Share Posted May 27, 2016 I believe your main class which extends the "Script" class already has a Mouselistener implemented. I never had to implement it before.. Oh, didn't know that. Either way, both methods will work. 1 Quote Link to comment Share on other sites More sharing options...
Botre Posted May 27, 2016 Share Posted May 27, 2016 Keep in mind that the above methods will only listen to human input mouse events, not bot-generated ones. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 27, 2016 Share Posted May 27, 2016 Keep in mind that the above methods will only listen to human input mouse events, not bot-generated ones. Ya that's correct, didn't think about which one he needed Quote Link to comment Share on other sites More sharing options...
Explv Posted May 27, 2016 Share Posted May 27, 2016 (edited) not quite sure what I'm doing wrong here.. bot.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { } }); If you just want to capture the users' mouse click you can use the MouseAdapter class (Add this to onStart()) getBot().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); // do whatever you want to do when the user clicks the mouse } }); Edited May 27, 2016 by Explv 1 Quote Link to comment Share on other sites More sharing options...
Rawrstin Posted May 27, 2016 Author Share Posted May 27, 2016 Add this to your onStart() method bot.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { } }); Thanks much! ^.^ If you just want to capture the users' mouse click you can use the MouseAdapter class (Add this to onStart()) getBot().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); // do whatever you want to do when the user clicks the mouse } }); You're the man, so just to get this straight.. Listener looks for bot 'onClick', while the Adapter handles the humans 'onClick'? Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 27, 2016 Share Posted May 27, 2016 Thanks much! ^.^ You're the man, so just to get this straight.. Listener looks for bot 'onClick', while the Adapter handles the humans 'onClick'? They both handles human input, not the scripts input 1 Quote Link to comment Share on other sites More sharing options...
Botre Posted May 27, 2016 Share Posted May 27, 2016 There's currently no clean method to track bot clicks. Quote Link to comment Share on other sites More sharing options...
Rawrstin Posted May 27, 2016 Author Share Posted May 27, 2016 They both handles human input, not the scripts input Alright, coolio! Thanks Khal~ 1 Quote Link to comment Share on other sites More sharing options...
Explv Posted May 27, 2016 Share Posted May 27, 2016 There's currently no clean method to track bot clicks. Alright, coolio! Thanks Khal~ I haven't actually tested this out, but this may work for tracking clicks made by the bot: getBot().addMouseListener(new BotMouseListener() { @Override public boolean blockInput(Point point) { return false; } @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); Quote Link to comment Share on other sites More sharing options...
Botre Posted May 27, 2016 Share Posted May 27, 2016 I haven't actually tested this out, but this may work for tracking clicks made by the bot: getBot().addMouseListener(new BotMouseListener() { @Override public boolean blockInput(Point point) { return false; } @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); nope Quote Link to comment Share on other sites More sharing options...
Explv Posted May 27, 2016 Share Posted May 27, 2016 nope rip Quote Link to comment Share on other sites More sharing options...