iJodix Posted February 25, 2016 Share Posted February 25, 2016 (edited) Alright, So for interacting with entity/position we can do this for event; if (getMouse().getCrossHairColor().equals(CrossHairColor.YELLOW)) { //OR RED setFinished(); } But how am i supposed to do it for inventory items/widgets ? Am i supposed to use CrossHairColor.NONE ? I need this for my custom interaction method. Edited February 25, 2016 by iJodix Quote Link to comment Share on other sites More sharing options...
Goaks Posted February 25, 2016 Share Posted February 25, 2016 (edited) for the invent could you not check the top left hand corner? Not looked from coding POV but you can see it changes from / 2 more options to ''->" Edited February 25, 2016 by Goaks Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted February 25, 2016 Share Posted February 25, 2016 Why wouldn't it be successful? Those things are static, so you can safely say success iff mouse.click is successful, right? Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 25, 2016 Author Share Posted February 25, 2016 (edited) Why wouldn't it be successful? Those things are static, so you can safely say success iff mouse.click is successful, right? I'd rather double check as i don't want script to eff up. But what for CrossHairColor.NONE is ? Am i supposed to use it for cases like this ? Edited February 25, 2016 by iJodix Quote Link to comment Share on other sites More sharing options...
itzDot Posted February 25, 2016 Share Posted February 25, 2016 If interact(action name) { It happenend successfully } else{ it failed} Quote Link to comment Share on other sites More sharing options...
BloodRush20 Posted February 25, 2016 Share Posted February 25, 2016 I'd rather double check as i don't want script to eff up. But what for CrossHairColor.NONE is ? Am i supposed to use it for cases like this ? Could you just use the isItemSelected() from the inventory API class? click.item; sleep(600); if (item.isItemSelected()) { do stuff } Or am I missing what your asking? Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 25, 2016 Author Share Posted February 25, 2016 Could you just use the isItemSelected() from the inventory API class? click.item; sleep(600); if (item.isItemSelected()) { do stuff } Or am I missing what your asking? This would work for items that you don't have to equip/wield/drop, Everyone wondering why i need this is because i'm writing my own custom interaction method. Quote Link to comment Share on other sites More sharing options...
Volta Posted February 25, 2016 Share Posted February 25, 2016 >doesn't trust the interact() boolean Quote Link to comment Share on other sites More sharing options...
BloodRush20 Posted February 25, 2016 Share Posted February 25, 2016 This would work for items that you don't have to equip/wield/drop, Everyone wondering why i need this is because i'm writing my own custom interaction method. Got it I mean the interact boolean as stated would work however there is always a way to notice a change. equip something the character would change equipment wise and so on. I cant say I fully understand your end goal so it's harder to help out. Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 25, 2016 Author Share Posted February 25, 2016 >doesn't trust the interact() boolean I need this for my custom interaction method :p Got it I mean the interact boolean as stated would work however there is always a way to notice a change. equip something the character would change equipment wise and so on. I cant say I fully understand your end goal so it's harder to help out. Alright, let me try to elobrate; If you click on any entity successfully, a red crosshair appears, if you missclick, a yellow one appears, But when you need to interact with widgets/inventory items like equip/drop/ etc no crosshair appears. Quote Link to comment Share on other sites More sharing options...
Goaks Posted February 25, 2016 Share Posted February 25, 2016 I need this for my custom interaction method Alright, let me try to elobrate; If you click on any entity successfully, a red crosshair appears, if you missclick, a yellow one appears, But when you need to interact with widgets/inventory items like equip/drop/ etc no crosshair appears. if you equip/drop it will disapear from invent. so take a count of item before and after. the difference should be 1. Else it failed Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 25, 2016 Author Share Posted February 25, 2016 if you equip/drop it will disapear from invent. so take a count of item before and after. the difference should be 1. Else it failed Never mind guys, i used CrossHairColor.NONE and it seems to be do it job well, so i guess NONE is meant to be used for situations like this. Quote Link to comment Share on other sites More sharing options...
BloodRush20 Posted February 25, 2016 Share Posted February 25, 2016 Never mind guys, i used CrossHairColor.NONE and it seems to be do it job well, so i guess NONE is meant to be used for situations like this. I was about to suggest this. I'm glad it worked out tho. 1 Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted February 26, 2016 Share Posted February 26, 2016 Never mind guys, i used CrossHairColor.NONE and it seems to be do it job well, so i guess NONE is meant to be used for situations like this. Another idea might simply be to check if the mouse is within a slightly shrunken bounding box. Quote Link to comment Share on other sites More sharing options...
Krulvis Posted February 27, 2016 Share Posted February 27, 2016 (edited) Never mind guys, i used CrossHairColor.NONE and it seems to be do it job well, so i guess NONE is meant to be used for situations like this. The crosshair color is always None, unless you click somewhere (that triggers either red/yellow color). Checking for none does not solve your issue here. There is no way to really confirm a click when you are interacting with interfaces/inventory/equipment. https://dl.dropboxusercontent.com/s/e3znjjxqw0tht27/2016-02-27_18-04-54.mp4?dl=0 Edited February 27, 2016 by Krulvis Quote Link to comment Share on other sites More sharing options...