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
  • Changes from DB2 to DB3


    mozeratti

    Recommended Posts

    This topic is to help scripters change their DB2 scripts to DB3.

    First of all make sure you have the DB3 Client library in your script. just as you did for the DB2 library.

    If you have done that,
    Here are some examples of the changes. And these changes are basically for 95% of the new codes.

    Old code:

    		if (min <= 10000) {
    			if (getShop().isOpen()) {
    				getShop().close();
    				sleep(Calculations.random(300, 600));
                  			getTabs().open(Tab.LOGOUT);
    				sleep(Calculations.random(1000, 2000));
    				WidgetChild logOut = getWidgets().getWidgetChild(182, 12);
    				logOut.interact("Logout");
    				log("Not enough coins");
    				stop();
    			}
    		      		getTabs().open(Tab.LOGOUT);
    				sleep(Calculations.random(1000, 2000));
    				WidgetChild logOut = getWidgets().getWidgetChild(182, 12);
    				logOut.interact("Logout");
    				log("Not enough coins");
    				stop();
            }

    New code:

    		if (min <= 10000) {
    			if (Shop.isOpen()) {
    				Shop.close();
    				sleep(Calculations.random(300, 600));
    				Tabs.open(Tab.LOGOUT);
    				Sleep(Calculations.random(400, 600));
    				WidgetChild logOut = Widgets.getWidgetChild(182, 8);
    				logOut.interact("Logout");
    				stop();
    			}
    				Tabs.open(Tab.LOGOUT);
    				sleep(Calculations.random(400, 600));
    				WidgetChild logOut = Widgets.getWidgetChild(182, 8);
    				logOut.interact("Logout");
    				stop();
              }

    As you can tell, it's mostly the "getWhatever().something' that just changes to just 'Whatever.something'

    If you edit the code you might see that there is still an error, this is most likely because the new class has not been imported yet. so make sure to import the new classes. In Eclipse you can do this the following way:

    spacer.png

    I hope this helps. 

    Mozeratti

    Link to comment
    Share on other sites

    • 2 weeks later...
    2 hours ago, abouhanafy87 said:

    what about Inventory

    Error:(72, 24) java: cannot find symbol
      symbol:   variable Inventory
      location: class main.Main

    Make sure you've imported Inventory.

    Post the code that you are having issues with

    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.