Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Rotating camera to have object be visible


    lousy

    Recommended Posts

    I'm making a script that needs to interact with entities in a crowded area. Generally when I play through this area I rotate the camera to face the objects before I click them, because the objects all have the same name right clicking them would really only be possible for a bot. As it stands the bot only rotates the camera every so often so in many cases its right clicking on the objects a fair bit, making me think if this was run for any amount of time I'd probably end up getting banned pretty easily. I'd like to have the script:

    • check if the object I want is being drawn on top (like there is nothing else obscuring it, z buffer and all that)
    • if its not then rotate the camera so that the object is the one in front and it can be interacted with via left click.
    • if it is on top, do nothing

    I saw some answers to a different question mention the text in the top left that would appear if the object I wanted was being hovered over, but I couldn't find that in the docs and I think that might fail if all the objects have the same name. I have also tried using `rotateToEntity` (or whatever that Camera function is) but that seems to only work if the object is outside of the viewport, not if its obscured by another object.

    Link to comment
    Share on other sites

    • 2 weeks later...

    Try seeing what the pitch and yaw values are when the camera has a clear sight of your target object. Then you can create a method to adjust the camera based on random pitch/yaw values within the bounds of what you deemed is a clear angle, and only then interact with the object.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.