How do i save scripts?

Discussion in 'Archives' started by I B0t 4 Phun, Nov 30, 2008.

Thread Status:
Not open for further replies.
How do i save scripts?
  1. Unread #1 - Nov 30, 2008 at 10:51 AM
  2. I B0t 4 Phun
    Joined:
    Nov 18, 2008
    Posts:
    181
    Referrals:
    0
    Sythe Gold:
    0

    I B0t 4 Phun Active Member
    Banned

    How do i save scripts?

    Yes this might sound little nooby but i realy dont know :S

    For example, i wanna save the TenacsWillowChopper:

    First i copy from the 'code' thingy
    [​IMG]

    Then i save it as TenacsWillowChopper.java with wordpad
    [​IMG]

    But when i press 'Compile all' this just happens
    [​IMG]


    What am i doing wrong??

    lols for all the colors ^^
     
  3. Unread #2 - Nov 30, 2008 at 10:54 AM
  4. u was piled
    Referrals:
    0

    u was piled Guest

    How do i save scripts?

    Well either the script is broken or you didnt copy it make sure your saving the script when you put it in the notepad file or when you close it just goes back to defualt
     
  5. Unread #3 - Nov 30, 2008 at 11:01 AM
  6. I B0t 4 Phun
    Joined:
    Nov 18, 2008
    Posts:
    181
    Referrals:
    0
    Sythe Gold:
    0

    I B0t 4 Phun Active Member
    Banned

    How do i save scripts?

    no that has nothing to do with it, have tried many scripts
     
  7. Unread #4 - Nov 30, 2008 at 11:21 AM
  8. Fromaaz
    Joined:
    Mar 21, 2008
    Posts:
    645
    Referrals:
    1
    Sythe Gold:
    0

    Fromaaz Apprentice
    Banned

    How do i save scripts?

    Try using the compiler in the folder. That sometimes fixes things.
     
  9. Unread #5 - Nov 30, 2008 at 11:30 AM
  10. I B0t 4 Phun
    Joined:
    Nov 18, 2008
    Posts:
    181
    Referrals:
    0
    Sythe Gold:
    0

    I B0t 4 Phun Active Member
    Banned

    How do i save scripts?

    If i use the compiler in the folder this happens:

    [​IMG]
     
  11. Unread #6 - Nov 30, 2008 at 11:50 AM
  12. UrbanHamster
    Joined:
    Nov 25, 2008
    Posts:
    62
    Referrals:
    0
    Sythe Gold:
    0

    UrbanHamster Member

    How do i save scripts?

    Simple solution for a problem that stumps a few:

    Download Notepad ++ which you can do here.

    From there, you follow every step you have done so far. However, the only difference is under the file type you want to save it as you can select .java. Which is a time-saver, and a big help?
     
  13. Unread #7 - Nov 30, 2008 at 11:51 AM
  14. MatthewGor123
    Joined:
    Dec 17, 2005
    Posts:
    1,213
    Referrals:
    0
    Sythe Gold:
    0

    MatthewGor123 Guru
    Do Not Trade

    How do i save scripts?

    Okay, here's your problem: the new RSBot forums had some weird glitch, and many of the apostrophes (') were turned into quotation marks ("). Please check out the Ultimate Script Collection for a working Tenac's Willow Chopper .class file. Here is your fix, by the way:

    PHP:
    import java.awt.*;
    import java.util.*;

    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.accessors.*;
    import com.speljohan.rsbot.event.listeners.PaintListener;

    public class 
    TenacWillowChopper extends Script implements PaintListener {

        public 
    int[] willowTreeID = { 1308, 5551, 5552, 5553 };
        public 
    int[] banker1ID = { 494 };
        public 
    int[] banker2ID = { 495 };
        public 
    int[] bankBoothID = { 2213 };
        public 
    int[] depositBoxID = { 9398 };
        public 
    int willowLogID = 1519;

        public 
    int[] axeID = { 1351, 1349, 1353, 1355, 1357, 1359, 6739 };
        public 
    int[] brokenAxeID = { 494, 496, 498, 502, 504, 506, 6741 };
        
    //gems uncut, gems cut, beer, kebab, 
        
    public int[] otherItems = { 1623, 1621, 1619, 1617, 1607, 1605, 1603, 1601, 1917, 1971 };
        public 
    int goldPiecesID = 995;
        
        public 
    RSTile willowTile1 = new RSTile(3087, 3235);
        public 
    RSTile willowTile2 = new RSTile(3088, 3230);
        public 
    RSTile bankTile = new RSTile(3093, 3243);
        public 
    RSTile lumbridgeTile = new RSTile(3221, 3218);

        public 
    RSTile[] walkBackPath = { new RSTile(3232, 3219), new RSTile(3232, 3230), new RSTile(3221, 3237),
                                         new 
    RSTile(3216, 3247), new RSTile(3203, 3247), new RSTile(3189, 3246), 
                                         new 
    RSTile(3175, 3242), new RSTile(3161, 3240), new RSTile(3148, 3235), 
                                         new 
    RSTile(3134, 3229), new RSTile(3119, 3228), new RSTile(3106, 3234), 
                                         new 
    RSTile(3095, 3242) };

        public 
    long startTime = System.currentTimeMillis();
        public 
    int logsBanked = 0;
        public 
    int logsDropped = 0;
        public 
    int ranAwayFromCombat = 0;
        public 
    int startingLevel = 0;
        public 
    int startingExperience = 0;
        public 
    int priceOfWillowLog = 18;
        public 
    int entsAvoided = 0;
        public 
    int numObjects = 0;
        public 
    double xpPerWillow = 67.5;
        public 
    boolean powerChopping = false;
        public 
    int invCountToDrop = random(10, 29);
        public 
    boolean dropping = false;

        public 
    boolean lost = false;
        public 
    boolean lumbridge = false;

        public 
    double getVersion() {
            return 
    1.3;
        }

        public 
    String getName() {
            return 
    "Tenac's Draynor Willows";
        }

        public 
    String getAuthor() {
            return 
    "Tenac";
        }

        public 
    String getScriptCategory() {
            return 
    "Skills/Woodcutting";
        }

        public 
    String getScriptDescription( ) {
            
    String html = "";

            
    html += "<html>\n";
            
    html += "<body>\n";

            
    html += "<font size=\"6\">";
            
    html += "<center><h2>" + getName() + "</h2></center>\n";
            
    html += "</font>";

            
    html += "<b>Author:</b>" + getAuthor() + "<br/>";
            
    html += "<b>Version:</b>" + getVersion() + "<br/><br>";

            
    html += "Chops and banks willow logs in Draynor bank.<br>\n<br>";
            
            
    html += "<input type=\"checkbox\" name=\"powerchop\" value=\"yes\">Drop logs?\n";
            
            
    html += "</body>\n";
            
    html += "</html\n";

            return 
    html;
        }

        public 
    boolean onStart(Map<String, String> args) {
            
    startTime = System.currentTimeMillis();
            if(
    isLoggedIn()) {
                
    startingLevel = skills.getCurrentSkillLevel(STAT_WOODCUTTING);
                
    startingExperience = skills.getCurrentSkillExp(STAT_WOODCUTTING);
                
    setCameraAltitude(true);
                
    setCameraRotation(random(1, 359));
                
    setRun(true);
            }

            if(
    args.get("powerchop") != null)
                
    powerChopping = true;

            
    Bot.getEventManager().addListener(PaintListener.class, this);
            return 
    true;
        }

        public 
    void onFinish() {
            
    Bot.getEventManager().removeListener(PaintListener.class, this);
        }

        public 
    void onRepaint(Graphics g) {
            if(
    isLoggedIn()) {
                if(
    startTime == 0)
                    
    startTime = System.currentTimeMillis();

                if(
    startingLevel == 0 || startingExperience == 0) {
                    
    startingLevel = skills.getCurrentSkillLevel(STAT_WOODCUTTING);
                    
    startingExperience = skills.getCurrentSkillExp(STAT_WOODCUTTING);
                }

                
    long millis = System.currentTimeMillis() - startTime;
                
    long hours = millis / (1000 * 60 * 60);
                
    millis -= hours * (1000 * 60 * 60);
                
    long minutes = millis / (1000 * 60);
                
    millis -= minutes * (1000 * 60);
                
    long seconds = millis / 1000;

                
    g.setColor(new Color(33, 46, 207, 100));
                
    //window is (0, 0) (337, 515)
                //my box is (515 - 260, 0) (337, 200)
                
    int x = 515 - 230;
                
    int y = 4;
                
    g.fillRoundRect(x, y, 230, 155, 20, 20);
                
    g.setColor(new Color(26, 36, 162, 255));
                
    g.drawRoundRect(x, y, 230, 155, 20, 20);
                
                
    g.setColor(new Color(255, 255, 255, 255));
                
    g.drawString(getAuthor() + "'s " + getName() + " v" + getVersion(), x + 10, y += 15);
                
    g.drawString("Running for " + hours + ":" + minutes + ":" + seconds, x + 10, y += 15);
                if(
    powerChopping)
                    
    g.drawString("Dropped " + logsDropped + " willow logs", x + 10, y += 15);
                else
                    
    g.drawString("Banked " + logsBanked + " willow logs", x + 10, y += 15);
                
    g.drawString("Gained " + (logsBanked * priceOfWillowLog) + "gp", x + 10, y += 15);
                
    g.drawString("Currently level " + skills.getCurrentSkillLevel(STAT_WOODCUTTING) + " and " + skills.getPercentToNextLevel(STAT_WOODCUTTING) + "% to next level", x + 10, y += 15);
                
    g.drawString("Gained " + (skills.getCurrentSkillLevel(STAT_WOODCUTTING) - startingLevel) + " levels", x + 10, y += 15);
                
    g.drawString("Gained " + (skills.getCurrentSkillExp(STAT_WOODCUTTING) - startingExperience) + " experience", x + 10, y += 15);
                
    g.drawString("Ran from combat " + ranAwayFromCombat + " times", x + 10, y += 15);
                
    g.drawString("Avoided " + entsAvoided + " ents", x + 10, y += 15);
                
    g.drawString("" + (int)(skills.getXPToNextLevel(STAT_WOODCUTTING) / xpPerWillow + 1) + " more logs until next level", x + 10, y += 15);
    /*
                XpPerMin = skills.getCurrentSkillExp(WOODCUTTING_STAT) - startingExperience / (Minutes here);
                skills.getXPToNextLevel(WOODCUTTING_STAT) / XpPerMin
    */
            
    }
        }
        
        public 
    void printProgressReport() {
            
    long millis = System.currentTimeMillis() - startTime;
            
    long hours = millis / (1000 * 60 * 60);
            
    millis -= hours * (1000 * 60 * 60);
            
    long minutes = millis / (1000 * 60);
            
    millis -= minutes * (1000 * 60);
            
    long seconds = millis / 1000;

            
    log(getAuthor() + "'s " + getName() + " v" + getVersion());
            
    log("Running for " + hours + ":" + minutes + ":" + seconds);
            if(
    powerChopping)
                
    log("Dropped " + logsDropped + " willow logs");
            else
                
    log("Banked " + logsBanked + " willow logs");
            
    log("Gained " + (logsBanked * priceOfWillowLog) + "gp");
            
    log("Currently level " + skills.getCurrentSkillLevel(STAT_WOODCUTTING) + " and " + skills.getPercentToNextLevel(STAT_WOODCUTTING) + "% to next level");
            
    log("Gained " + (skills.getCurrentSkillLevel(STAT_WOODCUTTING) - startingLevel) + " levels");
            
    log("Gained " + (skills.getCurrentSkillExp(STAT_WOODCUTTING) - startingExperience) + " experience");
            
    log("Ran from combat " + ranAwayFromCombat + " times");
            
    log("Avoided " + entsAvoided + " ents");
            
    log("" + (int)(skills.getXPToNextLevel(STAT_WOODCUTTING) / xpPerWillow + 1) + " more logs until next level");
        }

        public 
    int loop() {
            if(!
    isLoggedIn())
                return 
    random(200, 400);

            if(
    getMyPlayer().isInCombat())
                return 
    runAway();

            if(
    checkForEnt())
                return 
    random(100, 200);

            if(
    distanceTo(lumbridgeTile) <= 17) {
                
    lumbridge = true;
                
    lost = false;
            }

            if(!
    lumbridge && distanceTo(willowTile1) > 17 && distanceTo(willowTile2) > 17  && distanceTo(bankTile) > 17)
                
    lost = true;

            if(
    lost)
                return 
    teleportToLumbridge();
            
            if(
    lumbridge) {
                if(
    myWalkPath(walkBackPath, 1)) {
                    
    lumbridge = false;
                }
                return 
    random(50, 200);
            }

            
    //if(isCarryingItem(brokenAxeID) || !isCarryingItem(axeID)) //broken for some reason
            
    if(isCarryingItem(brokenAxeID))
                return 
    getNewAxe();

            if(
    powerChopping && (getInventoryCount() >= invCountToDrop || isInventoryFull()))
                
    dropping = true;

            if(
    dropping)
                return 
    dropLogs();

            if(
    isInventoryFull() && !powerChopping)
                return 
    depositInventory();

            return 
    chopWillow();
        }

        public 
    boolean checkForEnt() {
            
    //taken and modified from dontpanic
            
    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("Willow").contains(npc.getName())) {
                        
    atTile(getMyPlayer().getLocation(), "alk here");
                        
    entsAvoided++;
                        return 
    true;
                    } 
                }
            }
            return 
    false;
        }

        public 
    int runAway() {
            
    setRun(true);
            
    RSTile curentTile = getMyPlayer().getLocation();
            
    int xRand = random(-16, 16);
            
    int yRand = 16 - xRand;
            
    RSTile runawayTile = new RSTile(curentTile.getX() + xRand, curentTile.getY() + yRand);
            
    myWalkTile(runawayTile, 0);
            
    waitUntilNotMoving();
            
    wait(random(2200, 3800));
            
    myWalkTile(curentTile, 1);
            
    wait(random(50, 400));
            
    moveMouse(random(0, 515), random(0, 337));
            
    waitUntilNearTile(curentTile, 1);
            
    ranAwayFromCombat++;
            return 
    random(50, 100);
        }
        
        public 
    int getNumObjectAroundPlayer(int... ids) {
            
    int num = 0;
            for(
    int y = 1; y >= -1; y--) {
                for(
    int x = -1; x <= 1; x++) {
                    
    RSObject obj = getObjectAt(getMyPlayer().getLocation().getX() + x, getMyPlayer().getLocation().getY() + y);
                    if(
    obj != null) {
                        for(
    int i = 0; i < ids.length; i++) {
                            if(
    obj.getID() == ids[i]) {
                                
    num++;
                                break;
                            }
                        }
                    }
                }
            }
            return 
    num;
        }

        public 
    boolean atTree(int[] ids, String action) {
            
    RSObject obj = findObject(ids);
            if(
    obj == null)
                return 
    false;
            
    /*
                0  1
                2  3
            */
            
    Point[] point = new Point[4];
            
    RSObject[] objs = new RSObject[4];
            for(
    int i = 0; i < 4; i++) {
                
    point[i] = Calculations.tileToScreen(obj.getLocation());
                
    objs[i] = obj;
            }
            
    boolean done = false;
            for(
    int y = 1; y >= -2; y--) {
                for(
    int x = -1; x <= 2; x++) {
                    
    objs[0] = getObjectAt(obj.getLocation().getX() + x, obj.getLocation().getY() + y);
                    
    objs[1] = getObjectAt(obj.getLocation().getX() + x + 1, obj.getLocation().getY() + y);
                    
    objs[2] = getObjectAt(obj.getLocation().getX() + x, obj.getLocation().getY() + y - 1);
                    
    objs[3] = getObjectAt(obj.getLocation().getX() + x + 1, obj.getLocation().getY() + y - 1);
                    if(
    objs[0] != null && objs[1] != null && objs[2] != null && objs[3] != null) {
                        if(
    objs[0].getID() == obj.getID() && objs[1].getID() == obj.getID() && 
                           
    objs[2].getID() == obj.getID() && objs[3].getID() == obj.getID()) {
                            
    point[0] = Calculations.tileToScreen(new RSTile(obj.getLocation().getX() + x, obj.getLocation().getY() + y));
                            
    point[1] = Calculations.tileToScreen(new RSTile(obj.getLocation().getX() + x + 1, obj.getLocation().getY() + y));
                            
    point[2] = Calculations.tileToScreen(new RSTile(obj.getLocation().getX() + x, obj.getLocation().getY() + y - 1));
                            
    point[3] = Calculations.tileToScreen(new RSTile(obj.getLocation().getX() + x + 1, obj.getLocation().getY() + y - 1));
                            
    done = true;
                            break;
                        }
                    }
                }
                if(
    done)
                    break;
            }
            for(
    int i = 0; i < 4; i++)
                if(
    point[i].x == -1 || point[i].y == -1)
                    
    point[i] = Calculations.tileToScreen(obj.getLocation());

            
    //find all the midpoints
            
    Point one = new Point((point[0].x + point[3].x) / 2, (point[0].y + point[3].y) / 2);
            
    Point two = new Point((point[1].x + point[2].x) / 2, (point[1].y + point[2].y) / 2);
            
    Point finalPoint = new Point((one.x + two.x) / 2, (one.y + two.y) / 2);
            
    finalPoint.y -= random(21, 27);

            
    moveMouse(finalPoint, 4, 4);
            if(
    getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
                
    clickMouse(true);
                
    waitUntilNotMoving();
                
    numObjects = getNumObjectAroundPlayer(willowTreeID);
                return 
    true;
            } else {
                
    clickMouse(false);
                if(
    atMenu(action)) {
                    
    numObjects = getNumObjectAroundPlayer(willowTreeID);
                    return 
    true;
                }
                
    setCameraRotation(random(1, 359));
                
    setCameraAltitude(true);
            }
            
    waitUntilNotMoving();
            return 
    true;
        }

        public 
    int chopWillow() {
            if(
    distanceTo(bankTile) < 6) {
                
    myWalkTile(willowTile1, 2);
                
    wait(random(50, 400));
                
    moveMouse(random(0, 515), random(0, 337));
                if(
    random(0, 2) == 0)
                    
    setRun(true);
                
    waitUntilNotMoving();
                return 
    random(25, 75);
            }
            
    //is the nearest tree is visible on the screen?
            
    RSObject obj = findObject(willowTreeID);
            if(
    obj != null) {
                if(!
    Calculations.onScreen(Calculations.tileToScreen(obj.getLocation()))) {
                    if(
    distanceTo(willowTile1) < distanceTo(willowTile2))
                        
    myWalkTile(willowTile2, 1);
                    else
                        
    myWalkTile(willowTile1, 1);
                    
    wait(random(50, 400));
                    
    moveMouse(random(0, 515), random(0, 337));
                    
    waitUntilNotMoving();
                    return 
    random(500, 150);
                }
            }
            
    wait(random(80, 100));
            if(
    numObjects < getNumObjectAroundPlayer(willowTreeID)) {
                
    numObjects = getNumObjectAroundPlayer(willowTreeID);
                
    int r = random(0, 3);
                if(
    r == 0 || r == 1)
                    
    atTree(willowTreeID, "own Will");
                return 
    random(200, 400);
            }
            
            if(
    getMyPlayer().getAnimation() != -1) {
                return 
    antiBan();
            }
            if(
    atTree(willowTreeID, "own Will")) {
                return 
    random(200, 400);
            }
            return 
    random(30, 60);
        }

        public 
    int antiBan() {
            switch(
    random(0, 400)) {
                case 
    0: setCameraRotation(random(1, 359)); break;
                case 
    1: setCameraRotation(random(1, 359)); break;
                case 
    2: setCameraRotation(random(1, 359)); break;
                case 
    3: setCameraRotation(random(1, 359)); break;
                case 
    4: setCameraRotation(random(1, 359)); break;
                case 
    5: setCameraRotation(random(1, 359)); break;

                case 
    6: setCameraAltitude(true); break;
                case 
    7: setCameraAltitude(true); break;

                case 
    8: setRun(true); break;

                case 
    9: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    10: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    11: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    12: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    13: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    14: moveMouse(random(0, 515), random(0, 337)); break;
                case 
    15: moveMouse(random(0, 764), random(0, 502)); break;
                case 
    16: moveMouse(random(0, 764), random(0, 502)); break;
                case 
    17: moveMouse(random(0, 764), random(0, 502)); break;

                case 
    18: openTab(TAB_INVENTORY); break;
                case 
    19: openTab(TAB_INVENTORY); break;
                case 
    20: openTab(TAB_STATS); break;
                case 
    21: openTab(TAB_STATS); break;
                case 
    22: openTab(random(0, 13)); break;
                case 
    23: openTab(random(0, 13)); break;
                case 
    24: openTab(random(0, 13)); break;

                case 
    25: atTree(willowTreeID, "own Will"); break;

                default: break;

            }
            return 
    random(300, 500);
        }

        public 
    int dropLogs() {
            if(!
    inventoryContainsOneOf(willowLogID) && !inventoryContainsOneOf(otherItems)) {
                
    RSItem item = getInventoryItemByID(goldPiecesID);
                if(
    item == null) {
                    
    dropping = false;
                    
    invCountToDrop = random(10, 29);
                    return 
    random(50, 75);
                }
                if(
    item != null) {
                    if(
    item.getStackSize() > 5000) {
                        
    dropping = false;
                        
    invCountToDrop = random(10, 29);
                        return 
    random(50, 75);
                    }
                }
            }
            if(
    atInventoryItem(willowLogID, "Drop")) {
                
    logsDropped++;
                
    wait(random(500, 700));
                return 
    random(50, 75);
            }
            for(
    int i = 0; i < otherItems.length; i++) {
                if(
    inventoryContainsOneOf(otherItems[i])) {
                    if(
    atInventoryItem(otherItems[i], "Drop")) {
                        
    wait(random(500, 700));
                        return 
    random(50, 75);
                    }
                }
            }
            
    RSItem item = getInventoryItemByID(goldPiecesID);
            if(
    item != null) {
                if(
    item.getStackSize() <= 5000) {
                    
    atInventoryItem(goldPiecesID, "Drop");
                    
    wait(random(500, 700));
                }
            }
            return 
    random(50, 75);
        }
        
        public 
    int depositInventory() {
            if(
    distanceTo(bankTile) > 17) {
                
    myWalkTile(willowTile1, 1);
                
    waitUntilNearTile(willowTile1, 2);
                return 
    random(10, 50);
            }
            if(
    distanceTo(bankTile) > 6) {
                
    myWalkTile(bankTile, 1);
                
    wait(random(50, 300));
                if(
    random(0, 2) == 0)
                    
    setRun(true);
                
    wait(random(50, 300));
                
    moveMouse(random(0, 515), random(0, 337));
                
    waitUntilNotMoving();
                return 
    random(10, 50);
            }
            if(!
    RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                switch(
    random(0, 2)) {
                    case 
    0: atObject(findObject(bankBoothID), "uickl"); break;
                    case 
    1: if(random(0, 2) == 0)
                                
    atNPC(getNearestNPCByID(banker1ID), "ank Ba");
                            else
                                
    atNPC(getNearestNPCByID(banker2ID), "ank Ba");
                            break;
                    
    //case 2: atObject(findObject(depositBoxID), "sit Ban"); break;
                    
    default: atObject(findObject(bankBoothID), "uickl"); break;
                }
                
    waitUntilNotMoving();
                return 
    random(600, 150);
            }
            if(
    RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                
    logsBanked += getInventoryCount(willowLogID);
                
    bank.depositAllExcept(axeID);
                if(
    random(0, 5) == 0)
                    
    bank.close();
            }
            return 
    random(50, 100);
        }

        public 
    void unequipWeapon() {
            
    openTab(TAB_EQUIPMENT);
            
    RSInterface equip = RSInterface.getInterface(INTERFACE_TAB_EQUIPMENT);
            
    RSInterfaceChild weapon = equip.getChild(16);
            
    atInterface(weapon);
            
    wait(random(400, 800));
            
    openTab(TAB_INVENTORY);
        }

        public 
    int getNewAxe() {
            if(
    equipmentContains(brokenAxeID)) {
                
    unequipWeapon();
                return 
    random(50, 150);
            }
            if(
    distanceTo(bankTile) > 17) {
                
    myWalkTile(willowTile1, 2);
                
    waitUntilNotMoving();
                return 
    random(50, 150);
            }
            if(
    distanceTo(bankTile) > 6) {
                
    myWalkTile(bankTile, 1);
                
    wait(random(50, 400));
                
    moveMouse(random(0, 515), random(0, 337));
                
    waitUntilNotMoving();
                return 
    random(50, 150);
            }
            if(!
    RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                switch(
    random(0, 2)) {
                    case 
    0: atObject(findObject(bankBoothID), "uickl"); break;
                    case 
    1: if(random(0, 2) == 0)
                        
    atNPC(getNearestNPCByID(banker1ID), "ank Ba");
                    else
                        
    atNPC(getNearestNPCByID(banker2ID), "ank Ba");
                    break;
                    
    //case 2: atObject(findObject(depositBoxID), "sit Ban"); break;
                    
    default: atObject(findObject(bankBoothID), "uickl"); break;
                }
                return 
    random(300, 600);
            }
            
    waitUntilNotMoving();
            
    wait(random(500, 800));
            if(
    RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                
    logsBanked += getInventoryCount(willowLogID);
                
    bank.depositAll();

                
    //broken since the bank methods are broken
                /*
                bank.setWithdrawModeToItem();
                int skillWC = skills.getCurrentSkillLevel(STAT_WOODCUTTING);
                for(int i = axeID.length - 1; i >= 0; i--) {
                    if((skillWC >= 61 && i == 6) || 
                       (skillWC >= 41 && i == 5) || 
                       (skillWC >= 31 && i == 4) || 
                       (skillWC >= 21 && i == 3) || 
                       (skillWC >= 6 && i == 2)  || 
                       (skillWC >= 1 && i == 1)  || 
                       (skillWC >= 1 && i == 0)) {
                        bank.atItem(axeID[i], "hdraw 1");
                        break;
                    }
                }
                wait(random(400, 900));
                if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 61 && inventoryContainsOneOf(axeID[6]))
                    atInventoryItem(axeID[5], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 41 && inventoryContainsOneOf(axeID[5]))
                    atInventoryItem(axeID[5], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 31 && inventoryContainsOneOf(axeID[4]))
                    atInventoryItem(axeID[4], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 21 && inventoryContainsOneOf(axeID[3]))
                    atInventoryItem(axeID[3], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 6 && inventoryContainsOneOf(axeID[2]))
                    atInventoryItem(axeID[2], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(axeID[1]))
                    atInventoryItem(axeID[1], "ield");
                else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(axeID[0]))
                    atInventoryItem(axeID[0], "ield");
                */
                
    bank.close();
            }
            
    log("No useable woodcutting axe, ending script =(");
            
    printProgressReport();
            
    stopAllScripts();
            return 
    random(200, 400);
            
        }

        
    int tries = 0;
        public 
    int teleportToLumbridge() {
            if(
    distanceTo(lumbridgeTile) > 17) {
                
    openTab(Script.TAB_MAGIC);
                
    castSpell(1);
                
    wait(random(1500, 2400));
                if(
    getMyPlayer().getAnimation() != -1) {
                    
    wait(random(12500,14000));
                    
    lost = false;
                    
    lumbridge = true;
                } else {
                     
    tries++;
                     if(
    tries >= 4) {
                         
    log("Unable to teleport home, stopping script");
                         
    printProgressReport();
                         
    stopAllScripts();
                     }
                }
            }
            
    myWalkTile(lumbridgeTile, 1);
            
    setRun(true);
            
    waitUntilNearTile(lumbridgeTile, 2);
            return 
    random(100, 600);
        }

        public 
    void waitUntilNotMoving() {
            
    wait(random(600, 700));
            while(
    getMyPlayer().isMoving())
                
    wait(random(25, 100));
        }

        public 
    void waitUntilNearTile(RSTile tile, int dist) {
            
    wait(random(600, 700));
            while(
    distanceTo(tile) > dist && getMyPlayer().isMoving())
                
    wait(random(25, 100));
        }

        public 
    boolean myWalkTile(RSTile theTile, int randomness) {
            if((
    distanceTo(theTile)) <= 17) {
                
    RSTile newTile;
                if(
    randomness == 0)
                    
    newTile = new RSTile(theTile.getX(), theTile.getY());
                else
                    
    newTile = new RSTile(theTile.getX() + random(-randomness, randomness), theTile.getY() + random(-randomness, randomness));

                if(
    random(0, 4) == 0)
                    
    turnToTile(newTile, 15);

                if(
    tileOnScreen(newTile) && random(0, 8) == 0) {
                    if(!
    atTile(newTile, "Walk")) {
                        if(!
    walkTileMM(newTile)) {
                            
    log("Failed walking to tile: (" + theTile.getX() + ", " + theTile.getY() + ")");
                            return 
    false;
                        } else {
                            return 
    true;
                        }
                    } else {
                        return 
    true;
                    }
                } else {
                    if(!
    walkTileMM(newTile)) {
                        
    log("Failed walking to tile: (" + theTile.getX() + ", " + theTile.getY() + ")");
                        return 
    false;
                    } else {
                        return 
    true;
                    }
                }
            } else {
                
    log("Tile out of reach: (" + theTile.getX() + ", " + theTile.getY() + ")");
                return 
    false;
            }
        }

        public 
    RSTile myGetNextTile(RSTile[] path) {
            for(
    int i = path.length - 1; i >= 0; i--) {
                if(
    distanceTo(path[i]) <= 17) {
                    return 
    path[i];
                }
            }
            return 
    null;
        }

        public 
    boolean myWalkPath(RSTile[] path, int randomness) {
            if(
    distanceTo(path[path.length - 1]) <= 4) {
                return 
    true;
            } else {
                
    RSTile theTile = myGetNextTile(path);
                if(
    theTile != null) {
                    
    myWalkTile(theTile, randomness);
                    
    waitUntilNearTile(theTile, 2);
                }
                return 
    false;
            }
        }
    }
     
  15. Unread #8 - Nov 30, 2008 at 12:02 PM
  16. UrbanHamster
    Joined:
    Nov 25, 2008
    Posts:
    62
    Referrals:
    0
    Sythe Gold:
    0

    UrbanHamster Member

    How do i save scripts?

    That won&#8217;t fix his problem, Matthew. I tested the script that you posted, and used WordPad like Phun, and it still came up with the illegal character error. His problem is WordPad won&#8217;t allow him to save it in the form of a java file. As there is no all files option, or .java option; right now, he is choosing the RTF (Rich Text Format) which automatically saves the script to TenacWillowChopper.java.rtf on him, making an error occur during compile, or I believe this is what&#8217;s happening.
     
  17. Unread #9 - Nov 30, 2008 at 12:05 PM
  18. I B0t 4 Phun
    Joined:
    Nov 18, 2008
    Posts:
    181
    Referrals:
    0
    Sythe Gold:
    0

    I B0t 4 Phun Active Member
    Banned

    How do i save scripts?

    nope the same shit happens, except it doesnt say anything about it at all, cant find it in "Run bot" folder-thingy
     
  19. Unread #10 - Nov 30, 2008 at 12:07 PM
  20. MatthewGor123
    Joined:
    Dec 17, 2005
    Posts:
    1,213
    Referrals:
    0
    Sythe Gold:
    0

    MatthewGor123 Guru
    Do Not Trade

    How do i save scripts?

    Look at his error. His problem isn't that it's an unrecognized file-type. If you save it as TenacWillowChopper.java.rtf, Compile.bat will not recognize the file - it wouldn't produce an error. My script compiles just fine.

    I Bot 4 Phun, add me on MSN. We'll get this sorted.
     
  21. Unread #11 - Nov 30, 2008 at 12:11 PM
  22. UrbanHamster
    Joined:
    Nov 25, 2008
    Posts:
    62
    Referrals:
    0
    Sythe Gold:
    0

    UrbanHamster Member

    How do i save scripts?

    If you didn't get the same error as before, check the skills category in the run script section of RSBot. That is where it saves, bud.
     
< selling dragon lump + elite | rsbot karamja fishing!! >

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


 
 
Adblock breaks this site