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


    Smokeyjay

    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.

    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

    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.