Ezud.com - Trolling Assistance Forum

Ezud.com - Trolling Assistance Forum (http://ezud.com/forum/index.php)
-   Spam (http://ezud.com/forum/forumdisplay.php?f=29)
-   -   For lust; too long for PM. (http://ezud.com/forum/showthread.php?t=2964)

EndOfStory? 11-16-2008 11:49 AM

For lust; too long for PM.
 
Quote:

Originally Posted by Lust
Can you send me the script and tell me where to put my acc to train str?

1-20 use 'Dr Chicken' that comes with the bot. Put your account in lumbridge chicken farm.

20-45 use Goblin trainer, put your account in goblin house. This ones painful but the only option.

45-60 use this beauty :D Best to get members for topaz machete. Go to alkarid guards. Room nearest bank. Have food top left slot of bank.

Code:

// .. Remember to have food in first bank slot if you want to live forever.
// .. Start near the Alkahir mobs.


/* @News
 * http://svn2.assembla.com/svn/rsbotscripts/news/Peecsautofighter.news.html
 */


// Imports:

import java.awt.*;
import java.util.Map;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.bot.Bot;
import java.awt.event.KeyEvent;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;


public class Peecsautofighter extends Script implements PaintListener{
    public int MONSTERS_TO_ATTACK = 18;

    public int STATE=0;
    public int errorlvl = 0;
    public int antibanCounter = 0;

    public int STATINDEX;
    public int startXP;
    public int startLevel;
    public long startTime = System.currentTimeMillis();
    public boolean PICKUP_ARROWS=false;

    // For arrows methods.
    public int CurUsedArrow=0;
    public final int[] ARROW_IDS = {882,890,884,886,888}; // Bronze = 882 Addy = 890 Iron = 884 Steel = 886 Mith = 888


    // player spesific
    public int eat_health = 30;

    public int end_level_ATTACK = 0;
    public int end_level_STRENGTH = 0;
    public int end_level_DEFENCE = 0;
    public int end_level_RANGE = 0;
    public int skill_placement_ATTACK = 1;
    public int skill_placement_STRENGTH = 4;
    public int skill_placement_DEFENCE = 7;
    public int skill_placement_RANGE = 10;


    public static final int maxInvCount = 28;
    public static final char[] keys = new char[] { KeyEvent.VK_0, KeyEvent.VK_1,KeyEvent.VK_2,KeyEvent.VK_3,KeyEvent.VK_4,KeyEvent.VK_5,KeyEvent.VK_6,KeyEvent.VK_7,KeyEvent.VK_8,KeyEvent.VK_9 };

    public int foodtotalcount = 0;
          public int anti = 1;
          public boolean justDied=false;
          public boolean DeathWalkQuestDone=false;
          public boolean UseDeathWalk=false;
          public int[] ItemsEquipped;
          public int RunAwayStateIterator=0;
    public int RandomBoxItemID= 3062; // The random event.. this is the ID of the item..

          public int DEFENCE = 1;
          public int ATTACK = 0;
          public int STRENGTH = 2;
          public int RANGE = 4;
          public int style = 2;
          public String style2 = "Strength";
    public String style3 = "end_level_STRENGTH";
          public int selectStyle = 0;
          public boolean quickAttack = true;

    // @ Food ids from stronghold. Thnx.
    public final int[] FOOD_ID = { 1895,1893,1891, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229 }; //Has almost every food cookable in runescape, members and non!
    // @ Bank Window ID
    public static final int[] bankWindows = new int[] { 35647 };
    // Tiles
    public RSTile[] BankTiles = new RSTile[]{new RSTile(3293,3175),new RSTile(3279,3180),new RSTile(3274,3167),new RSTile(3269,3167)};
    public RSTile[] DeathWalkQDpart1Tiles = new RSTile[]{
        new RSTile(3267,3228),
        new RSTile(3253,3225),
        new RSTile(3239,3226),
        new RSTile(3231,3218)
    };
    public RSTile[] DeathWalkQDpart2Tiles = new RSTile[]{
        new RSTile(3274,3171),
        new RSTile(3268,3185),
        new RSTile(3268,3200),
        new RSTile(3270,3217),
        new RSTile(3269,3228)
    };
    public RSTile[] DeathWalkTiles = new RSTile[]{
        new RSTile(3270,3166),
        new RSTile(3275,3170),
        new RSTile(3283,3184),
        new RSTile(3287,3201),
        new RSTile(3284,3217),
        new RSTile(3288,3233),
        new RSTile(3293,3249),
        new RSTile(3284,3265),
        new RSTile(3281,3281),
        new RSTile(3280,3294),
        new RSTile(3280,3310),
        new RSTile(3282,3324),
        new RSTile(3269,3331),
        new RSTile(3260,3323),
        new RSTile(3247,3314),
        new RSTile(3240,3301),
        new RSTile(3239,3283),
        new RSTile(3240,3271),
        new RSTile(3229,3261),
        new RSTile(3220,3247),
        new RSTile(3225,3234),
        new RSTile(3233,3222)
    };
    public int AlkahidGate = 35550;


    // @ create Paths.
    public RSTilePath BankPath = new RSTilePath(BankTiles,this);
    public RSTilePath DeathWalkQDpart1 = new RSTilePath(DeathWalkQDpart1Tiles,this);
    public RSTilePath DeathWalkQDpart2 = new RSTilePath(DeathWalkQDpart2Tiles,this);
    public RSTilePath DeathWalk = new RSTilePath(DeathWalkTiles,this);
    public double getVersion() {
        return 2.0;
    }

    public String getName() {
        return "Peecsautofighter";
    }

    public String getAuthor() {
        return "Peec";
    }
    public String getScriptCategory() {
            return "PeecProSeries";
    }


  // @ Main LOOP
    public int loop() {
        if (isLoggedIn()){
            antibanCounter++;
            // Generic before any state..
            // If RandomBox event appeears ....
            if (inventoryContains(RandomBoxItemID)){
                SwitchState(4);
            }



            // Check style..
            CheckStyleChange();
            CheckForLost();
            // Do random stuff
            if (antibanCounter == random(20,80)){
                antiban();
                antibanCounter=0;
            }
            // If range check for arrows and so on.
            if (style==RANGE){
                if (PICKUP_ARROWS==true){
                    CheckEQarrows();
                    PickUpArrows();
                }

            }

           
            // If swarm and other randoms is near we walk to bank and back.
            RSNPC Random = getNearestFreeNPCByName("Swarm","Shade","Zombie","Strange plant");
            if (Random != null){
                setRun(true);
                log("Ugh, we got a random mob that we should run away against.. Im taking a run to the bank and back again :)");
                SwitchState(4);
            }

            // Set run.
            if (getEnergy() > random(40,70)){
                setRun(true);
            }
            StateCheck();
            // Switch for state
            boolean crit_error=false;
            switch(STATE){
                case -1:
                    log("Logging out... ");
                    if (getMyPlayer().isInCombat()) {
                        log("Im in combat and in logout state... Im going to try get to bank and logout there...");
                        try{
                            BankPath.walkToEnd();
                        }catch (Exception e){
                            log("An error occured whilst walking");
                        }
                        wait(random(3000,5000));
                    }
                    logout();
                    crit_error=true;
                break;
                // Nothing..
                case 0:
                    STATE = 1;
                break;

                // Fighting state
                case 1:
                    get_food_count();
                    if (skills.getCurrentSkillLevel(3) <= eat_health ){
                        if (eat_check()==false){
                            SwitchState(2);
                        }
                    }

                    if (this.foodtotalcount <= 2){
                        log("I must go to bank because i only got "+foodtotalcount+" food left...");
                        SwitchState(2);
                    }

                    // Is player in combat?
                    if (getMyPlayer().isInCombat()) {
                        return random(1500, 2250);
                    }
                    // @Fight system
                    if (!getMyPlayer().isInCombat() && !getMyPlayer().isMoving()) {
                        RSNPC Mobs = getNearestNPCByID(MONSTERS_TO_ATTACK);
                        if (Mobs != null){
                            log("Attacking mob");
                            atNPC(Mobs, "Attack");
                        }else{
                            log("I found no mobs, trying again soon. Going to try 15 times..");
                            errorlvl++;
                        }
                    }
                break;

                // Banking state
                case 2:
                    try{
                        BankPath.walkToEnd();
                    }catch (Exception e){
                        log("An error occured whilst walking");
                    }
                    if (bankget()==true){
                        try{
                            BankPath.walkToStart();
                        }catch (Exception e){
                            log("An error occured whilst walking");
                        }
                        SwitchState(1);
                    }
                break;

                // Death walk.
                case 3:
                    if (justDied==true)justDied=false;

                    if (UseDeathWalk==true){
                    RSObject bankWindow = findObject(bankWindows);

                    // We are finished with bank ?
                    if(bankWindow != null && distanceTo(bankWindow) <= 4){
                        CheckForWieldOldItems();
                        SwitchState(1);
                        return random(1500,3000);
                    }

                    if (DeathWalkQuestDone==true){
                        try{
                            DeathWalkQDpart1.walkToStart();
                        }catch (Exception e){
                            log("An error occured whilst walking");
                        }
                        RSObject Gate = findObject(AlkahidGate);
                        if (Gate != null && !getMyPlayer().isMoving()){
                            atObject(Gate, "Open");
                            wait(random(1600,2850));
                            try{
                                DeathWalkQDpart2.walkToStart();
                            }catch (Exception e){
                                log("An error occured whilst walking");
                            }
                        }
                    }else{
                        try{
                            DeathWalk.walkToStart();
                        }catch (Exception e){
                            log("An error occured whilst walking");
                        }
                    }
                    }else{
                        errorlvl++;
                        log("You did not enable deathwalk so we + errorlvl by 1. Sometimes before logout. REMEMBER! Some stuck stuff requires that deathwalk is enabled.");
                    }
                break;
               
                // Run away state...
                case 4:

                    RSObject bankWindow = findObject(bankWindows);
                    if (distanceTo(bankWindow) >= 8){
                    try{
                        BankPath.walkToEnd();
                    }catch (Exception e){
                        log("An error occured whilst walking");
                    }
                    }
                    if (RunAwayStateIterator == random(30,45)){
                        try{
                            BankPath.walkToStart();
                        }catch (Exception e){
                            log("An error occured whilst walking");
                        }
                        RunAwayStateIterator=0;
                        SwitchState(1);
                    }

                    RunAwayStateIterator++;
                    log("Some thing came up to run away for. Counter before starting. "+(RunAwayStateIterator)+"/30...");
                break;
            }
           
           
           
           
            if (crit_error){
                return -1;
            }

          }else{
              return random(500,1500);
          }
              return random(500,1500);
      }
    // @@ End Main Loop

    public void CheckForLost(){
        // Check if dead or in lumby...
        if (justDied==true || distanceTo(new RSTile(3232, 3219)) < 15){
            SwitchState(3);
        }
        if (getPlane()==1){ // Lost inside the alkahid castle upstairs
            RSObject stairs = findObject(35533);
            log("Im upstairs somewhere, im not supposed to be here thought..");
            if (stairs!=null){
                log("Im up stairs... Going to try getting myself back downstairs...");
                walkTileMM(new RSTile(random(3284,3285),3164));
                wait(random(4000,7000));
                atObject(stairs,"Climb-down");
                wait(random(1500,3000));
            }
            errorlvl++;
        }else if(getPlane()==0 && distanceTo(new RSTile(3208, 9616)) <= 15){ // Lost in lumby castle.
            log("I got teleported to lumby castle floor... Hum.. Im going to do tele and walk then.. Im going to try tele 15 times if it doesnt work we exit.");
            homeTele();
            wait(random(10000,15000));
            errorlvl++;
        }
    }

    public void homeTele() {
                    openTab(Script.TAB_MAGIC);
                    castSpell(1);
    }
       
    public void onRepaint(Graphics g) {
        if (isLoggedIn()) {
                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;
                int XPChange = skills.getCurrentSkillExp(STATINDEX) - startXP;
                int LevelChange = skills.getCurrentSkillLevel(STATINDEX) - startLevel;
                g.setColor(Color.red);


                g.drawString("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", 225, 380);
                g.drawString("Current: " + skills.getCurrentSkillLevel(STATINDEX) + " levels and " + skills.getCurrentSkillExp(STATINDEX) + " exp.", 225, 395);
                g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " exp.", 225, 425);

                g.drawString(skills.getXPToNextLevel(STATINDEX) + " XP to next level, we are " + skills.getPercentToNextLevel(STATINDEX) + "% to next level.", 225, 440);
                g.drawString("Error lvl: "+errorlvl+" of 15.(15=logout)", 225, 340);
                g.drawString("Cur State: "+STATE+".", 225, 365);
        }
    }


    public void StateCheck(){
        if (errorlvl > 10){
            STATE = -1;
        }
    }


    public boolean onStart(Map<String, String> args) {
        log(getName()+" v."+getVersion()+". Created by "+getAuthor());
        log("Thanks for using my autofighter. I hope you just enjoy it!");


                    if (args.get("style").equals("attack")){
                            this.style2 = "Attack";
                            this.style = ATTACK;
                            this.style3 = "end_level_ATTACK";
                            this.STATINDEX = skills.getStatIndex("attack");
                    }
                    if (args.get("style").equals("defence")) {
                            this.style2 = "Defence";
                            this.style = DEFENCE;
                            this.style3 = "end_level_DEFENCE";
                            this.STATINDEX = skills.getStatIndex("defence");
                    }
                    if (args.get("style").equals("strength")) {
                            this.style2 = "Strength";
                            this.style = STRENGTH;
                            this.style3 = "end_level_STRENGTH";
                            this.STATINDEX = skills.getStatIndex("strength");
                    }
                    if (args.get("style").equals("range")) {
                            this.style2 = "Rapid";
                            this.style = RANGE;
                            this.style3 = "end_level_RANGE";
                            this.STATINDEX = skills.getStatIndex("range");
                    }

                    this.end_level_ATTACK = (args.get("attack_end").equals("") || args.get("attack_end").equals("0")) ?  0 : Integer.parseInt(args.get("attack_end"));
        this.end_level_STRENGTH =  (args.get("strength_end").equals("") || args.get("strength_end").equals("0")) ? 0 : Integer.parseInt(args.get("strength_end"));
        this.end_level_DEFENCE =  (args.get("defence_end").equals("") || args.get("defence_end").equals("0")) ? 0 : Integer.parseInt(args.get("defence_end"));
        this.end_level_RANGE =  (args.get("range_end").equals("") || args.get("range_end").equals("0")) ? 0 : Integer.parseInt(args.get("range_end"));

        eat_health = Integer.parseInt(args.get("eat_at_hp"));

        this.PICKUP_ARROWS = (args.get("Do_PICKUP_ARROWS").equals("")  || args.get("Do_PICKUP_ARROWS").equals("0") ? false : true);
        this.DeathWalkQuestDone = (args.get("DeathWalkQuestDone").equals("")  || args.get("DeathWalkQuestDone").equals("0") ? false : true);
        this.UseDeathWalk = (args.get("UseDeathWalk").equals("")  || args.get("UseDeathWalk").equals("0") ? false : true);

        startLevel = skills.getCurrentSkillLevel(this.STATINDEX);
        startXP = skills.getCurrentSkillExp(this.STATINDEX);
        Bot.getEventManager().addListener(PaintListener.class, this);
        errorlvl=0;
       
        ItemsEquipped = getEquipmentArray();

        return true;
    }

    public void onFinish(){
        Bot.getEventManager().removeListener(PaintListener.class, this);
    }
   
    public void CheckForWieldOldItems(){
        for(int i = 0; i < ItemsEquipped.length; i++){
            if (!equipmentContains(ItemsEquipped[i])){
                if (inventoryContains(ItemsEquipped[i])){
                    if (atInventoryItem(ItemsEquipped[i],"Wield")==false){
                        atInventoryItem(ItemsEquipped[i],"Wear");
                    }
                    wait(random(1000,3000));
                }
            }
        }
    }




    public void SwitchState(int state){
        errorlvl=0;
        STATE=state;
    }

    public void CheckStyleChange(){
        // @ Check if need to change style....
        if (    (this.end_level_ATTACK != 0 && this.style3.equals("end_level_ATTACK")) ||
                (this.end_level_STRENGTH != 0 && this.style3.equals("end_level_STRENGTH")) ||
                (this.end_level_DEFENCE != 0 && this.style3.equals("end_level_DEFENCE")) ||
                (this.end_level_RANGE != 0 && this.style3.equals("end_level_RANGE"))
            ){
            int end_level_cur = 1;
            int cur_level_cur = 1;
            if (this.style3.equals("end_level_ATTACK"))end_level_cur= this.end_level_ATTACK;
            else if (this.style3.equals("end_level_STRENGTH"))end_level_cur= this.end_level_STRENGTH;
            else if (this.style3.equals("end_level_DEFENCE"))end_level_cur= this.end_level_DEFENCE;
            else if (this.style3.equals("end_level_RANGE"))end_level_cur= this.end_level_RANGE;
            if (this.style3.equals("skill_placement_ATTACK"))cur_level_cur= this.skill_placement_ATTACK;
            else if (this.style3.equals("skill_placement_STRENGTH"))cur_level_cur= this.skill_placement_STRENGTH;
            else if (this.style3.equals("skill_placement_DEFENCE"))cur_level_cur= this.skill_placement_DEFENCE;
            else if (this.style3.equals("skill_placement_RANGE"))cur_level_cur= this.skill_placement_RANGE;

            if (end_level_cur <= skills.getCurrentSkillLevel(cur_level_cur)){
                boolean change_style=false;
                log("Your "+this.style+" level has increased to the wanted level. Now checking for next train skill...");
                if (this.style3.equals("end_level_ATTACK"))this.end_level_ATTACK=0;
                else if (this.style3.equals("end_level_STRENGTH"))this.end_level_STRENGTH= 0;
                else if (this.style3.equals("end_level_DEFENCE"))this.end_level_DEFENCE= 0;
                else if (this.style3.equals("end_level_RANGE"))this.end_level_RANGE= 0;

                if (this.end_level_ATTACK != 0){
                                      this.style2 = "Attack";
                                      this.style = ATTACK;
                                      this.style3 = "end_level_ATTACK";
                                      this.STATINDEX = skills.getStatIndex("attack");
                                      change_style=true;
                }else if(this.end_level_STRENGTH != 0){
                                      this.style2 = "Strength";
                                      this.style = STRENGTH;
                                      this.style3 = "end_level_STRENGTH";
                                      this.STATINDEX = skills.getStatIndex("strength");
                                      change_style=true;
                }else if(this.end_level_DEFENCE != 0){
                                      this.style2 = "Defence";
                                      this.style = DEFENCE;
                                      this.style3 = "end_level_DEFENCE";
                                      this.STATINDEX = skills.getStatIndex("defence");
                                      change_style=true;
                }else if(this.end_level_RANGE != 0){
                                      this.style2 = "Rapid";
                                      this.style = RANGE;
                                      this.style3 = "end_level_RANGE";
                                      this.STATINDEX = skills.getStatIndex("range");
                                      change_style=true;
                }else{
                    SwitchState(-1);
                    log("No more styles to train ( finished with training, now logging out...... )");
                }
                if (change_style==true){
                    startLevel = skills.getCurrentSkillLevel(this.STATINDEX);
                    startXP = skills.getCurrentSkillExp(this.STATINDEX);
                    this.selectStyle = 0;
                    log("Now training "+this.style2);
                }
            }
        }
        if (selectStyle == 0 ){
            wait(random(1000,2000));
                              styleSelecter();
        }
    }
    public String getScriptDescription() {
        String html = "";
        html += "<html>";
        html += "<head>";
        html += "</head>";
        html += "<body>";
        html += "<center>";
        html += "<div>Welcome to Peecsautofighter. This will fight the warriors in alkahir, you will need to have food in bag and in first bank slot, when its empty for food in bag, it will go to bank and get food.";
        html += "<p><a href=\"http://svn2.assembla.com/svn/rsbotscripts/news/Peecsautofighter.news.html\"> Click here for news...</a></p>";
        html += "<br /><b>Follow simple steps:</b>";
        html += "<ul><li>1. Start left of alkahir bank, with the warriors ( Its those you are going to fight. )</li><li>2. Remember to have food in FIRST bank slot and food in bag.. </li><li>3. Set the HP to eat at ... in script setup. </li></ul>";
        html += "</div><div>";
        html +=    "<br />When to eat (HP)";
        html +=    "<br /><input type=\"text\" name=\"eat_at_hp\"2 value=\"30\">";
        html +=    "<td width=\"123\">Fighting style:</td>";
        html +=    "<br />Strength<input type=\"radio\" name=\"style\" value=\"strength\" checked ><br />Attack<input type=\"radio\" name=\"style\" value=\"attack\"><br />Deffence<input type=\"radio\" name=\"style\" value=\"deffence\"><br />Range<input type=\"radio\" name=\"style\" value=\"range\">";
        html +=    "<br />Pickup arrows? No: <input type=\"radio\" name=\"Do_PICKUP_ARROWS\" value=\"0\" checked> Yes: <input type=\"radio\" name=\"Do_PICKUP_ARROWS\" value=\"1\"> ";
        html +=    "<br />DeathWalk? No: <input type=\"radio\" name=\"UseDeathWalk\" value=\"0\" checked> Yes: <input type=\"radio\" name=\"UseDeathWalk\" value=\"1\">";
        html +=    "<br />Done Quest for Gate to Alkahid?(for deathwalk)>> No: <input type=\"radio\" name=\"DeathWalkQuestDone\" value=\"0\" checked> Yes: <input type=\"radio\" name=\"DeathWalkQuestDone\" value=\"1\">";
        html +=    "<br /><b>Stop fight or change fighting style(leave blank if not training that skill.)</b>";
        html +=    "<br />Stop train at Strength level ";
        html +=    "<input type=\"text\" name=\"strength_end\" style=\"width:20px;\">";
        html +=    "<br />Stop train at Attack level ";
        html +=    "<input type=\"text\" name=\"attack_end\" style=\"width:20px;\">";
        html +=    "<br />Stop train at Defence level ";
        html +=    "<input type=\"text\" name=\"defence_end\" style=\"width:20px;\">";
        html +=    "<br />Stop train at Range level ";
        html +=    "<input type=\"text\" name=\"range_end\" style=\"width:20px;\">";
        html += "</div>";
        html += "</center>";
        html += "</body>";
        html += "</html>";
        return (html);
    }

    public void get_food_count(){
        this.foodtotalcount=0;
        for(int I = 0; I<FOOD_ID.length; I++) {
            if(getInventoryCount(FOOD_ID[I]) >= 1) {
                this.foodtotalcount += getInventoryCount(FOOD_ID[I]);
            }
        }
    }

    // @ Eats and checks if it needs to go bank
    private boolean eat_check(){
            log("Im low on HP, going to check if i have somthing to eat...");

            if (this.foodtotalcount > 0){
                for(int I = 0; I<FOOD_ID.length; I++) {
                    if(getInventoryCount(FOOD_ID[I]) >= 1) {
                        eat(FOOD_ID[I]);
                        this.foodtotalcount--;
                    }
                }
            }else{
                return false;
            }
            return true;
    }
    // @ Eats spesific food id
    public boolean eat(int id){
        log("Eating. (#Food ID "+id+"). ");
        atInventoryItem(id, "Eat");
        wait(random(700,1500));
        return true;
    }

    // @ Goes to bank, gets first bank inventory item , withraw all food...
    public boolean bankget(){
            wait(random(5000,9000));
            RSObject bankWindow = findObject(bankWindows);
            if (!bank.getInterface().isValid()) {
                atObject(bankWindow, "Use-quickly");
                wait(random(1500, 1750));
            }
            if (style==RANGE){
                bank.depositAllExcept(ARROW_IDS);
            }else{
                bank.depositAllExcept(FOOD_ID);
            }
            // Range special case, it needs space for lovly arrows :D
            if (style==RANGE){
              getItemFromBankByCord(random(43,50), random(104,112), random(25,27));
            }else{
              getItemFromBankByCord(random(43,50), random(104,112), 28);
            }
            if (bank.getInterface().isValid()) {
                bank.close(); // close bank window /
                wait(random(800,1500));

            }
            get_food_count();
            wait(random(800,1500));

            if (this.foodtotalcount <= 2){
                log("You had no food left or just 2 in bank slot 1 :( so we put exithandler to +1 (sorry)... ");
                errorlvl++;
                return false;
            }

            return true;
    }









  //  @Functions from Stronghold.
        public void styleSelecter() {
        for(int j=70; j<101 ; j++) {
                        for(int i=27; i<37 ; i++) {
                                if (RSInterface.getChildInterface(j, i).containsText(style2)) {
                                        openTab(TAB_ATTACK);
                                        wait(random(500,1000));
                                        atInterface(j,i);
                                        log("Style Set, Training "+ style2);
                                        selectStyle = 1;
                                }

                                }
                        }
                if (selectStyle == 0) {
                        log("Setting Style Failed.");
                        selectStyle = 1;
                }

        }
        public void antiban() {

                anti = random(0,110);

                if (anti <= 35){
                        moveMouse(random(0,764),random(0,501));

                }

                if (anti >= 36 && anti <= 41 ){
                        if(random(0,1)==1) {
                                myOpenTab(random(0,12));
                        }else{
                        openTab(random(0,12));
                        }
                }

                if (anti >= 42 && anti <= 52){
                        if(random(0,1)==1) myOpenTab(TAB_STATS);
                        openTab(TAB_STATS);
                        wait( random(250,700));
                        moveMouse(random(556,707),random(230,442));
                        wait( random(750,1500));
                }

                if (anti >= 53 && anti <= 63){
                        if (!isRunning()){
                        //setRun(true);
                        }else {
                                if(random(0,1)==1) myOpenTab(TAB_STATS);
                                openTab(TAB_STATS);
                                wait( random(350,800));
                                moveMouse(random(556,648),random(230,281));
                                wait( random(550,1300));

                        }
                }
                if (anti >= 64 && anti <= 90){
                        rotate();
                }



        }
    public void myOpenTab(int tab) {      // Credit goes to nebule for this!
        if (tab == getCurrentTab()) {
              return;
        }
        switch(tab) {
        case TAB_ATTACK: input.holdKey((char) KeyEvent.VK_F1, random(300, 700)); break;
        case TAB_STATS: input.holdKey((char) KeyEvent.VK_F2, random(300, 700)); break;
        case TAB_QUESTS: input.holdKey((char) KeyEvent.VK_F3, random(300, 700)); break;
        case TAB_INVENTORY: input.holdKey((char) KeyEvent.VK_F4, random(300, 700)); break;
        case TAB_EQUIPMENT: input.holdKey((char) KeyEvent.VK_F5, random(300, 700)); break;
        case TAB_PRAYER: input.holdKey((char) KeyEvent.VK_F6, random(300, 700)); break;
        case TAB_MAGIC: input.holdKey((char) KeyEvent.VK_F7, random(300, 700)); break;
        case TAB_FRIENDS: input.holdKey((char) KeyEvent.VK_F8, random(300, 700)); break;
        default: openTab(tab); break;
        }
  }
        public void turnCamera() {
                char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
                char[] UD = new char[] { KeyEvent.VK_UP, KeyEvent.VK_DOWN };
                char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
                                KeyEvent.VK_UP, KeyEvent.VK_DOWN };
                int random2 = random(0, 2);
                int random1 = random(0, 2);
                int random4 = random(0, 4);

                if (random(0, 3) == 0) {
                        Bot.getInputManager().pressKey(LR[random1]);
                        try {
                                Thread.sleep(random(100, 400));
                        } catch (Exception e) {}
                        Bot.getInputManager().pressKey(UD[random2]);
                        try {
                                Thread.sleep(random(300, 600));
                        } catch (Exception e) {}
                        Bot.getInputManager().releaseKey(UD[random2]);
                        try {
                                Thread.sleep(random(100, 400));
                        } catch (Exception e) {}
                        Bot.getInputManager().releaseKey(LR[random1]);
                } else {
                        Bot.getInputManager().pressKey(LRUD[random4]);
                        if (random4 > 1) {
                                try {
                                        Thread.sleep(random(300, 600));
                                } catch (Exception e) {}
                        } else {
                                try {
                                        Thread.sleep(random(500, 900));
                                } catch (Exception e) {}
                        }
                        Bot.getInputManager().releaseKey(LRUD[random4]);
                }
        }

        public void rotate() {
                int button = random(37,40);
                Bot.getInputManager().pressKey((char) button);
                wait(random(500, 1500));
                Bot.getInputManager().releaseKey((char) button);

        }
        public void serverMessageRecieved(ServerMessageEvent e) {
                if (e.getMessage().contains("you are dead")) {
                        justDied = true;
                }
        }


  /**  Generic function Pickup arrows.
    *  Pics up arrows...
    *  @author Peec
    */
    public void PickUpArrows(){
        if (getInventoryArray().length >= maxInvCount){
        for(int i = 0; i < ARROW_IDS.length; i++){
            if (CurUsedArrow==ARROW_IDS[i]){
            RSItemTile item = getGroundItemByID(8, ARROW_IDS[i]);
            if (item != null && !getMyPlayer().isMoving()){
                if (!getMyPlayer().isInCombat()){
                    if (distanceTo(item) > 8) {
                        walkTileMM(item);
                    }
                      wait(random(300,600));
                      atTile(item, "Take");
                }
            }
            }
        }
        }else{
            log("You selected pick up arrows, but inventory is full of stuff. Maybe put somthing in bank ? :)");
        }
    }

    public boolean CheckEQarrows(){
        boolean interal_error=true;
        for(int i = 0; i < ARROW_IDS.length; i++){
            if (!equipmentContains(ARROW_IDS[i])){
                if (CurUsedArrow==0){
                    interal_error=true;
                    log("You have no arrows equipped... We do not know what to use.... Please Equip arrows of wanted type before starting bot.");
                }else if (inventoryContains(ARROW_IDS[i]) && CurUsedArrow==ARROW_IDS[i]){
                    atInventoryItem(ARROW_IDS[i],"Wield");
                    interal_error=false;
                }
            }else{
                CurUsedArrow = ARROW_IDS[i];
                if (getInventoryCount(ARROW_IDS[i]) > random(90,140) && equipmentContains(ARROW_IDS[i])){
                    atInventoryItem(ARROW_IDS[i],"Wield");
                }
                interal_error=false;
            }
        }
        if (interal_error){
            errorlvl++;
            log("Found no arrows of my type in inventory...");
            return false;
        }
        return true;
    }

    /**  Generic function for pulling items form bank with cordinates.
      *  Created because of bank.widraw() is deprecated.
      *  @author Peec
      */
    public boolean getItemFromBankByCord(int x, int y, int amount){
        boolean ok=false;
        if (bank.getInterface().isValid()) {
            switch(amount){
                case 1:
                    clickMouse(x, y, true);
                    wait(random(1000,3000));
                    ok=true;
                break;
                case 5:
                    clickMouse(x, y, false);
                    wait(random(1000,3000));
                    atMenu("Withraw-5");
                    ok=true;
                break;
                case 10:
                    clickMouse(x, y, false);
                    wait(random(1000,3000));
                    atMenu("Withraw-10");
                    ok=true;
                break;
                default:
                      clickMouse(x, y, false);
                      wait(random(1000,3000));
                      if (amount >= maxInvCount){
                          atMenu("Withdraw-All");
                          ok=true;
                      }else{
                          wait(random(700,1000));
                          atMenu("Withdraw-X");
                          wait(random(700,2000));
                          // This is  pretty messy eh, php str_split is more user friendly ( :-) ).. But here we go..
                          // What we are doing here is to Split int and type one and one letter....
                          String keysString = Integer.toString(amount);
                          char[] keysChar = keysString.toCharArray();
                          int[] keyArray = new int[keysChar.length];

                          for (int i=0; i < keyArray.length; i++){
                              int keyindex = Integer.parseInt(String.valueOf(keysChar[i]));
                              Bot.getInputManager().sendKey(keys[keyindex]);
                              wait(random(50,200));

                          }
                          wait(random(200,600));

                          Bot.getInputManager().sendKey((char) KeyEvent.VK_ENTER);
                          ok=true;
                      }
                break;
            }
            if (ok)return true;
            else return false;
        }
        log("Called getItemFromBankByCord() , but no bank interface aviable..");
        return false;
    }


}


Lust 11-16-2008 11:52 AM

Nice, code the script though so the emotes don't get in the way pleasee.

EndOfStory? 11-16-2008 12:10 PM

Ofc, didn't notice ;)

Lust 11-16-2008 12:13 PM

There are two chicken places in Lumbridge, which one?

EndOfStory? 11-16-2008 12:56 PM

The east one; opposite the cow field.

Lust 11-16-2008 12:59 PM

thank you very much

ICaldoMafiaIRB 11-17-2008 01:47 PM

This is for both of you to use ? Ha.


All times are GMT -8. The time now is 10:34 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.