Jump to content

Client bug?


Recommended Posts

Posted
public void antiBan2() throws InterruptedException {
        int random = random(1,3);

         if (random == 1) {    
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(1000, 2000));
            if (random == 2) {    
                sleep(random(1000, 2000));
                mouse.moveRandomly(random(300, 1000));
                mouse.moveRandomly(random(1000, 2000));}
        }
    }

This should move mouse 2/3 times, but it works only like 1/100.

 

The same thing happens with path 

new Position(3027 +random(-2, 2),3709 +random(-2, 2),0)

each time its used it should be random, but instead path is always repeated the same and actually changes only like 1/100 time.

Posted (edited)
public void antiBan2() throws InterruptedException {
        int random = random(1,3);

         if (random == 1) {    
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(1000, 2000));
            if (random == 2) {    
                sleep(random(1000, 2000));
                mouse.moveRandomly(random(300, 1000));
                mouse.moveRandomly(random(1000, 2000));}
        }
    }

This should move mouse 2/3 times, but it works only like 1/100.

 

The same thing happens with path 

new Position(3027 +random(-2, 2),3709 +random(-2, 2),0)

each time its used it should be random, but instead path is always repeated the same and actually changes only like 1/100 time.

 

 

 

Your logic is flawed that's why. You have nested if(random == 2) inside if(random == 1).  So the code inside if(random == 2) will never be executed, because it can only be reached if random = 1...

 

It should look more like:

public void antiBan2() throws InterruptedException {
        
    int random = random(1,3);

    switch(random){

        case 1:
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(1000, 2000));
            break;
        case 2:
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(300, 1000));
            mouse.moveRandomly(random(1000, 2000));
            break;
    }
}

The same thing happens with path 

new Position(3027 +random(-2, 2),3709 +random(-2, 2),0)

each time its used it should be random, but instead path is always repeated the same and actually changes only like 1/100 time.

 

 

That is because the walker in OSBot walks to a position within (i think) 2 tile accuracy.

 

If you want it to walk to the exact tile, you will need to create your own WalkingEvents.

Edited by Explv
  • Like 2
Posted

Your logic is flawed that's why. You have nested if(random == 2) inside if(random == 1).  So the code inside if(random == 2) will never be executed, because it can only be reached if random = 1...

 

It should look more like:

public void antiBan2() throws InterruptedException {
        
    int random = random(1,3);

    switch(random){

        case 1:
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(1000, 2000));
            break;
        case 2:
            sleep(random(1000, 2000));
            mouse.moveRandomly(random(300, 1000));
            mouse.moveRandomly(random(1000, 2000));
            break;
    }
}

 

That is because the walker in OSBot walks to a position within (i think) 2 tile accuracy.

 

If you want it to walk to the exact tile, you will need to create your own WalkingEvents.

 

This ^

 

You nested the if statements instead of putting them behind eachother :)

 

Khaleesi

 

Posted (edited)

I tried

walking.walk(new Position(3027 +random(-2, 2),3709 +random(-2, 2),0));

walking.webWalk(new Position(3027 +random(-2, 2),3709 +random(-2, 2),0));

Position[] PATH = {new Position(3020 +random(-2, 2),3700 +random(-2, 2),0), new Position(3027 +random(-2, 2),3709 +random(-2, 2),0)};

localWalker.walkPath(PATH);


it seems, that all methods which involve 

new Position

, will generate 1 random position and will repeat it.

 

while

localWalker.walk(3027 +random(-2,2), 3709 +random(-2,2));

generates new position each time its used..

Edited by gorgas8

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...