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
  • Any Chance someone can post a basic script I can look at?


    snailmail12
     Share

    Recommended Posts

    Hi I have just returned to OSRS and the scripts I made before are now all depreciated. I have been looking through the API and I dont really get it. I get that tutorials take time to write or make so I was wondering in the mean time if anyone can just put down some code I can look at and get a feel for how it all works. Ideally something that includes walking banking and widgets would be great but Ill appreciate whatever you can offer.

    Link to comment
    Share on other sites

    The new api removed all static references.  For example getBank().doTheThing(); would now be Bank.doTheThing();

    If you have old scripts source code from examples I wrote a simple updater that roughly updates DreamBot 2 scripts -> DreamBot 3.  Might still be some bugs in it but if you edit the updater.sh script you can see a good chunk of the conversions needed.

     

     

    Another good resource would be the guides page which isn't fully up to date or complete yet on script conversion (I'll get around to it eventually) 

    https://dreambot.org/guides/scripter-guide/script-dev/upgrading-to-db3/

     

    Any questions feel free to hit me up on here or Discord.

    Link to comment
    Share on other sites

    20 hours ago, yeeter01 said:

    The new api removed all static references.  For example getBank().doTheThing(); would now be Bank.doTheThing();

    If you have old scripts source code from examples I wrote a simple updater that roughly updates DreamBot 2 scripts -> DreamBot 3.  Might still be some bugs in it but if you edit the updater.sh script you can see a good chunk of the conversions needed.

     

     

    Another good resource would be the guides page which isn't fully up to date or complete yet on script conversion (I'll get around to it eventually) 

    https://dreambot.org/guides/scripter-guide/script-dev/upgrading-to-db3/

     

    Any questions feel free to hit me up on here or Discord.

    Any Chance youj can help me with this. I have logs to see where I am in the code for now. It gets there in the end but it doesnt seem very efficient or good at using the widget any way I can improve this? I will add better sleeps etc after Im just trying to do basic code atm

     

     

                WidgetChild makeAllWidg = Widgets.getWidgetChild(446,34);
                if (makeAllWidg != null && makeAllWidg.isVisible()) {
    //                sleep(Calculations.random(100, 10000));
                    log("2.2");
                    makeAllWidg.interact();
                    log("2.3");
                    sleep(Calculations.random(50000, 80000));

    What it does is I think implements some antiban? cos the screen moves around a little but also the mouse moves around weirdly on the smelt screen. Instead of just going straight to the amulet in this case and clicking on it

    Edited by snailmail12
    Link to comment
    Share on other sites

    Everything is almost the same, but now you don't need to type a million letters like: MethodProvider.getLocalPlayer(); You can just do getLocalPlayer()...

     

    Or, previously you'd need to do this: Widgets.getWidgets().getWidgetChild(). Now you can just type Widgets.getWidgetChild(). I dunno if the code is correct, but basically the API has been shortened, that's all there's to it.

    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.