Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
tri335go

need help with a walk issue!

3 posts in this topic

hi,

I'm trying to make a script where I walk through the wilderness and if an enemy is near I tele.  The problem is that when I do a blindwalk through the wilderness to where I'm trying to go, it doesn't read my method that says to teleport if it sees a player.  how do i make it so that it checks for enemies during the blindwalk as an else statement, or how should i go about it? thanks

Share this post


Link to post
Share on other sites

blindWalkTo

public static boolean blindWalkTo(Positionable position,
                                  Condition stopping_condition,
                                  long stopping_condition_delay)
Walks in a straight line towards a specified tile.
Parameters:
position - The desired tile.
stopping_condition - If this returns true when called upon, the method will stop and return false. This condition is checked with a delay of stopping_condition_delay milliseconds. Scripts can perform actions such as eating food when the condition is checked. Use null is you do not want to use a stopping condition.
stopping_condition_delay - The delay in milliseconds between checking the stopping condition.
Returns:
True if the desired tile was reached; false otherwise.
Example:
Walking.blindWalkTo(WILDERNESS_LOCATION, new Condition() {            
    @Override                public boolean active() {
        General.sleep(100, 200);               
        return PLAYER_IS_NEAR;     //Here goes the method that detects nearby players. Return if it detects one.          
    }         
}, General.random(1000, 2000)); //Timeout 

Share this post


Link to post
Share on other sites
5 minutes ago, fleq6 said:

blindWalkTo


public static boolean blindWalkTo(Positionable position,
                                  Condition stopping_condition,
                                  long stopping_condition_delay)
Walks in a straight line towards a specified tile.
Parameters:
position - The desired tile.
stopping_condition - If this returns true when called upon, the method will stop and return false. This condition is checked with a delay of stopping_condition_delay milliseconds. Scripts can perform actions such as eating food when the condition is checked. Use null is you do not want to use a stopping condition.
stopping_condition_delay - The delay in milliseconds between checking the stopping condition.
Returns:
True if the desired tile was reached; false otherwise.
Example:
Walking.blindWalkTo(WILDERNESS_LOCATION, new Condition() {            
    @Override                public boolean active() {
        General.sleep(100, 200);               
        return PLAYER_IS_NEAR;     //Here goes the method that detects nearby players. Return if it detects one.          
    }         
}, General.random(1000, 2000)); //Timeout 

thats beautiful :,)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.