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
  • Any help with?


    ProBotterIamN

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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.