Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Any help with?


    ProBotterIamN
     Share

    Recommended Posts

    Any help with walking and opening + buying items?

     

     

     

     

    package test;
    
    
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.map.Tile;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.script.Category;
    
    
    @ScriptManifest(author = "ProBotterIamN", name = "Random Name" , version = 1.0, description = "soon to be added", category = Category.RANDOMCATEGORY)
    public class main extends AbstractScript {
    
    
    public void onStart() {
    log("Starting Script!");
    log("More features will be added soon!");
    log("Leave feedback!");
    
    
    }
    
    
    private enum State {
    BANK, WALK, BUY, WAIT
    };
    
    
    private State getState() {
    getNpcs().closest("Banker");
    if (!getInventory().isFull())
    return State.BANK;
    getNpcs().closest("Gem trader");
    if (!getInventory().isEmpty())
    return State.BUY;
    return State.WAIT;
    }
    
    
    public void onExit() {
    log("Thanks for running Gem Buyer!");
    }
    
    
    Tile gemsellertile = new Tile(3288, 3212); // Gem Seller Tile
    Tile banktile = new Tile(3271, 3167); //Bank Tile
    
    
    @Override
    public int onLoop() {
    switch (getState()) {
    case BUY:
    if(gemsellertile.distance(getLocalPlayer()) <= 4) {
    if(!getInventory().isEmpty()) {
    log("Buying dat Bling!");
    gem.interact("Gem trader");
    }else{
    log("Walking to Gem Trader!");
    getWalking().walk(gemsellertile.getRandomizedTile());
    sleep(Calculations.random(1827,2482));
    }
    }
    case BANK:
    banker.interact("Bank Banker");
    break;
    case WAIT:
    sleep(300);
    break;
    default:
    break;
    
    
    }
    return Calculations.random(500, 600);
    }
    }
    Edited by ProBotterIamN
    Link to comment
    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
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.