Jump to content

How to determine if interaction was successful


Recommended Posts

Posted (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 by iJodix
Posted (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 by iJodix
Posted

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.

Posted

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.

Posted

>doesn't trust the interact() boolean doge.png

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.

Posted

I need this for my custom interaction method tongue.png

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

Posted (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 by Krulvis

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...