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
  • National Draynor Willows


    Nation
     Share

    Recommended Posts

    National Draynor Willows

     

    I'm new to DreamBot so to learn the API I decided to write this script!

     

    Start with axe equipped or in Inventory

     

    Features:

    • Chops and banks Willow logs in Draynor
    • Reliable - (Ran for several hours without any issues)
    • Fast - Get upwards of 40k xp/hour with a good axe and Woodcutting level
    • AntiBan
    • Great way to train Woodcutting in F2P

     

    Progress Reports: (Feel free to post your own!)

     

    q1TXhKZ.png

     

    Download: Download Link

     

    Source code for anyone interested: Source code

    Link to comment
    Share on other sites

    Nice release!

     

    Can you explain me what anti-ban features you have added into this script?

     

    Thanks!

     

    Simple stuff. Mouse exiting screen, checking Woodcutting XP, checking friends list, right clicking on players, moving mouse, moving camera.

    Edited by Nation
    Link to comment
    Share on other sites

    Thanks!

     

    Simple stuff. Mouse exiting screen, checking Woodcutting XP, checking friends list, right clicking on players, moving mouse, moving camera.

    aight!

    Link to comment
    Share on other sites

    Great release! Thanks for posting source, I like to read how other scripters format their code :3


    Btw I found in your code you had this:

     GameObject willow = getGameObjects().closest("Willow");
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        if(willow != null) {
    

    Instead you can write it as

     GameObject willow = getGameObjects().closest(GO -> GO.getName.equals("Willow") && o!=null);
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        //Don't need this anymore//if(willow != null) {
    

    It's this new Lambda thing people seem to like. It seems weird at first, but it's kinda fun :)


    oh oh (yay I'm helpful?) I also saw this:

    getTabs().open(Tab.FRIENDS);
                        sleep(500, 1500);
                        getTabs().open(Tab.INVENTORY);
                        sleep(10, 300);
                        break;
    

    (in your Antiban) thing, it's really neat, but when you use getTabs().open(Tab.TAB), it uses hotkeys (sometimes), but sometimes the hotkeys are messed up because people change them. Instead I like to use getTabs().openwithmouse(Tab.TAB), because then the bot can't mess up :D


    Oo one final thing, I saw you made your own Random function, I just want to share mine (because I haven't yet ^.^)

    private Random Rand = new Random();
    
    void sleepie(int x, int y)
    {
       sleep(Rand.nextInt((x+y)/2)+Rand.nextInt((x+y)/2))
    }
    

    What this does is it makes the bot more likely to sleep at the number inbetween, less likely to sleep a little more but still probably and the same for a little less. I find it's a lot more like a human :D

    Link to comment
    Share on other sites

    Great release! Thanks for posting source, I like to read how other scripters format their code :3

    Btw I found in your code you had this:

     GameObject willow = getGameObjects().closest("Willow");
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        if(willow != null) {
    

    Instead you can write it as

     GameObject willow = getGameObjects().closest(GO -> GO.getName.equals("Willow") && o!=null);
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        //Don't need this anymore//if(willow != null) {
    

    It's this new Lambda thing people seem to like. It seems weird at first, but it's kinda fun :)

    oh oh (yay I'm helpful?) I also saw this:

    getTabs().open(Tab.FRIENDS);
                        sleep(500, 1500);
                        getTabs().open(Tab.INVENTORY);
                        sleep(10, 300);
                        break;
    

    (in your Antiban) thing, it's really neat, but when you use getTabs().open(Tab.TAB), it uses hotkeys (sometimes), but sometimes the hotkeys are messed up because people change them. Instead I like to use getTabs().openwithmouse(Tab.TAB), because then the bot can't mess up :D

    Oo one final thing, I saw you made your own Random function, I just want to share mine (because I haven't yet ^.^)

    private Random Rand = new Random();
    
    void sleepie(int x, int y)
    {
       sleep(Rand.nextInt((x+y)/2)+Rand.nextInt((x+y)/2))
    }
    

    What this does is it makes the bot more likely to sleep at the number inbetween, less likely to sleep a little more but still probably and the same for a little less. I find it's a lot more like a human :D

     

     

    Thanks for the tips!  :D

     

    I'm still getting used to the API but I really like it so far!

    Edited by Nation
    Link to comment
    Share on other sites

    Btw I found in your code you had this:

     GameObject willow = getGameObjects().closest("Willow");
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        if(willow != null) {
    

    Instead you can write it as

     GameObject willow = getGameObjects().closest(GO -> GO.getName.equals("Willow") && o!=null);
    
                    if(getLocalPlayer().getAnimation() != 867) {
                        //Don't need this anymore//if(willow != null) {
    

    It's this new Lambda thing people seem to like. It seems weird at first, but it's kinda fun :)

     

     

    This actually isn't true, in the odd case there isn't a willow tree, closest() will return null :)

    Link to comment
    Share on other sites

    This actually isn't true, in the odd case there isn't a willow tree, closest() will return null :)

     

    I was thinking that was the case. Thanks for clarifying!

    Link to comment
    Share on other sites

    This actually isn't true, in the odd case there isn't a willow tree, closest() will return null :)

    You just solved a problem I had like 2 months ago. Thanks!

     

    edit: Nevermind. That script is unsaveable.

    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.