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
  • Wine Maker - Simple Script


    Smokeyjay
     Share

    Recommended Posts

    Hey guys I'm fairly new to Dreambot Scripting but I have a decent background in Java. I was wondering if anyone could recommend some tips on how to make my code more ban-proof. I understand that setting sleep timers, taking breaks, etc are all helpful. But, does adjusting the camera, switching worlds and other things help?

     

    Appreciate it!

     

    @Override
        public int onLoop() {
        	if(getInventory().contains("Grapes") && getInventory().contains("Jug of water") && !getBank().isOpen()) {
        		getInventory().get("Grapes").useOn("Jug of water");
        		getWidgets().getWidgetChild(270, 14, 38).interact();
        		sleepWhile( () -> getInventory().contains("Grapes"), Calculations.random(20000, 25000));
        	} else if (getBank().isOpen()) {
        		if(getInventory().contains("Jug of wine") || getInventory().contains("Unfermented wine")) {
        			getBank().depositAllItems();
        			sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000));
        		} else if (!getInventory().contains("Jug of water")) {
        			getBank().withdraw("Jug of water", 14);
        			sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000));
        		} else if (!getInventory().contains("Grapes")) {
        			getBank().withdraw("Grapes", 14);
        			sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000));
        		} else {
        			getBank().close();
        		}
        	} else {
        		getBank().openClosest();
        		log("Bank sleeping");
        		sleepWhile( () -> getBank().isOpen(), Calculations.random(2000, 10000));
        		log("done sleeping");
        	}
        	return 300;
        }

     

    Link to comment
    Share on other sites

    why sleepWhile?

    when in the inv while its making the wine just do sleepUntil until there is a dialogue || there are no more components in the inventory.

    also your way of handling the bank is weird.. just before get("Grapes") add if(getBank.isOpen()) getBank.close(); or just surround it by an if statement if you want.

     

    also the thread placement is wrong, place this in snippets.

    Edited by Defiled
    Link to comment
    Share on other sites

    19 hours ago, Defiled said:

    why sleepWhile?

    when in the inv while its making the wine just do sleepUntil until there is a dialogue || there are no more components in the inventory.

    I've been looking around and I'm having a hard time finding a tutorial for finding how to listen for dialogue. Is it possible for you to give me an example? 

    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.