Jump to content

How to determine if interaction was successful


iJodix

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

>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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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