[request] Magic Log Cutter + Banker [RSBOT]

Discussion in 'Archives' started by terrorizm, Nov 22, 2008.

Thread Status:
Not open for further replies.
[request] Magic Log Cutter + Banker [RSBOT]
  1. Unread #1 - Nov 22, 2008 at 6:03 PM
  2. terrorizm
    Joined:
    Oct 25, 2008
    Posts:
    27
    Referrals:
    0
    Sythe Gold:
    0

    terrorizm Member
    Banned

    [request] Magic Log Cutter + Banker [RSBOT]

    any out there?
     
  3. Unread #2 - Nov 22, 2008 at 7:23 PM
  4. Tylobedo
    Joined:
    Jun 23, 2008
    Posts:
    123
    Referrals:
    2
    Sythe Gold:
    0

    Tylobedo Active Member
    Banned

    [request] Magic Log Cutter + Banker [RSBOT]

    i may make one. Where would you want it to be at?

    EDIT: i didn't make this i found it. I haven't tested it i just looked throught it and it does bank deal with randoms. starts in the seers bank and walks to to mage trees. then it does bank. If it gets lost it uses home tele and walks back. If it doesn't work tell me and i may just try and fix it

    Code:
    import java.awt.*;
    import java.awt.event.KeyEvent;
    import java.util.*;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.accessors.NPC;
    
    public class EvilsMagicTreeChopper extends Script implements PaintListener {
        public double getVersion() {
            return(0.01);
        }
    
        public String getName() {
            return("EvilsMagicTreeChopper");
        }
    
        public String getAuthor() {
            return("[email protected]");
        }
    
        public String getScriptCategory() {
            return("Woodcutting");
        }
    
        public String getScriptDescription( ) {
            String html = "";
    
            html += "<html>\n";
            html += "<body>\n";
            html += "<h2>" + getName() + " v" + getVersion() + "</h2><br>\n";
            html += "Author: " + getAuthor() + "<br><br>\n";
            html += "Start in Seers Village bank with a axe (can be equipped or not)May take a while to load as it will need to make sure it is not in a random event before teleporting home and walking back.";
            //html += "<center>\n";
            //html += "Arguments:<input type=\"text\" name=\"args\">\n";
            //html += "</center>\n";
            html += "</body>\n";
            html += "</html\n";
    
            return(html);
        }
    
        public boolean onStart(String[] args) {
            Bot.getEventManager( ).addListener(PaintListener.class, this);
    
            return(true);
        }
    
        public void onFinish() {
            Bot.getEventManager().removeListener(PaintListener.class, this);
        }
    
        int waitAfterMoving = -1;
    
        int failCount = 0;
    
        public int loop() {
    
            if(!isLoggedIn()) {
                return random(100,200);
            }
            if(checkSpinningView()) {
                return random(200, 300);
            }
            if(checkCamera()) {
                return random(500, 800);
            }
            if(getMyPlayer().isMoving()) {
                return random(150, 200);
            }
            if(waitAfterMoving != -1) {
                int toReturn = waitAfterMoving;
                waitAfterMoving = -1;
                return toReturn;
            }
            if(checkAttack()) {
                return random(800, 1000);
            }
            if(checkEnt()) {
                return random(800, 1000);
            }
            if(getMyPlayer().getAnimation() != -1) {
                return random(150, 200);
            }
            int result = work();
            if(result != -1) {
                failCount = 0;
                return result;
            }
            if(walkBack()) {
                failCount = 0;
                return random(500, 800);
            }
            failCount ++;
            if(failCount >= 10) {
                failCount = 0;
                homeTele();
                return random(2000, 3000);
            }
            return random(1000, 2000);
        }
    
        public boolean checkEnt() {
            if(getMyPlayer().getInteracting() != null) {
                int count = Bot.getClient().getNPCCount();
                NPC[] npcs = Bot.getClient().getNPCArray();
                int[] ints = Bot.getClient().getNPCIndexArray();
                for (int I = 0; I < count; I++)
                {
                    RSNPC npc = new RSNPC(npcs[ints[I]]);
                    if(getMyPlayer().getInteracting().equals(npc) && Arrays.asList(treeNames).contains(npc.getName())) {
                        if(clickTree() > 0) {
                            walkTileMM(tree1Tile);
                        }
                        return true;
                    }
                }
            }
            return false;
        }
    
        boolean cameraMoving = false;
    
        public boolean checkCamera() {
            if(cameraMoving) {
                if(Bot.getClient().getCameraCurveY() >= 380) {
                    Bot.getInputManager().releaseKey((char) KeyEvent.VK_UP);
                    cameraMoving = false;
                }
                return true;
            } else if (Bot.getClient().getCameraCurveY() < 380) {
                Bot.getInputManager().pressKey((char) KeyEvent.VK_UP);
                cameraMoving = true;
                return true;
            }
            return false;
        }
    
        public boolean checkAttack() {
            if(getMyPlayer().isInCombat()) {
                return runFromCombat();
            } else {
                return false;
            }
        }
    
        public boolean runFromCombat() {
            if(atBank()) {
                bankToTrees();
                return true;
            }
            if(atTrees()) {
                treesToBank();
                return true;
            }
            return false;
        }
        int loads = 0;
    
        public void onRepaint(Graphics g) {
            g.setColor(Color.YELLOW);
            g.drawString("EvilsMagicTreeChopper", 260, 20);
            g.drawString("Loads: " + loads, 260, 38);
        }
    
        public int work() {
            if(getInventoryCount() != 28) {
                return chop();
            } else {
                return bank();
            }
        }
    
        public int chop() {
            if(atTrees()) {
                int result = clickTree();
                if(result > 0) {
                    if(result == 1) {
                        waitAfterMoving = random(500, 800);
                    }
                    return random(500, 800);
                } else {
                    if(result == -1) {
                        spinView();
                    } else {
                        if(distanceTo(centerTile) > 2) {
                            RSTile rCenterTile = new RSTile(centerTile.getX() + random(-1, 1), centerTile.getY() + random(-1, 1));
                            emWalkTile(rCenterTile);
                        }
                    }
                    return random(500, 800);
                }
            } else {
                if(bankToTrees()) {
                    return random(500, 800);
                } else {
                    return -1;
                }
            }
        }
    
        public int bank() {
            if(atBank()) {
                if(RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                    bank.depositAllExcept(1349, 1351, 1353, 1355, 1357, 1359, 6739);
                    loads ++;
                    return random(500, 800);
                } else {
                    runOn();
                    if(distanceTo(bankTile) > 0) {
                        if(emWalkTile(bankTile)) {
                            waitAfterMoving = random(200, 300);
                            return random(500, 800);
                        } else {
                            return -1;
                        }
                    } else {
                        if(useBanker()) {
                            return random(500, 800);
                        } else {
                            return -1;
                        }
                    }
                }
            } else {
                if(treesToBank()) {
                    return random(500, 800);
                } else {
                    return -1;
                }
            }
        }
    
        public boolean useBanker() {
            RSNPC npc = getNearestNPCByID(bankerID);
            return atNPC(npc, "Bank Banker");
        }
    
        public boolean atBank() {
            return distanceTo(bankTile) < 15;
        }
    
        public boolean bankToTrees() {
            return emWalkPath(bankToTreesPath);
        }
    
        public boolean treesToBank() {
            return emWalkPath(treesToBankPath);
        }
    
        public boolean atTrees() {
            return distanceTo(tree1Tile) < 10 || distanceTo(tree2Tile) < 10;
        }
    
        public int clickTree() {
            RSObject object = findObject(treeID);
            if(object == null || distanceTo(object.getLocation()) > 16) {
                return -2;
            }
            if(atObject(object, "Chop")) {
                return 1;
            }
            if(distanceTo(object.getLocation()) > 3) {
                if(emWalkTile(object.getLocation())) {
                    return 2;
                }
            }
            return -1;
        }
    
        public boolean emWalkPath(RSTile[] path) {
            for(int I = path.length - 1; I >= 0; I--) {
                if(emWalkTile(path[I])) {
                    return true;
                }
            }
            return false;
        }
    
        public boolean emWalkTile(RSTile tile) {
            if(distanceTo(tile) <= 16) {
                walkTileMM(tile);
                return true;
            } else {
                return false;
            }
        }
    
        public void homeTele() {
            openTab(Script.TAB_MAGIC);
            castSpell(1);
        }
    
        public boolean walkBack() {
            return emWalkPath(walkBackPath);
        }
    
        public void runOn() {
            setRun(true);
        }
    
        public void spinView() {
            Bot.getInputManager().pressKey((char) KeyEvent.VK_RIGHT);
            spinningView = true;
        }
    
        boolean spinningView = false;
    
        public boolean checkSpinningView() {
            if(spinningView) {
                Bot.getInputManager().releaseKey((char) KeyEvent.VK_RIGHT);
                spinningView = false;
                return true;
            } else {
                return false;
            }
         }
    
    //bank to tree walk
        public RSTile[] bankToTreesPath = {new RSTile(2727,3493),new RSTile(2724,3476),new RSTile(2721,3458),new RSTile(2710,3443),new RSTile(2702,3427),new RSTile(2698,3424)};
    
    //tree to bank walk
        public RSTile[] treesToBankPath = {new RSTile(2708,3435),new RSTile(2715,3447),new RSTile(2724,3461),new RSTile(2722,3474),new RSTile(2727,3474),new RSTile(2727,3482),new RSTile(2727,3493)};
    
        public int treeID = 1306;
    
        public RSTile tree1Tile = new RSTile(2696, 3423);
    
        public RSTile tree2Tile = new RSTile(2691, 3424);
    
        public RSTile tree3Tile = new RSTile(2690, 3426);
    
        public int bankerID = 495;
    
        public RSTile bankTile = new RSTile(2727, 3494);
    
        public RSTile centerTile = new RSTile(2731, 3491);
    
        public final String[] treeNames = {"Magic"};
    
    //The one hell of a death and home teleport walk D:, my hand started to hurt after typing this.
        public RSTile[] walkBackPath = {new RSTile(3222,3216),new RSTile(3227,3234),new RSTile(3218,3251),new RSTile(3199,3246),new RSTile(3162,3240),new RSTile(3143,3234),new RSTile(3127,3222),new RSTile(3113,3224),new RSTile(3102,3240),new RSTile(3103,3259),new RSTile(3105,3272),new RSTile(3097,3286),new RSTile(3078,3282),new RSTile(3062,3275),new RSTile(3042,3272),new RSTile(3024,3276),new RSTile(3010,3281),new RSTile(3007,3294),new RSTile(3008,3312),new RSTile(3006,3344),new RSTile(3001,3356),new RSTile(2998,3363),new RSTile(2989,3371),new RSTile(2974,3379),new RSTile(2965,3394),new RSTile(2961,3410),new RSTile(2951,3422),new RSTile(2946,3434),new RSTile(2939,3451),new RSTile(2924,3449),new RSTile(2918,3433),new RSTile(2908,3419),new RSTile(2891,3422),new RSTile(2875,3429),new RSTile(2866,3455),new RSTile(2858,3466),new RSTile(2856,3480),new RSTile(2862,3494),new RSTile(2855,3509),new RSTile(2841,3507),new RSTile(2851,3496),new RSTile(2848,3479),new RSTile(2843,3468),new RSTile(2844,3459),new RSTile(2853,3445),new RSTile(2842,3432),new RSTile(2829,3438),new RSTile(2812,3436),new RSTile(2797,3433),new RSTile(2784,3442),new RSTile(2778,3447),new RSTile(2773,3454),new RSTile(2763,3466),new RSTile(2759,3471),new RSTile(2750,3474),new RSTile(2742,3476),new RSTile(2727,2484),new RSTile(2725,3491),new RSTile(2726,3493)};
    
    }
     
  5. Unread #3 - Nov 23, 2008 at 12:40 AM
  6. payne93
    Referrals:
    0

    payne93 Guest

    [request] Magic Log Cutter + Banker [RSBOT]

    Sorcerer Tower?
     
  7. Unread #4 - Nov 23, 2008 at 3:01 AM
  8. Dj_Haxor
    Referrals:
    0

    Dj_Haxor Guest

    [request] Magic Log Cutter + Banker [RSBOT]

    look in my 400+ scripts thread, enjoy
     
  9. Unread #5 - Nov 23, 2008 at 9:17 AM
  10. stevenp
    Joined:
    Jan 23, 2007
    Posts:
    237
    Referrals:
    0
    Sythe Gold:
    0

    stevenp Active Member
    Banned

    [request] Magic Log Cutter + Banker [RSBOT]

    yea id like to find one also
     
  11. Unread #6 - Nov 29, 2008 at 11:54 AM
  12. 4dy
    Joined:
    Jan 3, 2008
    Posts:
    218
    Referrals:
    0
    Sythe Gold:
    0

    4dy Active Member

    [request] Magic Log Cutter + Banker [RSBOT]

    Doesnt seem to work for me :\

    EDIT: Never mind i got it going now :)
     
< Soooo Slow!!! | Selling 80 Range Pure >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site