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
  • Event mouse Left Click for Mining


    maferosrs

    Recommended Posts

    Posted

    Hi Guys !
    I have a problem :'(
     

     

    I'm trying to make a mining script Cooper Ore from a tutorial I'm watching on youtube, Could you please help me :) Thank you

    • How do I make the character click on the rock?
    • With what method can i do this?
    package Miner;
    
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    @ScriptManifest(
            category = Category.FISHING,
            name = "PowerMine2r",
            author = "Mafer",
            version = 2.0 )
    public class Miner extends AbstractScript{
    
        private int state;
        private String ore;
        private GameObject rock;
        private int count;
    
        @Override
        public void onStart() {
            ore = "Copper Ore";
            count = 0;
            state = 0;
        }
    
        @Override
        public int onLoop() {
    
            if (state == 0)
            {
                mine();
            }
            else
            {
                if (state == 1)
                {
                    drop();
                }
                else
                {
    
                }
            }
    
            return Calculations.random(500, 1000);
        }
    
        private void mine(){
            
            if(!getInventory().isFull()){
                rock = getGameObjects().closest(f -> f.getName().contains("Rock"));
    
                if (rock != null){
                    if (rock.interact("Mine")){
    
                        sleepUntil(() -> getInventory().count(ore) > count, Calculations.random(22000,33000));
    
                            if(getInventory().count(ore) > count){
                                count++;
                            }
    
                    }
                }
            }
            else{
                state = 1;
            }
        }
    
        private void drop(){
            if(getInventory().contains(ore)){
            getInventory().dropAllExcept(i -> i.getName().contains("pickaxe"));
            }
            else{
                state =0;
            }
        }
    }
    
    Posted

    if (rock.interact("Miner")){

     

    should be "Mine" ?

    Thank you

     

    How can I check if the rock is empty?

     

    Just click when the rock has mineral?

    if(rock != null){
    }
    
    
    package Miner;
    
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    @ScriptManifest(
            category = Category.FISHING,
            name = "PowerMiner_6",
            author = "Mafer",
            version = 6.0 )
    public class Miner extends AbstractScript{
    
        private int state;
        private String ore;
        private GameObject rock;
        private int count;
    
        @Override
        public void onStart() {
    
        }
    
        @Override
        public int onLoop() {
        	
        	if(rock != null){
        		rock = getGameObjects().closest(f -> f.getName().contains("Rock"));
        	}
    
            return Calculations.random(1, 10);
        }
    }
    
    Posted

    You can check its color

    Thank you

    this ? rock.getModelColors()

    Posted

    Dont rocks have different IDs than when they are mine-able?

    Posted

    Dont rocks have different IDs than when they are mine-able?

     

    Sorry, I did not understand.

    Posted

    Sorry, I did not understand.

    Just use model colors and check if it returns null and if they are the rock is mined.

    Posted

    Just use model colors and check if it returns null and if they are the rock is mined.

     

    I can not find Color Model in the documentation  :'(

    Posted

    Thank you

    this ? rock.getModelColors()

     

     

    I can not find Color Model in the documentation  :'(

    You already have it :D

    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.