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
  • Setting the game client size programmatically


    BenjaminUC
     Share

    Recommended Posts

    Hi,

    I'm quite new to the DreamBot API, however, I'm very experienced when it comes to Java. As my first project, I spent today creating a Tutorial Island Completer to get comfortable with the functionality the API provides. This project is now done and functioning. However, as I've come to learn, DreamBot only works when the game client is in fixed-static-size which is a bummer as new accounts when logged in, are in none-fixed-sized mode. Brand new accounts can't click the settings tab which is required to change it manually. This results in not being able to click the Gielinor Guide programmatically until the settings tab has been unlocked.

    My question is:
    Is there a way to programmatically set the client to fixed-static-size. Any interaction simply doesn't work otherwise.

    Link to comment
    Share on other sites

    Look at random manager.

    I think it's something like:

    getRandomManager().enableSolver((RandomEvent.RESIZABLE_DISABLER); || RandomEvent.ZOOM_SOLVER

    It should already be enabled anyways

    Edited by Zawy
    Link to comment
    Share on other sites

    Disable the zoom solver at the start, and re-enable the solver once the account has clear the guide. 

    @Leanche wrote some shit to make Dreambot work in resizable but not sure if it was ever published publicly. 

    Link to comment
    Share on other sites

    6 minutes ago, Zawy said:

    Look at random manager.

    I think it's something like:

    getRandomManager().enableSolver((RandomEvent.RESIZABLE_DISABLER); || RandomEvent.ZOOM_SOLVER

    It should already be enabled anyways

    I'm aware of those, however, the RESIZABLE_DISABLER is based on clicking the settings tab which is not yet available and thus it doesn't work.

     

     

    8 minutes ago, yeeter01 said:

    Disable the zoom solver at the start, and re-enable the solver once the account has clear the guide. 

    @Leanche wrote some shit to make Dreambot work in resizable but not sure if it was ever published publicly. 

    Tried with a brand new account. Doesn't work.

    Link to comment
    Share on other sites

    2 minutes ago, BenjaminUC said:

    I'm aware of those, however, the RESIZABLE_DISABLER is based on clicking the settings tab which is not yet available and thus it doesn't work.

     

     

    Tried with a brand new account. Doesn't work.

    I am out of town atm, If you cant find the solution by tomorrow remind me and I'll check my account creator and see what I did again. 

    Link to comment
    Share on other sites

    I'm feeling generous. Tut island is one of the hardest entry barriers into coding dreambot scripts IMO. You need to handle a lot of wonky stuff, but you learn a ton in doing so.

     

    		NPC guide = bot.getNpcs().closest("Gielinor guide");
    		if(bot.getClientSettings().isResizableActive()) {
    			Logger.info(bot, "Resizable mode is active, locating trainer.");
    			if(guide != null) {
    				Logger.info(bot,"Found guide, trying to click.");
    				Point p = guide.getModel().calculateCenterPoint();
    				Rectangle GAME_SCREEN = new Rectangle(5, 5, 511, 333);
    				Rectangle CANVAS = new Rectangle(0, 0, 765, 503);
    				int heightAdjust = 80;
    				int widthAdjust = -20;
    				p.setLocation(p.getX() * (CANVAS.getWidth() / GAME_SCREEN.getWidth())+widthAdjust, p.getY() + (CANVAS.getHeight() / GAME_SCREEN.getHeight())+heightAdjust);
    				bot.getMouse().hop(p);
    			}
    			if(bot.getClient().getMenu().contains("Talk-to")) {
    				bot.getMouse().click();
    				FarmBot.sleepUntil(() -> bot.getDialogues().canContinue(), 10000);
    				Logger.info(bot, "Successfully located trainer, navigating dialogue.");
    				Do.continueDialogWithSpace(bot);
    				if(bot.getDialogues().getOptions()!=null) {
    					bot.getDialogues().chooseOption(Calculations.random(1,3));
    				}
    				if(bot.getDialogues().canContinue()) {
    					Do.continueDialogWithSpace(bot);
    				}
    				Logger.info("Unlocked options menu.");
    			}
    		}

     

    Link to comment
    Share on other sites

    14 hours ago, AliasBots said:

    I'm feeling generous. Tut island is one of the hardest entry barriers into coding dreambot scripts IMO. You need to handle a lot of wonky stuff, but you learn a ton in doing so.

     

    		NPC guide = bot.getNpcs().closest("Gielinor guide");
    		if(bot.getClientSettings().isResizableActive()) {
    			Logger.info(bot, "Resizable mode is active, locating trainer.");
    			if(guide != null) {
    				Logger.info(bot,"Found guide, trying to click.");
    				Point p = guide.getModel().calculateCenterPoint();
    				Rectangle GAME_SCREEN = new Rectangle(5, 5, 511, 333);
    				Rectangle CANVAS = new Rectangle(0, 0, 765, 503);
    				int heightAdjust = 80;
    				int widthAdjust = -20;
    				p.setLocation(p.getX() * (CANVAS.getWidth() / GAME_SCREEN.getWidth())+widthAdjust, p.getY() + (CANVAS.getHeight() / GAME_SCREEN.getHeight())+heightAdjust);
    				bot.getMouse().hop(p);
    			}
    			if(bot.getClient().getMenu().contains("Talk-to")) {
    				bot.getMouse().click();
    				FarmBot.sleepUntil(() -> bot.getDialogues().canContinue(), 10000);
    				Logger.info(bot, "Successfully located trainer, navigating dialogue.");
    				Do.continueDialogWithSpace(bot);
    				if(bot.getDialogues().getOptions()!=null) {
    					bot.getDialogues().chooseOption(Calculations.random(1,3));
    				}
    				if(bot.getDialogues().canContinue()) {
    					Do.continueDialogWithSpace(bot);
    				}
    				Logger.info("Unlocked options menu.");
    			}
    		}

     

    Thanks - seems to work!

    I haven't written bot scripts before. I only just downloaded DreamBot yesterday and finished my tutorial island script which now works flawlessly thanks to your little "hack" 😀

    Link to comment
    Share on other sites

    22 minutes ago, BenjaminUC said:

    Thanks - seems to work!

    I haven't written bot scripts before. I only just downloaded DreamBot yesterday and finished my tutorial island script which now works flawlessly thanks to your little "hack" 😀

    Glad to hear it. I got that from somewhere else but I can't remember where. It's not perfect but it gets the job done.

    Link to comment
    Share on other sites

    • 1 month later...
    On 3/28/2020 at 4:31 PM, yeeter01 said:

    I am out of town atm, If you cant find the solution by tomorrow remind me and I'll check my account creator and see what I did again. 

    Is this how you deal with it? VVV

    On 3/29/2020 at 12:00 AM, AliasBots said:

    I'm feeling generous. Tut island is one of the hardest entry barriers into coding dreambot scripts IMO. You need to handle a lot of wonky stuff, but you learn a ton in doing so.

     

    		NPC guide = bot.getNpcs().closest("Gielinor guide");
    		if(bot.getClientSettings().isResizableActive()) {
    			Logger.info(bot, "Resizable mode is active, locating trainer.");
    			if(guide != null) {
    				Logger.info(bot,"Found guide, trying to click.");
    				Point p = guide.getModel().calculateCenterPoint();
    				Rectangle GAME_SCREEN = new Rectangle(5, 5, 511, 333);
    				Rectangle CANVAS = new Rectangle(0, 0, 765, 503);
    				int heightAdjust = 80;
    				int widthAdjust = -20;
    				p.setLocation(p.getX() * (CANVAS.getWidth() / GAME_SCREEN.getWidth())+widthAdjust, p.getY() + (CANVAS.getHeight() / GAME_SCREEN.getHeight())+heightAdjust);
    				bot.getMouse().hop(p);
    			}
    			if(bot.getClient().getMenu().contains("Talk-to")) {
    				bot.getMouse().click();
    				FarmBot.sleepUntil(() -> bot.getDialogues().canContinue(), 10000);
    				Logger.info(bot, "Successfully located trainer, navigating dialogue.");
    				Do.continueDialogWithSpace(bot);
    				if(bot.getDialogues().getOptions()!=null) {
    					bot.getDialogues().chooseOption(Calculations.random(1,3));
    				}
    				if(bot.getDialogues().canContinue()) {
    					Do.continueDialogWithSpace(bot);
    				}
    				Logger.info("Unlocked options menu.");
    			}
    		}

     

     

    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.