1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Block check

Discussion in 'Developer Support' started by chad, Jan 22, 2018.

  1. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    Can we get a way to check if an object is blocking something?

    I have my bot check if the NPC is visible, and if it isn't to turn my screen. However it's just clicking on the tree because it doesn't know there is an object blocking it.

    This is a picture of a bot trying to pickpocket an NPC that is being blocked by an object.
    [​IMG]


    @Aidden --- Sorry that I keep tagging you. You are the only staff member I can get to respond to anything. Thanks in advance.

     
  2. Best Answer:
    Post #4 by tyb51, Jan 22, 2018
  3. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    use npc.interact("action") and don't use .click
     
  4. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    I understand that is the temporary workaround, but I would like to see something like this added eventually. I'm not sure if they are aware it's an issue.
     
  5. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    it's not a temporary workaround. It's the preferred way. using npc.click() just hovers over the projected bounding box of an object and clicks. You should only use that for situation where you are 100% sure it will click. If you want a workaround use Menu.isOpen() or Menu.contains(...) to check if the hovered object is actually hovered and not another one
     
    Jux7apose and Snufalufugus like this.
  6. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    Isn't that unrealistic for people to right click - interact? Very botlike. That's why I was using the click over the right click - interact.
     
  7. tyb51

    tyb51 Niche bots at your disposal

    Joined:
    Dec 23, 2015
    Messages:
    1,098
    Likes Received:
    439
    the method automatically detects when to left click and when to right click. If you want left click only do the menu thing
     
    chad and Snufalufugus like this.
  8. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    npc.interact automatically detects when to left click? Anytime I've ever used it, it just right clicks, then picks the option I have provided. I will do more testing then. Thank you.
     
  9. Snufalufugus

    Joined:
    Aug 23, 2015
    Messages:
    1,961
    Likes Received:
    757
    Check if you have force menu interactions turned on iny our RM settings
     
    chad likes this.
  10. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    Thanks, i'll look into that when I get home.
     
  11. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,606
    Likes Received:
    990
    It's also PlayerSensed as far as i know so it might just be that the account your using has a ps profile that says to always right click.
    As was mentioned earlier, interact is the way to go. Also, iirc there's an override for interact that takes a boolean which lets you decide whether it should right click or left click.

    As to your suggestion, afaik it's just not possible without considerable overhead (which would drag the performance of all bots down). This is because you would essentially have to check basically everything that's loaded to see if it's behind or in front of your target in terms of z-depth (basically the order of the objects that the camera sees) and then you would have to check if the target is within the bounding box of the objects closer to the camera or not, and probably have to transform the bounding box from 3d space to screen space. So if i made any sense at all just then it would be a very costly operation.
     
  12. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    Fair enough. I Figured i'd ask.

    When you say that there is an override to make interact decided whether to click or right click, how does it know which to do? Can you provide me documentation regarding this function?
     
  13. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,606
    Likes Received:
    990
    Hmm i can't seem to find what i'm thinking of. Just try the other stuff and see how you go.
     
  14. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    Sounds good, thanks!
     
  15. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
    Might I add that if you really want click to function in your case is not to use .isVisible() but .getVisibility() that returns the percentage of visibility of the object. The npc is still slightly visible through the tree, causing .isVisible() to return true. If you use a percentage, say like 50, it will return false and according to your logic, the camera will turn.
     
    chad likes this.
  16. chad

    Joined:
    Mar 27, 2015
    Messages:
    109
    Likes Received:
    19
    I'll give that a shot, thanks!
     

Share This Page

Loading...