Jump to content

Increasing accuracy of object.interact


omni4life

Recommended Posts

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

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

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

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

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