bot.getCanvas().getBounds();
only returns the rectnagle of the canvas position within the client, so it returns
0,0,width,height.
So when using robot to take a screenshot it does it from the 0,0 of your screen.
Trying to get the canvas bounds here, x and y are always 0. Any way to find the real position (Edit: gives the bounds of the canvas on the client ,not on the screen, looking for a way to get a box around the client or just the windows)
Pineapples differ from people due to quantum astrological ground pencil shavings rule made pre-fifty-seventh showdown of the pickle finned produce parade -.-
I assumed he meant collect data from people playing legit on the client and translate that into the sleeps and mouse paths the client makes ect ect.
Osbots mouse is already surprisingly human and un-repetitive...
I made a class that tracks mouse points and paths and colours them based on frequency.
Rarely ever was a point even in the second colour grid of >1 uses.
And this was monitoring basic item combining in a bank where you're only interacting with 2 items and 1 interface.
Sssssssound Ssssssslipery to me ; ).
I'm sure there'd be a way,
Like the people above me said, a good way would be to locate something thats relative position will always be the same.
This can even the be the point you enter the instance, if its always the same tile you start off in.
Umm maybe something along the lines of this:
(Not sure if it works but the logic is there and could be tweaked)
void hovenEntityOption(Entity entity, String option){
if(menu.isOpen() && menuContains(option)){
Rectangle optionBox = menu.getOptionRectangle(menuIndex(option));
if(optionBox != null){
if(optionBox.contains(mouse.getPosition())){
//idling
}else{
int x,y;
do {
x = (int) (optionBox.getX() + optionBox.getWidth() * Math.random());
y = (int) (optionBox.getY() + optionBox.getHeight() * Math.random());
} while(!optionBox.contains(x,y)) ;
mouse.move(x,y);
}
}
}else{
if(menu.isOpen() && !menuContains(option)){
menu.selectAction("Cancel");
}else {
if (entity.hover()) {
mouse.click(false);
}
}
}
}
Break It Down:
Reflection is where you locate and boot the main class so you have a contained running instance.
Then you load hooks (paths) to the methods and fields you want inside this running client.
Then you use the loaded hooks to run your scripts.
: Reading fields in external running code
Alot easier to do on a rsps than it is to do on rs in terms of finding the fields :P