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
  • Silk Stall Stealer


    Eddie1205

    Recommended Posts

    Heyy this is the first script I wrote. Hope you enjoy, and I'd appreciate any advice/constructive criticism anyone has :)

     

    Features:

    Steals silk from audy

    Stops to fight guards(if one attacks you)

    eats food(herring, because that's what I have)

    Drops all the silks when your inventory is full

    Some level of "antiban" (random "clock" values)

     

     

    package Main;
    
    import org.dreambot.api.methods.Calculations;
    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.items.Item;
    
    @ScriptManifest(name = "silk stealer", description = "steals silk", category = Category.THIEVING, author = "Rose", version = 1.0)
    public class Main extends AbstractScript {
    
        private int state = -1;
    
        public void onStart(){
            super.onStart();
            state = 0;
        }
    
        public int onLoop() {
    
            if(state == 0){
                Stealing();
            }
    
            if(state == 1){
                Dropping();
            }
    
            if(getCombat().getHealthPercent() < Calculations.random(40, 60) && getInventory().contains("Herring")){
                Eat();
            }else{
                state = 0;
            }
    
            return Calculations.random(800, 1200);
        }
    
        private void Stealing(){
    
            GameObject stall = getGameObjects().closest("Silk stall");
    
            if(!getInventory().isFull()){
                if(!getLocalPlayer().isHealthBarVisible() && stall.distance() <= 3) {
                        stall.interact("Steal-from");
                }
            }else if(getLocalPlayer().isHealthBarVisible()){
                sleepUntil(()-> !getLocalPlayer().isAnimating(), Calculations.random(10000, 20000));
            }else{
                state = 1;
            }
        }
    
        private void Dropping(){
            if(getInventory().isFull()){
                getInventory().dropAll("Silk");
            }else{
                state = 0;
            }
        }
    
        private void Eat(){
    
            Item food = getInventory().get(item -> item != null);
    
                if(food != null) {
                    food.interact("Eat");
                    sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(2000, 4000));
                }
        }
    
    
    }
    
    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.