Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Block check

Joined
Mar 27, 2015
Messages
109
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.
br6mQ98.png



@Aidden --- Sorry that I keep tagging you. You are the only staff member I can get to respond to anything. Thanks in advance.
 
Joined
Mar 27, 2015
Messages
109
use npc.interact("action") and don't use .click
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.
 
Niche bots at your disposal
Joined
Dec 23, 2015
Messages
1,104
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
 
Joined
Mar 27, 2015
Messages
109
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
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.
 
Joined
Mar 27, 2015
Messages
109
the method automatically detects when to left click and when to right click. If you want left click only do the menu thing
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.
 
Joined
Aug 23, 2015
Messages
1,970
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.
Check if you have force menu interactions turned on iny our RM settings
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
Check if you have force menu interactions turned on iny our RM settings
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.
 
Joined
Mar 27, 2015
Messages
109
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.
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?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
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?
Hmm i can't seem to find what i'm thinking of. Just try the other stuff and see how you go.
 
12 year old normie
Joined
Jan 8, 2015
Messages
2,768
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.
 
Joined
Mar 27, 2015
Messages
109
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.
I'll give that a shot, thanks!
 
Top