Cloxygen Posted April 28, 2017 Share Posted April 28, 2017 I've seen this in other scripts, where you click the Entity when the script starts. However input is disabled by default when a script is running, how can i change this? Quote Link to comment Share on other sites More sharing options...
Polymorphism Posted April 28, 2017 Share Posted April 28, 2017 >onMouseClick >iterate all objects/npcs/etc >>if mouse click point is within the Entity model >>get that entity Similar concept as showing/hiding paint on screen with a mouse click. User input doesn't have to be enabled. Quote Link to comment Share on other sites More sharing options...
Cloxygen Posted April 28, 2017 Author Share Posted April 28, 2017 I have basically this already coded, but it only works when i enable input Quote Link to comment Share on other sites More sharing options...
Alek Posted April 28, 2017 Share Posted April 28, 2017 Like the way I have it in all my scripts? It's all Java API for Swing/AWT, human input is not necessary. Quote Link to comment Share on other sites More sharing options...
Cloxygen Posted April 28, 2017 Author Share Posted April 28, 2017 24 minutes ago, Alek said: Like the way I have it in all my scripts? It's all Java API for Swing/AWT, human input is not necessary. I've only used your woodcutter, but yeah pretty much like that. When the script starts you click the tree you want and it gets that entity, how is that not user input? Currently I can get the entity on cursor, highlight it with paint, set it to interact with mouse click. Only thing I'm missing is the ability to move the mouse around. Quote Link to comment Share on other sites More sharing options...
liverare Posted April 28, 2017 Share Posted April 28, 2017 https://osbot.org/api/org/osbot/rs07/Bot.html#addMouseListener-java.awt.event.MouseListener- Quote Link to comment Share on other sites More sharing options...
Final Posted April 28, 2017 Share Posted April 28, 2017 You cache the first entity/name of entity (whatever you want) they select. Quote Link to comment Share on other sites More sharing options...
Cloxygen Posted April 28, 2017 Author Share Posted April 28, 2017 Just now, Final said: You cache the first entity/name of entity (whatever you want) they select. 1 minute ago, Final said: they select. Anyway, I'm trying out mouse listener. Hopefully its what I'm looking for. 38 minutes ago, liverare said: https://osbot.org/api/org/osbot/rs07/Bot.html#addMouseListener-java.awt.event.MouseListener- Hey it works, thanks buddy! Quote Link to comment Share on other sites More sharing options...