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
  • King Lanthas Training Ground [FREE] [OPEN SOURCE] [TESTED]


    Before
     Share

    Recommended Posts

    Hey guys! @randombb2 suggested this script and I was half surprised we didn't have it, so here one is!

     

    Randombb2's thread can be found HERE

     

    Thanks for the account!!

     

    Download!

     

    Virus Scan!

     

    Source Code!

     

     

    package main;
    
    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.script.listener.PaintListener;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    import java.util.Random;
    
    @ScriptManifest(category = Category.COMBAT, name = "Kind Lanthas Training Ground", author = "B4", version = 0.0)
    public class Main extends AbstractScript
    {
        private Area trainingGrounds = new Area(2505,3579,2533,3360,0);
        private Area shootingGrounds = new Area(2533,3369,2521,3376,0);
        private Area howTheFuckDidUgetHere = new Area(2523,3377,2533,3373,0);
        private Random Rand = new Random();
    
        @Override
        public void onStart()
        {
            if (!trainingGrounds.contains(getLocalPlayer()))
            {
                log("You must start in the training grounds!");
                getKeyboard().type("!!!");//cus fuck a paint telling you otherwise
                stop();
            }
        }
    
        @Override
        public int onLoop()
        {
            if (!trainingGrounds.contains(getLocalPlayer()))
            {
                stop();//if you leave the training grounds, stop the script
            }
            else
            {
                if (howTheFuckDidUgetHere.contains(getLocalPlayer()))
                {
                    GameObject yourefuckingretarded = getGameObjects().closest("Loose Railing");
                    yourefuckingretarded.interact("Squeeze-through");
                    sleep(500);
                    sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
                }
                while (!shootingGrounds.contains(getLocalPlayer()) && !shootingGrounds.contains(getWalking().getDestination()))
                {
                    getWalking().walk(shootingGrounds.getRandomTile());
                    sleep(600+Rand.nextInt(2000));
                }
            }
    
            //The script should only get here if we're in position.
    
            if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
            {
                sleep(50+Rand.nextInt(30));//make sure he wasn't mid animation with some retardedly slow weapon (???)
                if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
                {
                    attack();
                }
            }
    
            int averageCenter = Rand.nextInt(800) + Rand.nextInt(800);
            if (averageCenter > 800)
            {
                averageCenter -= 800; //this will make it more likely to pick a sleep time around 800, but can pick anywhere between 0 and 1600
                // (VERY unlikely. Think of it as 2 dice.. sort of. It's like supermath antiban?)
            }
    
            return 50 + averageCenter;//a more "AFK" designed script.
        }
    
        public void attack()
        {
            NPC uglyshit;
            uglyshit = getNpcs().closest("Ogre");
            if (uglyshit != null)
            {
                uglyshit.interact("Attack");
                sleep(300 + Rand.nextInt(100));
            }
        }
    }
    
    

     

     

     

    Enjoyy!!

     

    edit: Let's put that source code in a spoiler..

    edit2: Have all my download links been broken!? Fixed.

    Edited by Before
    Link to comment
    Share on other sites

    Hi there!

    Nice release, few things you might want feedback on :).

    @ScriptManifest(category = Category.COMBAT, name = "Kind Lanthas Training Ground", author = "B4", version = 0.0)
    //name = "Kind King Lanthas Training Ground"
    
     if (!trainingGrounds.contains(getLocalPlayer()))
            {
                log("You must start in the training grounds!");
                getKeyboard().type("!!!");//cus fuck a paint telling you otherwise
                stop();
            }
    //nice to let people know if something wrong, but why not post-fix this issue with auto-walking to the location ? Plus people might not open the log console, so they come back
    //telling you the script is broken while it isn't lol (because it automatically stops the script after the log)
    
    if (howTheFuckDidUgetHere.contains(getLocalPlayer()))
                {
                    GameObject yourefuckingretarded = getGameObjects().closest("Loose Railing");
                    yourefuckingretarded.interact("Squeeze-through");
                    sleep(500);
                    sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
                }
    // should do an if statement around "yourefuckingretarded.interact("Squeeze-through");" because sometimes it executes the click but it missclicks, if there is an "if statement" around it, it check if the click returns true
    
    
    // sleep(500);
    // sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
    
    // the above two lines are not needed. You first sleep for 0,5 seconds and then sleepUntil. Just the sleepUntil is enough!
    while (!shootingGrounds.contains(getLocalPlayer()) && !shootingGrounds.contains(getWalking().getDestination()))
                {
                    getWalking().walk(shootingGrounds.getRandomTile());
                    sleep(600+Rand.nextInt(2000));
                }
    // could you explain me what this code is for ? and what does it do? What was the intention of writing this while loop?
    
     if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
            {
                sleep(50+Rand.nextInt(30));//make sure he wasn't mid animation with some retardedly slow weapon (???) //you can use getLocalPlayer().isAnimating() for this.
                if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
                {
                    attack(); // can do an if statement, either in this code or in your method constructor to make sure the attack method returns true (as it will if the method executed correctly)
                }
            }
    
    int averageCenter = Rand.nextInt(800) + Rand.nextInt(800);
            if (averageCenter > 800) // averageCenter will always be greater than 800 ???
            {
                averageCenter -= 800; //this will make it more likely to pick a sleep time around 800, but can pick anywhere between 0 and 1600
                // (VERY unlikely. Think of it as 2 dice.. sort of. It's like supermath antiban?)
            }
    
            return 50 + averageCenter;//a more "AFK" designed script.
        }
    // for this whole method you wrote i'd suggest you use Calculations.random(int,int); This will do the exact same thing in one line of code.
    
    public void attack()
        {
            NPC uglyshit;
            uglyshit = getNpcs().closest("Ogre");
            if (uglyshit != null)
            {
                uglyshit.interact("Attack");
                sleep(300 + Rand.nextInt(100)); // can use Calculations.random(int,int); also, but thats personal preference  this line of code is just fine!
            }
        }
    // you can inherit NPC uglyshit; and uglyshit = getNpcs().closest("Ogre"); in one line: NPC uglyshit = getNpcs().closest("Ogre");
    

    I'm not here to burn down your code! I just want to help :). I took quite some time to check the whole code lol, but no problem!

     

    any questions are welcome if you have them!

    Link to comment
    Share on other sites

    How the fuck did you get here :lol:

    wut do u mean :(

    Hi there!

    Nice release, few things you might want feedback on :).

     

    any questions are welcome if you have them!

    Okayy, that's a big post with some good fucking feedback so I wanna ask a few questions about some of it

    if (howTheFuckDidUgetHere.contains(getLocalPlayer()))
                {
                    GameObject yourefuckingretarded = getGameObjects().closest("Loose Railing");
                    yourefuckingretarded.interact("Squeeze-through");
                    sleep(500);
                    sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
                }
    // should do an if statement around "yourefuckingretarded.interact("Squeeze-through");" because sometimes it executes the click but it missclicks, if there is an "if statement" around it, it check if the click returns true
    
    
    // sleep(500);
    // sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
    
    // the above two lines are not needed. You first sleep for 0,5 seconds and then sleepUntil. Just the sleepUntil is enough!
    

    I find if I just have the sleepUntil, it takes a moment (the lag) for my character to start running, so it always skips the sleepUntil as a result (I'm standing still a millisecond after I click), so the sleep seems to help -- unless this was something else I was issuing with(?)

    while (!shootingGrounds.contains(getLocalPlayer()) && !shootingGrounds.contains(getWalking().getDestination()))
                {
                    getWalking().walk(shootingGrounds.getRandomTile());
                    sleep(600+Rand.nextInt(2000));
                }
    // could you explain me what this code is for ? and what does it do? What was the intention of writing this while loop?
    

    Uhm, while you're not in the place to shoot, walk to it

     

    Then once you click on it, go AFK until you sit there (so it doesn't click the same spot 8 time as it runs around a fence or something)

     if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
            {
                sleep(50+Rand.nextInt(30));//make sure he wasn't mid animation with some retardedly slow weapon (???) //you can use getLocalPlayer().isAnimating() for this.
                if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
                {
                    attack(); // can do an if statement, either in this code or in your method constructor to make sure the attack method returns true (as it will if the method executed correctly)
                }
            }
    

    OKAY, THIS I have had issues with before. I saw a guide where they were doing that but I never understood why, and I've had issues in my scripts with the clicks failing. What will an if-statement do about that?

     

     

     

    // for this whole method you wrote i'd suggest you use Calculations.random(int,int); This will do the exact same thing in one line of code. 

    Oh yeah, I fucked that method up completely. Ignore it, I was trying to do something that Calculations.random(int,int) doesn't do (I was trying to make the sleep be most likely 800, less likely 799 and 801, less likely 798 and 802 etc etc and almost never 0 and 1600.

    Link to comment
    Share on other sites

    wut do u mean :(

    Okayy, that's a big post with some good fucking feedback so I wanna ask a few questions about some of it

    if (howTheFuckDidUgetHere.contains(getLocalPlayer()))
                {
                    GameObject yourefuckingretarded = getGameObjects().closest("Loose Railing");
                    yourefuckingretarded.interact("Squeeze-through");
                    sleep(500);
                    sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
                }
    // should do an if statement around "yourefuckingretarded.interact("Squeeze-through");" because sometimes it executes the click but it missclicks, if there is an "if statement" around it, it check if the click returns true
    
    
    // sleep(500);
    // sleepUntil(() -> getLocalPlayer().isStandingStill(), 3000 + Rand.nextInt(2000));
    
    // the above two lines are not needed. You first sleep for 0,5 seconds and then sleepUntil. Just the sleepUntil is enough!
    

    I find if I just have the sleepUntil, it takes a moment (the lag) for my character to start running, so it always skips the sleepUntil as a result (I'm standing still a millisecond after I click), so the sleep seems to help -- unless this was something else I was issuing with(?)

     

    You sleepUntil the character is standing still from the moment you click the "squeeze-through" option. So sleeping 0.5 seconds after you've clicked the "squeeze-through" option doesn't really make sense. If the sleepUntil doesn't execute at all like you say so, you probably want to look for another condition to meet. (or just keep it like this if it works properly). Keep in mind that 500 ms == 0.5 seconds, which is literally NOTHING compared to the actions and the speed of your onLoop().

    while (!shootingGrounds.contains(getLocalPlayer()) && !shootingGrounds.contains(getWalking().getDestination()))
                {
                    getWalking().walk(shootingGrounds.getRandomTile());
                    sleep(600+Rand.nextInt(2000));
                }
    // could you explain me what this code is for ? and what does it do? What was the intention of writing this while loop?
    

    Uhm, while you're not in the place to shoot, walk to it

     

    Then once you click on it, go AFK until you sit there (so it doesn't click the same spot 8 time as it runs around a fence or something)

     

    Should avoid While loops in my opinion where possible. Personally i think if you use an if-statement, you get the same but better result, as it won't execute/read through if you're in the area. (because if you are in the area, the if-statement returns false and ignores the rest of the body). Just use the While-loop for literally what it stands for: while you are doing something, execute the body code E.G. While(getLocalPlayer().isAnimating()){ sleep(300); }

     if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
            {
                sleep(50+Rand.nextInt(30));//make sure he wasn't mid animation with some retardedly slow weapon (???) //you can use getLocalPlayer().isAnimating() for this.
                if (getLocalPlayer().isStandingStill() && !getLocalPlayer().isAnimating() && getLocalPlayer().canAttack())
                {
                    attack(); // can do an if statement, either in this code or in your method constructor to make sure the attack method returns true (as it will if the method executed correctly)
                }
            }
    

    OKAY, THIS I have had issues with before. I saw a guide where they were doing that but I never understood why, and I've had issues in my scripts with the clicks failing. What will an if-statement do about that?

    An if-statement around your attack(); method will constantly ask for "approval" (true/false). The method attack() RETURNS true if it did click on the NPC to attack and not missclick. Without an if-statement, it will just execute attack() once, whether it has clicked on the NPC or not (like you said it can missclick because NPC's move and stuff). Even if it missclicks without an if-statement check, it returns true and executes the code below thinking it clicked the NPC. As the answer to your question "What will an if-statement do about the missclicks?", the answer is nothing, but it will try to click on the NPC right after it missclicks the NPC (as a result of a false return). This will make your attack() method more smooth and human like.

     

     

    Oh yeah, I fucked that method up completely. Ignore it, I was trying to do something that Calculations.random(int,int) doesn't do (I was trying to make the sleep be most likely 800, less likely 799 and 801, less likely 798 and 802 etc etc and almost never 0 and 1600.

    Why would you? You said because of anti-ban, but no human being on this planet is able to click with EXACTLY a 800ms interval in a row. This said: it's more likely a pro-ban feature lol.

     

    check the bold text in the quote.

    Edited by Cardozz
    Link to comment
    Share on other sites

    check the bold text in the quote.

    Thats true... yet a human IS likely to have similar response time every time. He I'd attempting to create a random centered around 800 in order to simulate what a human would actually do. Whether it actually works? I'm not sure.

    Link to comment
    Share on other sites

    Thats true... yet a human IS likely to have similar response time every time. He I'd attempting to create a random centered around 800 in order to simulate what a human would actually do. Whether it actually works? I'm not sure.

    Then why not use Calculations.random(int,int)? I mean.. It will grab a random number between these 2 given parameters. make them 777 and 942 or whatever and you will have the same, yet a way better result

    Link to comment
    Share on other sites

    Then why not use Calculations.random(int,int)? I mean.. It will grab a random number between these 2 given parameters. make them 777 and 942 or whatever and you will have the same, yet a way better result

    Because he doesn't want a random number between those values. What he wants is something much more complicated. He wants say 33% between 750-850 25% 650-950 10% 550-1050....

    Not quite those percentages but you get what I mean I think.

    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.