Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold

will6100

Registered
  • Content Count

    17
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by will6100


    1. Download it as zip with the green button in github.
    2. Extract the whole dax_api package inside the section "scripts" of your IDE.
    3. Import all dependencies to your project just like you did with the "tribot.jar", they're all in the ".tribot" folder in "dependencies" 
    4. Now you should be able to follow the readme file of dax walker for the following instructions

  1. 3 hours ago, IceKontroI said:

    Look into more realistic sleep times. Currently you always sleep for 50 milliseconds between actions, which is a major red flag. Don't add pure randomness to it either, look into using General.randomSD(average, deviation) because it's a random normal distribution and mimics the natural bell curve of human distributions. You should be using small delays between actions of your script too, so between any two method calls that physically interact with the game world (moving the mouse, clicking, typing on the keyboard, rotating the camera) there needs to be some delay. I personally recorded myself performing some tasks in-game then looked at my own delays and modeled some generator functions around that but you could probably get away with just guessing. I hope this was useful, and happy scripting!

    @will6100

    Cheers, will look more into that in the future.

    Thanks for the feedback!


  2. I really love the process of developing a script, testing it, debugging it, etc.. So after writing my first really simple script that would tan hides, I got my first botting account banned, which is something I knew was gonna happen since my lack of scripting knowledge. Im ready to get a new one up and going and continue to develop more basic scripts to sharpen my scripting skills. Im sharing my first script here and looking to hear what I should do and should not do. Also get some tips on what to look for to reduce the banning rates of my testing accounts. The account I was using was only combat lvl 5 and didnt have any quests done, I guess that didnt help too? I was also about to introduce ABC2 into the script and learn how to use it but my account got banned right before I could implement it. So looking forward to hear your criticisms about my script and tips to not get the script bannable. Also have in mind I didnt really refactor anything, some parts may look ugly, beware!

    package scripts;
    
    
    import org.tribot.api.DynamicClicking;
    import org.tribot.api.General;
    import org.tribot.api.Timing;
    import org.tribot.api.input.Mouse;
    import org.tribot.api2007.*;
    import org.tribot.api2007.types.RSNPC;
    import org.tribot.api2007.types.RSObject;
    import org.tribot.api2007.types.RSTile;
    import org.tribot.api2007.util.ThreadSettings;
    import org.tribot.script.Script;
    import org.tribot.script.ScriptManifest;
    
    import java.awt.*;
    import java.util.function.BooleanSupplier;
    
    
    @ScriptManifest(category = "Moneymaking", authors = "will6100" , name = "Tanner")
    public class Tanner extends Script {
    
    
        private final static int BLACK_DHIDE_ID = 1747;
        private final static int TANNED_LEATHER_ID = 2509;
        private final static int ELLIS_ID = 3231;
        private final static int BANK_BOOTH_ID = 10355;
        private final static int COINS_ID = 995;
    
    
        private boolean isBankable() {
            RSObject[] booths = Objects.findNearest(100, BANK_BOOTH_ID);
            if (booths.length > 1) {
                return booths[0].isOnScreen();
            }
            return false;
        }
    
    
        private boolean coinsCheck() {
            if (Inventory.find(COINS_ID).length < 1) {
                if (Banking.find(COINS_ID).length > 0) {
                    if (!Inventory.isFull()) {
                        return Banking.withdraw(0, COINS_ID);
                    } else {
                        if (Inventory.find(BLACK_DHIDE_ID).length > 0) {
                            return Banking.deposit(1, BLACK_DHIDE_ID);
                        } else if (Inventory.find(TANNED_LEATHER_ID).length > 0){
                            return Banking.depositAll() > 0;
                        }
                    }
                }
            } else {
                return true;
            }
            return false;
        }
    
    
        private boolean bank() {
            if (!openBank()) {
                General.println("Couldnt open bank");
                return false;
            }
            if (!coinsCheck()) {
                General.println("No more gold");
                return false;
            }
            if (!setupInventory()) {
                General.println("No more hides");
                return false;
            }
            sleep(100,1000);
            return true;
        }
    
    
        private boolean setupInventory() {
            if (Inventory.find(TANNED_LEATHER_ID).length > 0) {
                sleep(50,1000);
                if (Banking.deposit(0,TANNED_LEATHER_ID)) {
                    if (Banking.find(BLACK_DHIDE_ID).length > 0){
                        sleep(50,1000);
                        Banking.withdraw(0, BLACK_DHIDE_ID);
                        return Timing.waitCondition(this::readyToTan, General.random(3000,5000));
                    }
                }
            } else if (Inventory.find(TANNED_LEATHER_ID).length < 1) {
                sleep(50,1000);
                if (Banking.find(BLACK_DHIDE_ID).length > 0){
                    Banking.withdraw(0, BLACK_DHIDE_ID);
                    return Timing.waitCondition(this::readyToTan, General.random(3000,5000));
                }
            }
            return false;
        }
    
    
        private boolean openBank() {
            if (!Banking.isBankScreenOpen()) {
                if (!isBankable()){
                    if(!walkToDestCondition(this::isBankable)) {
                        return false;
                    }
                }
                return clickBankBooth();
            }
            return true;
        }
    
    
        private boolean clickBankBooth() {
            RSObject[] bankBooths = Objects.findNearest(40, BANK_BOOTH_ID);
            RSObject booth;
            if(bankBooths.length > 1) {
                do {
                    sleep(50);
                    booth = bankBooths[General.random(0, bankBooths.length - 2)];
                } while (!booth.isOnScreen() && !booth.isClickable());
                booth.hover();
                if (isHoverRendered(Mouse.getPos())){
                    Mouse.click(1);
                }else {
                    clickBankBooth();
                }
                return Timing.waitCondition(Banking::isBankScreenOpen, General.random(25000,27000));
            }
            return false;
        }
    
        
        private boolean isHoverRendered (Point toHover) {
            return !Screen.getColorAt(Mouse.getPos()).equals(new Color(0, 0, 0));
        }
        
        
    
        private boolean isTannable() {
            RSNPC[] ellis = NPCs.find(ELLIS_ID);
            if (ellis.length < 1) {
                return false;
            } else if (isTanningWindowOpen()){
                return true;
            }
            return ellis[0].isOnScreen();
        }
    
    
        private boolean tanLeather() {
            RSNPC ellis;
            if (isTannable()) {
                sleep(100,200);
                ellis = NPCs.find(ELLIS_ID)[0];
                while (!isTanningWindowOpen()) {
                    Mouse.setSpeed(190);
                    sleep(300,500);
                    if (DynamicClicking.clickRSNPC(ellis,"Trade " + ellis.getName())){
                        Mouse.setSpeed(115);
                        Timing.waitCondition(this::isTanningWindowOpen, General.random(15000, 17000));
                        sleep(200,500);
                        Interfaces.get(324,107).click("Tan all");
                        return Timing.waitCondition(() -> !isTanningWindowOpen(), General.random(3000,5000));
                    }
                }
            } else {
                return walkToDestCondition(this::isTannable);
            }
            return false;
        }
    
    
        private boolean walkToDestCondition(BooleanSupplier waitCondition) {
            Walking.blindWalkTo(new RSTile(3278 + General.random(-2,2), 3180 + General.random(-1, 1)));
            return Timing.waitCondition(waitCondition, General.random(11000,12000));
        }
    
    
        private boolean isTanningWindowOpen() {
            return Interfaces.isInterfaceValid(324);
        }
    
    
        private boolean readyToTan() {
            return Inventory.find(BLACK_DHIDE_ID).length > 0 && Inventory.find(COINS_ID).length > 0 ;
        }
    
    
        @Override
        public void run() {
            Mouse.setSpeed(115);
            ThreadSettings ts = new ThreadSettings();
            ts.setClickingAPIUseDynamic(true);
            while (true) {
                sleep(50);
                if (isTannable()) {
                    if (readyToTan()) {
                        if(!tanLeather()){
                            General.println("1");
                            break;
                        }
                    } else {
                        if(!bank()) {
                            General.println("2");
                            break;
                        }
                    }
                } else if (isBankable()) {
                    if (readyToTan()) {
                        if(!tanLeather()){
                            General.println("3");
                            break;
                        }
                    } else {
                        if(!bank()) {
                            General.println("4");
                            break;
                        }
                    }
                } else if (readyToTan()) {
                    if(!tanLeather()){
                        General.println("5");
                        break;
                    }
                } else {
                    if(!bank()) {
                        General.println("6");
                        break;
                    }
                }
            }
        }
    
    
    }

     


  3. 1 hour ago, Worthy said:

    Not really. What I do is move a bit closer if clicking fails and isOnScreen & isClickable return true.

    Alright, ive worked around with this for the moment

    private boolean isObjectRendered (RSObject toHover) {
            if (toHover.isOnScreen()) {
                toHover.hover();
                return !Screen.getColourAt(Mouse.getPos()).equals(new Color(0, 0, 0));
            }
            return false;
        }

    Only thing is it need to hover it to actually know, I might come up with something better in the future


  4. So basically sometime there's an issue with my script when there's a player on top of the desired npc, it will trade the player instead of the npc. Any tips how I could handle this? Here my method so far:

        private boolean tanLeather() {
            RSNPC ellis;
            if (isTannable()) {
                ellis = NPCs.find(ELLIS_ID)[0];
                while (!isTanningWindowOpen()) {
                    Mouse.setSpeed(225);
                    sleep(300,1500);
                    ellis.hover();
                    if (ellis.click("Trade")){
                        Mouse.setSpeed(150);
                        Timing.waitCondition(this::isTanningWindowOpen, General.random(15000, 17000));
                        sleep(50,1500);
                        Interfaces.get(324,107).click("Tan all");
                        return Timing.waitCondition(() -> !isTanningWindowOpen(), General.random(3000,5000));
                    }
                }
            } else {
                return walkToDestCondition(this::isTannable);
            }
            return false;
        }

     


  5. 8 hours ago, ManyGoldPieces said:

    Tribot only works with Java 8. Make sure you use the 32 bit JDK for best compatibility imo. u102 is a time-tested version for most bot clients, including Tribot. The latest Java 8 should also work just fine.

    Yep, this works just fine with 64 bit right now, thank you!

×
×
  • Create New...