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
  • Babysit Maniacal Monkeys Hunter


    Fizzle

    Recommended Posts

    Made a simple hunter bot that requires manual set up and babysitting for banking.

    Pre reqs:

    - 60 hunter

    - mm2

    - banana baskets

    set up:

    - be at maniacal monkey hunter spot

    - mount gorilla

    - stand next to any boulder

    - start bot with at least 1 spot free (4 recommended) + banana baskets

    example inventory:

    image.png.5fd9c563c500265ede492102653fe0f0.png

    usage:

    - start bot, it will self stop when out of bananas

    -  manually resupply and come back here

    - xp rates dependent on hunter level and how much anti ban you want

    example logs:

    image.png.cfc8dbf5a5978b03cbe0b717ebeeb7b2.png

    features:

    - some minor anti ban:

        - chance for short afk and long afk

        - chance to move mouse off screen after every trap set up

        - chance to accidentally try to empty too many baskets

        - chance to delay setting up and checking trap

        - chance to accidentally dismantle trap

    All of these features can be easily turned on or off by changing values or commenting out code.

     

    My first scripts so please feel free to critique. Can be made fully automatic by handling the resupply stage.

    NOTE: there is no UI so please keep logs open for info like xp per hour and actions taken.

     

    code:

    import org.dreambot.api.input.Mouse;
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.container.impl.Inventory;
    import org.dreambot.api.methods.interactive.GameObjects;
    import org.dreambot.api.methods.interactive.Players;
    import org.dreambot.api.methods.skills.Skill;
    import org.dreambot.api.methods.skills.Skills;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.utilities.Logger;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.items.Item;
    
    import java.util.concurrent.TimeUnit;
    
    @ScriptManifest(
            name = "Maniacal Monkeys",
            description = "Hunter Maniacal Monkeys",
            author = "",
            version = 0.2,
            category = Category.HUNTING
    )
    public class FizzleManiacalMonkeys extends AbstractScript {
    
        private static final int LONG_ANTIBAN_TIME_UPPER = Math.toIntExact(TimeUnit.MINUTES.toMillis(4) + TimeUnit.SECONDS.toMillis(26));
        private static final int LONG_ANTIBAN_TIME_LOWER =  Math.toIntExact(TimeUnit.MINUTES.toMillis(2) + TimeUnit.SECONDS.toMillis(11));
        private static final int SHORT_ANTIBAN_TIME_UPPER = Math.toIntExact(TimeUnit.SECONDS.toMillis(46));
        private static final int SHORT_ANTIBAN_TIME_LOWER = Math.toIntExact(TimeUnit.SECONDS.toMillis(11));
        private static final int NORMAL_ACTION_WAIT_TIME_UPPER = 1160;
        private static final int NORMAL_ACTION_WAIT_TIME_LOWER = 460;
        private static final double CHANCE_OF_LONG_ANTIBAN = 0.15;
    
        private final long scriptStartTime = System.currentTimeMillis();
        private long startingHunterXP;
        private long timeSinceLastAntiBan = System.currentTimeMillis();
        private final long timePerAntiBan = TimeUnit.MINUTES.toMillis(8) + TimeUnit.SECONDS.toMillis(39);
    
        @Override
        public void onStart() {
            Logger.log("Starting Hunter Maniacal Monkeys Script");
            startingHunterXP = Skills.getExperience(Skill.HUNTER);
        }
    
        @Override
        public int onLoop() {
            logHunterXP();
    
            // antiban
            if (System.currentTimeMillis() - timeSinceLastAntiBan >= timePerAntiBan) {
                timeSinceLastAntiBan = System.currentTimeMillis();
                return antiban();
            }
    
            if (Players.getLocal().isAnimating()) {
                // do nothing until not animating
                return normalActionTime();
            }
    
            GameObject boulder = GameObjects.closest("Large boulder", "Monkey trap");
    
            if (boulder == null) {
                log("No boulder found, stopping script");
                stop();
                return 2000;
            }
    
            if (boulder.hasAction("Set-trap")) {
                unloadBananasIfPossible();
    
                // chance to delay setting trap
                if (Math.random() < 0.6) {
                    log("Antiban: Delayed setting trap");
                    sleep(Calculations.random(511, 4360));
                }
                log("Set trap");
                boulder.interact("Set-trap");
                sleep(normalActionTime());
    
                // chance to move mouse off-screen
                if (Math.random() < 0.5) {
                    log("Antiban: Moved mouse off screen");
                    Mouse.moveOutsideScreen();
                }
    
                return normalActionTime();
            }
    
            if (boulder.hasAction("Check")) {
                if (Inventory.emptySlotCount() == 0) {
                    log("Inventory is not empty when trying to collect, stopping");
                    stop();
                }
                log("Check trap");
                if (Math.random() < 0.6) {
                    log("Antiban: Delayed checking trap");
                    sleep(Calculations.random(511, 4360));
                }
                boulder.interact("Check");
                return normalActionTime();
            }
    
            log("waiting for trap to trigger");
    
            // small chance to accidentally dismantle trap
            if (Math.random() < 0.01) {
                if (boulder.hasAction("Dismantle")) {
                    log("Antiban: Accidentally dismantled trap");
                    boulder.interact("Dismantle");
                }
            }
    
            return normalActionTime() + 3000; // +3000 to reduce spamming
        }
    
        private void unloadBananasIfPossible() {
            if (Inventory.contains("Banana")) return;
    
            //drop damaged tails and empty baskets
            Inventory.dropAll("Damaged monkey tail", "Basket");
    
            //check if available banana baskets, if not then stop
            if (!hasBananaBasketsInInventory()) {
                log("No more banana baskets, stopping script");
                stop();
                sleep(2000);
            }
    
            //loop open baskets until full or no more banana baskets
            while (Inventory.emptySlotCount() != 0 && hasBananaBasketsInInventory()) {
                getBananaBasketInInventory().interact("Empty");
                sleep(normalActionTime() + 211);
            }
    
            // chance to intentionally accidentally try open 1 more if it exists
            if (Math.random() < 0.1 && hasBananaBasketsInInventory()) {
                log("Antiban: Accidentally tried to open 1 more basket");
                getBananaBasketInInventory().interact("Empty");
            }
        }
    
    
        private int normalActionTime() {
            return Calculations.random(NORMAL_ACTION_WAIT_TIME_LOWER, NORMAL_ACTION_WAIT_TIME_UPPER);
        }
    
        private boolean hasBananaBasketsInInventory() {
            return Inventory.get((item) -> item != null && item.getName().contains("Bananas")) != null;
        }
    
        private Item getBananaBasketInInventory() {
            return Inventory.get((item) -> item != null && item.getName().contains("Bananas"));
        }
    
        private void logHunterXP() {
            long currentHunterXP = Skills.getExperience(Skill.HUNTER);
            long hunterXPGained = currentHunterXP - startingHunterXP;
            double hunterXPPerHour =  ((double) hunterXPGained / ((System.currentTimeMillis() - scriptStartTime) / 3600000.0D))/1000;
            log("Hunter XP Gained: " + hunterXPGained + " (" + String.format("%.2f", hunterXPPerHour) + "K XP/H)");
        }
    
        private int antiban() {
            double randomValueAntiBan = Math.random();
            Logger.debug("random value antiban: " + randomValueAntiBan);
    
            int randomTime;
            if (randomValueAntiBan <= CHANCE_OF_LONG_ANTIBAN) {
                randomTime = Calculations.random(LONG_ANTIBAN_TIME_LOWER, LONG_ANTIBAN_TIME_UPPER);
            } else {// short antiban
                randomTime = Calculations.random(SHORT_ANTIBAN_TIME_LOWER, SHORT_ANTIBAN_TIME_UPPER);
            }
            Logger.log("Antiban: afk for " + randomTime/1000 + " seconds");
            Mouse.moveOutsideScreen();
            return randomTime;
        }
    }
    

     

     

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