Jump to content

Client bug?


gorgas8

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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