Jump to content

Increasing accuracy of object.interact


Recommended Posts

Posted (edited)

Hey guys,

 

I was wondering if there is a way to increase the accuracy of the .interact method? I have the following code snippet, but sometimes it misclicks the bank chest, clicks through the wall and runs outside looking suspicious and damaging xp/ph

Entity chest = objects.closest(true, bankChest);
.... other code here
chest.interact("Use");

Thanks for any help or suggestions!

 

-Omni.

Edited by omni4life
  • Like 2
Posted

Hey guys,

 

I was wondering if there is a way to increase the accuracy of the .interact method? I have the following code snippet, but sometimes it misclicks the bank chest, clicks through the wall and runs outside looking suspicious and damaging xp/ph

Entity chest = objects.closest(true, bankChest);
.... other code here
chest.interact("Use");

Thanks for any help or suggestions!

 

-Omni.

 

Just wait till you try interacting with a mounted glory :)

  • Like 1
Posted (edited)

Just wait till you try interacting with a mounted glory smile.png

Haha, I don't even want to imagine that nightmare. If I branch out from my iron man, I think I'll be paying for any fiddly scripts rather than writing them myself. I take it from the likes that this is a known issue that's bugging quite a few people wink.png?

Edited by omni4life
Posted

Khaleesi was nice enough to make a thorough bug/suggestion report, so it's something I'll take a look at again. If you are familiar with shapes in Java, we are essentially looking at the worldtoscreen (3d to 2d) shape translation and then finding a point within that shape that is towards the center-mass. From there a PointDestination is generated, the mouse is moved through InteractionEvent, and the evaluation checks to see whether or not the our mouse has reached the target.

 

There is a lot of behind the scenes stuff so when I get a free minute from working on other stuff (like zoom), I'll open this can of worms again.

  • Like 2
Posted (edited)

Khaleesi was nice enough to make a thorough bug/suggestion report, so it's something I'll take a look at again. If you are familiar with shapes in Java, we are essentially looking at the worldtoscreen (3d to 2d) shape translation and then finding a point within that shape that is towards the center-mass. From there a PointDestination is generated, the mouse is moved through InteractionEvent, and the evaluation checks to see whether or not the our mouse has reached the target.

 

There is a lot of behind the scenes stuff so when I get a free minute from working on other stuff (like zoom), I'll open this can of worms again.

Apologies for making another thread, I didn't actually realise that this was on ongoing issue. Most of my "scripting" is 9/10'ths fiddling until something works and 1/10'th coughing in surprise when it actually does. I'd merely assumed I was using the method incorrectly.

 

Best of luck with chasing down the problem and thanks for posting smile.png

Edited by omni4life

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