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
  • [Video Tutorial Series] | Dreambot Scripting | Request scripting tutorials here.


    Computor

    Recommended Posts

    I would love to see a simple script where you'll explain the handling of JavaFX gui and make it a base of an AIO-script using the State-framework (because Node framework AIO tutorial is already here)! <3

    JavaFX isn't supported by Dreambot anymore. State framework is pretty basic, I'll definitely get one up :D

    Link to comment
    Share on other sites

    Hey guys,

    I've decided to make a little video tutorial series for dreambot scripting. If you enjoy these tutorials, please let me know, otherwise I won't continue making more videos. If you want me to make a video on something specific, request them here.

     

    All videos are in 1080p, be sure to watch them in HD.

     

    Series 1 - Basic Dreambot Scripting. Creating your first script (woodcutter):

    Part 1/3:

    Part 2/3:

    Part 3/3:

     

    Final code from series:

     

     

    package BasicWoodcutter;
    
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.filter.Filter;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    import java.awt.*;
    
    /**
     * Created by Computor on 7/8/2015.
     */
    @ScriptManifest(category = Category.WOODCUTTING, name = "Basic WoodCutter", author = "Computor", version = 1.0)
    public class MainClass extends AbstractScript{
    
        Area bankArea = new Area(3092, 3240, 3097, 3246, 0);
        Area treeArea = new Area(3091, 3290, 3072, 3310, 0);
    
        @Override
        public void onStart(){
            log("Hi");
        }
    
        @Override
        public int onLoop() {
            /**
             * Chopping trees: Time to chop some trees, our inventory isn't full. We want to fill it up.
             */
            if(!getInventory().isFull()){
                if(treeArea.contains(getLocalPlayer())){
                    chopTree("Tree"); //change "Tree" to the name of your tree.
                }else{
                    if(getWalking().walk(treeArea.getRandomTile())){
                        sleep(Calculations.random(3000, 5500));
                    }
                }
            }
    
            /**
             * Banking: Time to bank our logs. Our inventory is full, we want to empty it.
             */
            if(getInventory().isFull()){ //it is time to bank
                if(bankArea.contains(getLocalPlayer())){
                    bank();
                }else{
                    if(getWalking().walk(bankArea.getRandomTile())){
                        sleep(Calculations.random(3000, 6000));
                    }
                }
            }
    
            return 600;
        }
    
        @Override
        public void onExit() {
            log("Bye");
        }
    
        @Override
        public void onPaint(Graphics graphics) {
    
        }
    
        private void chopTree(String nameOfTree){
            GameObject tree = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals(nameOfTree));
            if(tree != null && tree.interact("Chop down")){
                int countLog = getInventory().count("Logs");
                sleepUntil(() -> getInventory().count("Logs") > countLog, 12000);
            }
        }
    
        private void bank(){
            NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank"));
            if(banker != null && banker.interact("Bank")){
                if(sleepUntil(() -> getBank().isOpen(), 9000)){
                    if(getBank().depositAllExcept(item -> item != null && item.getName().contains("axe"))){
                        if(sleepUntil(() -> !getInventory().isFull(), 8000)){
                            if(getBank().close()){
                                sleepUntil(() -> !getBank().isOpen(), 8000);
                            }
                        }
                    }
                }
            }
        }
    }
    
    

     

     

     

     

    Series 2 - Request One!

    I'd like to suggest one thing, Include the download link to the IDE download

    Link to comment
    Share on other sites

    can u show me how to make an aio combat with customized per-user sleeping and a fancy gui?

    No.

     

    I'd like to suggest one thing, Include the download link to the IDE download

    I got you, updated :D

    Link to comment
    Share on other sites

    Did you get my request M9-1 :(? <3

    Yep yep! Working on GUI tutorial right now, but I'm going on vacation for ~5 days tomorrow. Probably won't be out till I'm back.

    Link to comment
    Share on other sites

    Nooooooooooooooooooooo that means i need to wait 2 weeks as im going on holiday next week lol, anyway thanks!

    Hahaha sorry :( add me on skype if you have some quick questions that I could help you with tonight: jeff.dreambot

    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
    ×
    ×
    • 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.