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
  • Case1 mines rock1, case 2 mines rock1


    MachineAIExp
     Share

    Recommended Posts


    Hello all!

     

    Currently I have a script that tries to mine some ores, there are already a lot of scripts out there, but I tried one myself. Everything works fine, except for one minor thing. Currently my code keeps clicking on the same rock even though I have a different ID when that case is running. So e.g. it runs case 1 and mines rock 1, wich is good, but then that rock depletes and the debugger goes to rock 2, but it mines rock 1 again which is still depleted. This is my code where I call these ID's. Any Ideas on how to fix this?

    		case MINING1:
    			log("Mining northern");
    			GameObject myORE = getGameObjects().closest(gameObject -> gameObject != null && getGameObjects().getTopObjectOnTile(north).getID() == 11364);
    			myORE.interact("Mine");
    			sleepUntil( () -> getGameObjects().getTopObjectOnTile(north).getID() != 11364, Calculations.random(10000, 20000));
    			break;
    		case MINING2:
    			log("Mining middle");
    			GameObject myORE2 = getGameObjects().closest(gameObject -> getGameObjects().getTopObjectOnTile(middle).getID() == 11364);
    			myORE2.interact("Mine");
    			sleepUntil( () -> getGameObjects().getTopObjectOnTile(middle).getID() != 11364, Calculations.random(10000, 20000));
    			break;
    		case MINING3:
    			log("Mining southern");
    			GameObject myORE3 = getGameObjects().closest(gameObject -> gameObject != null && getGameObjects().getTopObjectOnTile(south).getID() == 11365);
    			myORE3.interact("Mine");
    			sleepUntil( () -> getGameObjects().getTopObjectOnTile(south).getID() != 11365, Calculations.random(10000, 20000));
    			break;

     

    Link to comment
    Share on other sites

    • 8 months later...

    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.