Mine sisusse
Otsi siit
  • Rohkem valikuid...
Otsi tulemusi mis sisaldab...
Otsi tulemusi...
Jälgi teemat sisse logides  

Text to script

Soovitatud postitused

VIP

Kuidas ma muudan jutu scriptiks?

 

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

public class AlkharidUltimateMiner extends Script implements PaintListener {

   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(14) - startXP;
     int LevelChange = skills.getCurrentSkillLevel(14) - startLevel;
      g.setColor(Color.black);
      g.drawString("Banked " + Integer.toString(oreBanked) + " ores and " + Integer.toString(gemsBanked) + " gems.", 200, 365);
           g.drawString("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", 200, 380);
           g.drawString("Current: " + skills.getCurrentSkillLevel(14) + " levels and " + skills.getCurrentSkillExp(14) + " exp.", 200, 395);
           g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " exp.", 200, 410);
           g.drawString(skills.getXPToNextLevel(14) + " XP to next level, we are " + skills.getPercentToNextLevel(14) + "% to next level.", 200, 425);
       }
   }

   public static final RSTile[] toMine = new RSTile [] {
       new RSTile(3277, 3175), new RSTile(3281, 3190),
       new RSTile(3282, 3205), new RSTile(3291, 3217),
       new RSTile(3294, 3232), new RSTile(3294, 3247),
       new RSTile(3294, 3261), new RSTile(3295, 3276),
       new RSTile(3299, 3287) };

   public static final RSTile[] toStartMine = new RSTile[] {
       new RSTile(3299, 3301), new RSTile(3299, 3292) };

   public RSTile[] toBank = reversePath(toMine);

   public RSTile[] toEndMine = reversePath(toStartMine);

   public static final int[] tinRockTypes = new int[] { 11933 };

   public static final int[] copperRockTypes = new int[] { 11936, 11937, 11938 };

   public static final int[] ironRockTypes = new int[] { 37307, 37308, 37309 };

   public static final int[] silverRockTypes = new int[] { 37304, 37305, 37306 };

   public static final int[] coalRockTypes = new int[] { 11930, 11932 };

   public static final int[] goldRockTypes = new int[] { 37310, 37312 };

   public static final int[] mithrilRockTypes = new int[] { 11942, 11944 };

   public static final int[] adamantiteRockTypes = new int[] { 11939, 11941 };

   public static final int[] pickaxeTypes = new int[] { 1275, 1265, 1269, 1267, 1273, 1271 };

   public static final int[] bankBooths = new int[] { 35647 };

   public static final int[] dropThis = new int[] { 438, 436, 440, 442, 453, 444, 447, 449 };

   public static final int[] oreTypes = new int[] { 438, 436, 440, 442, 453, 444, 447, 449 };

   public static final int[] gemTypes = new int[] { 1617, 1619, 1621, 1623 };

   public static final int[] smokingRocks = new int[] { 11177, 11178, 11179, 11180, 11181, 11182 };

   public static final int[] pickaxeHeads = new int[] { 480, 482, 484, 486, 488, 490 };

   public static final int[] emptyRocks = new int[] { 11552, 11553, 11554 };

   public int startLevel = 0;
   public int startXP = 0;
   int mineWhat = -1;
   int progress = 0;
   int copOrTin = 1;
   public int oreBanked = 0;
   public int gemsBanked = 0;
   int oreCount = 0;
   int gemCount = 0;
   public long startTime = System.currentTimeMillis();
   boolean powerMine, wearPickaxe;

   public long time = System.currentTimeMillis();
   int randomTime = random(0, 20000);

   public double getVersion() {

       return 1.0;

   }

   public String getScriptCategory() {

       return "Mining";

   }

   public String getName() {

       return "Alkharid Ultimate Miner";

   }

   public String getAuthor() {

       return "Andrew_b";

   }

   public boolean onStart(Map args) {

       log("Alkharid Ultimate Miner Started. Made by Andrew_b.");

       if (args.get("wear").equals("yes")) {
           wearPickaxe = true;
       } else {
           wearPickaxe = false;
       }

       mineWhat = whatToMine(args.get("what"));

       if (args.get("how").equals("power")) {
           powerMine = true;
       } else {
           powerMine = false;
       }

       oreBanked = 0;
       gemsBanked = 0;
       startTime = System.currentTimeMillis();
       if (isLoggedIn()) {
           startLevel = skills.getCurrentSkillLevel(14);
           startXP = skills.getCurrentSkillExp(14);
       }

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

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

   public int loop() {
       try{
       if (isLoggedIn() && startLevel == 0) {
           startLevel = skills.getCurrentSkillLevel(14);
           startXP = skills.getCurrentSkillExp(14);
       }
       if (doingSomething()) {
           antiBan();
           return random(500, 1000);
       }
       switch (progress) {
           case 0:

               if (distanceTo(toMine[0])                     progress = 2;
                   return random(500, 750);
               }
               if (isInventoryFull() && !powerMine) {
                   progress++;
                   setRun(true);
                   return random(1000, 1500);
               } else if (isInventoryFull() && powerMine) {
                   dropOre();
               }
               if (getMyPlayer().isInCombat() && !getMyPlayer().isMoving()) {
                   runAway();
                   return random(400, 700);
               }
               if (findObject(smokingRocks) == null) {
                   if (getMyPlayer().getAnimation() == 625 || getMyPlayer().getAnimation() == 624 || getMyPlayer().isMoving()) {
                       return random(350, 500);
                   }
               }
               if (!tool()) {
                   if ((inventoryContains(466) || equipmentContains(466)) && getGroundItemByID(15, pickaxeHeads) != null) {
                       RSItemTile item = getGroundItemByID(20, pickaxeHeads);
                       if (item != null && !getMyPlayer().isMoving()) {
                           if (distanceTo(item) > 8) {
                               walkTileMM(item);
                               return random(1000, 2000);
                           }
                       atTile(item, "Take");
                       return random(500, 1000);
                       }
                   } else if (equipmentContains(466) && inventoryContainsOneOf(pickaxeHeads)) {
                       if (getCurrentTab() == TAB_EQUIPMENT) {
                           clickMouse(575, 300, 25, 15, true);
                           wait(random(1000, 2000));
                       } else {
                           openTab(TAB_EQUIPMENT);
                       }
                       return random(1000, 2000);
                   } else if (inventoryContains(466) && inventoryContainsOneOf(pickaxeHeads)) {
                       useItem(getInventoryItemByID(pickaxeHeads), getInventoryItemByID (466));
                       return random(1000, 2000);
                   } else {
                       log("No pickaxe");
                       progress++;
                       return random(300, 500);
                   }
               }
               if (wearPickaxe) {
                   for (int element : pickaxeTypes) {
                       if (inventoryContains(element)) {
                           atInventoryItem(element, "Wield");
                       }
                   }
               }
               mine();
               return random(500, 750);
           case 1:
               if (getMyPlayer().isMoving()) {
                   return random(250, 500);
               }
               if (distanceTo(toBank[toBank.length - 1])                     progress++;
                   return random(500, 750);
               }
               if (distanceTo(findObject(adamantiteRockTypes))                     walkPathMM(randomizePath(toStartMine, 2, 2), 15);
                   return random(3500, 4000);
               }
               walkPathMM(randomizePath(toBank, 2, 2), 15);
               return random(3500, 4000);
           case 2:
               RSObject bankBooth = findObject(bankBooths);
               if (distanceTo(bankBooth.getLocation()) > 5) {
                   walkTileMM(bankBooth.getLocation());
                   return random(500, 750);
               }
               if (!bank.getInterface().isValid()) {
                   atObject(bankBooth, "Use-quickly");
                   return random(1500, 1750);
               }
               if (oreCount == 0) {
                   oreCount = getInventoryCount(oreTypes);
               }
               if (gemCount == 0) {
                   gemCount = getInventoryCount(gemTypes);
               }
               bank.depositAllExcept(pickaxeTypes);
               checkForTool();
               if (!isInventoryFull() && tool()) {
                   oreBanked += oreCount;
                   oreCount = 0;
                   gemsBanked += gemCount;
                   gemCount = 0;
                   progress++;
                   if (copOrTin == 1) {
                       copOrTin = 2;
                   } else if (copOrTin  == 2) {
                       copOrTin = 1;
                   }
               }
               bank.close();
               return random(500, 750);
           case 3:
               if (getMyPlayer().isMoving()) {
                   return random(250, 500);
               }
               if (distanceTo(toBank[0])                     progress = 0;
                   return random(500, 750);
               }
               walkPathMM(randomizePath(toMine, 2, 2), 15);
               return random(3500, 4000);
       }
       }catch(Exception e){
       log("An exception has occurred. That's odd.");
       }
       return 0;
   }

   public int whatToMine(String rockName) {
       if (rockName.contains("copper")) {
           return 1;
       }
       if (rockName.contains("tin")) {
           return 2;
       }
       if (rockName.contains("both")) {
           return 3;
       }
       if (rockName.contains("iron")) {
           return 4;
       }
       if (rockName.contains("silver")) {
           return 5;
       }
       if (rockName.contains("coal")) {
           return 6;
       }
       if (rockName.contains("gold")) {
           return 7;
       }
       if (rockName.contains("mithril")) {
           return 8;
       }
       if (rockName.contains("adamantite")) {
           return 9;
       }
       log("To use this script give arguments tin, copper, clay, gold, iron to know what to mine or both to mine tin and copper and power or bank and are should pickaxe be worn no or yes like \"bank,iron,no\"");
       return -1;
   }

   public int doWePower(String howToMine) {
       if (howToMine.contains("p")) // Same as above but for p as in power or b as in bank
       {
           return 1;
       } else if (howToMine.contains("b")) {
           return 2;
       } else {
           log("To use this script give arguments tin, copper, clay, gold, iron to know what to mine or both to mine tin and copper and power or bank and are should pickaxe be worn no or yes like \"bank,iron,no\"");
           return 0;
       }
   }

   public void dropOre() { // Dropping items that are set on dropThis array
       boolean drop = false;
       for (int I = 0; I             for (int element : dropThis) {
               if (element == getInventoryItems()[i].getID()) {
                   drop = true;
               }
           }
           if (drop) {
               atInventoryItem(getInventoryItems()[i].getID(), "Drop");
               wait(random(1000, 2000));
               drop = false;
           }
       }
   }

   public void runAway() { // running away and running back after a while
       RSTile foo, bar;
       foo = getMyPlayer().getLocation();
       setRun(true);

       bar = new RSTile(foo.getX() + random(8, 10), foo.getY() + random(8, 10));

       walkTileMM(bar);
       while (getMyPlayer().isMoving()) {
           wait(random(2000, 4000));
       }
       wait(random(1000, 2000));
       walkTileMM(foo);
   }

   public void mine() {
       RSObject obj = null;
       switch (mineWhat) {
           case 1:
               obj = findObject(copperRockTypes);// find object by rockTypes
               break;
           case 2:
               obj = findObject(tinRockTypes);// find object by rockTypes
               break;
           case 3:
               if (copOrTin == 1) {
                   obj = findObject(tinRockTypes);// find object by rockTypes
               } else if (copOrTin == 2) {
                   obj = findObject(copperRockTypes);// find object by
                   // rockTypes
               }
               break;
           case 4:
               obj = findObject(ironRockTypes);// find object by rockTypes
               break;
           case 5:
               if (findObject(smokingRocks) == null) {
                   obj = findObject(silverRockTypes);// find object by rockTypes
               } else {
                   walkTileMM(getMyPlayer().getLocation());
                   wait(random(4000, 6000));
               }
               break;
           case 6:
               obj = findObject(coalRockTypes);
               break;
           case 7:
               obj = findObject(goldRockTypes);
               break;
           case 8:
               obj = findObject(mithrilRockTypes);
               break;
           case 9:
               obj = findObject(adamantiteRockTypes);
               break;
           default:
               log("Doesn't know what to mine!?!? This is a big problem");
               break;
       }

       if (obj == null || distanceTo(obj.getLocation()) > 25) {
           walkPathMM(randomizePath(toEndMine, 2, 2), 15);
           if (mineWhat != 5) {
               if (distanceTo(findObject(emptyRocks)) > 20) {
                   log("I seem to believe that you aren't at a mining spot. Sad...");
               }
           } else {
               if (System.currentTimeMillis() - time > 30000 + randomTime) {
                   int oldTab = getCurrentTab();
                   int tempNumber = random(0, 13);
                   time = System.currentTimeMillis();
                   randomTime = random(0, 20000);
                   while (oldTab == getCurrentTab()) {
                       if (getCurrentTab() == tempNumber) {
                           tempNumber = random(0, 13);
                       } else {
                           openTab(tempNumber);
                       }
                   }
               }
           }
       } else if (distanceTo(obj.getLocation()) > 3) {
           walkTileMM(obj.getLocation()); // This was done because the walktile misses alittle
       } else {
           atObject(obj, "Mine");
           if (mineWhat == 5) {
               time = System.currentTimeMillis();
               randomTime = random(0, 20000);
           }
       }
   }

   public void checkForTool() {
       boolean tool = tool();
       int I, j = 0;
       if (!tool) {
           for (I = 0; I                 for (j = 0; j                     if (bank.getItemArray()[i] == pickaxeTypes[j]) {
                       bank.atItem(pickaxeTypes[j], "Withdraw 1");
                       tool = true;
                   }
                   if (tool) {
                       break;
                   }
               }
               if (tool) {
                   break;
               }
           }
       }
   }

   public boolean tool() {
       for (int element : pickaxeTypes) {
           if (inventoryContains(element) || equipmentContains(element)) {
               return true;
           }
       }
       return false;
   }

   //**** Anti Ban Code ****//

   public boolean doingSomething() {
       if (getMyPlayer().getAnimation() != -1) {
           return true;
       }

       return false;

   }

   public void antiBan() {
       int guess = random(1, 4);
       if (guess == 1) {
           int ix = random(0, 750);
           int iy = random(0, 500);
           moveMouse(0, 0, ix, iy);

       }

       if (guess == 2) {
           wait(random(500, 750));

       }

       if (guess == 3) {
           wait(random(100, 500));

       }

       if (guess == 4) {
           randomCamera();

       }

   }

   public int x() { // Random int
           return random(-10, 10);
   }

   public int y() { // Random int
       return random(-1, 1);
   }

   public void randomCamera() {
       int r = random(0, 359);
       setCameraRotation(r);

   }

   //**** Anti Ban Code ****//    

   public String getScriptDescription() {
       return"\n" + "\n" + "\n" + "[align=center]"
           + ""
           + getName()
           + ""
           + "[/align]\n"
           + "[b]Author:[/b] "
           + getAuthor()
           + "
"
           + "[b]Version:[/b] "
           + getVersion()
           + "
"
           + "[b]Features:[/b]"
           + "[*]Bank or Power"
           + "[*]Ability to Mine All Ores"
           + "[*]Anti-Ban"
           + "[*]Anti-Combat"
           + "[*]Shows ores mined and runtime."
           + "[b]Arguments[b]
"
           + "Bank: "
           + "Power:
"
           +

           "Copper: "
           + "Tin: "
           + "Copper & Tin: "
           + "Iron: "
           + "Silver: "
           + "Coal: "
           + "Gold: "
           + "Mithril: "
           + "Adamantite:
"
           +

           "Wear pickaxe? Yes:   No:"
           +

               "\n" + "";
  }

}


Sander_Ploompuu@hotmail.com

Jaga seda postitust


Postituse link
Share on other sites

jap :)

JA ÄRA SALVESTA NIMI.JAVA.TXT!!!!

 

nime saad (see Paksult :))

 

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

public class [b]AlkharidUltimateMiner[/b] extends Script implements PaintListener {

   public void onRepaint(Graphics g) {
       if (isLoggedIn()) {
     long millis = System.currentTimeMillis() - startTime;
     long hours = millis / (1000 * 60 * 60);
     millis -= hours * 1000 * 60 * 60;


gamefr34ker.png

panda.jpg

RsBot Helper

X-Fire: daddystrikes

Peab Olema TeamViewer, Muidu Ei Aita

http://www.TeamViewer.com

MSN: [email:1k3vtx1m]Hansik007@hotmail.com[/email:1k3vtx1m]

Just Got Respected!

Jaga seda postitust


Postituse link
Share on other sites
VIP
Author of the topic Postitas

Lukku,Daddy aitas.:P


Sander_Ploompuu@hotmail.com

Jaga seda postitust


Postituse link
Share on other sites

Kommentaari lisamiseks loo konto või logi sisse

Kommenteerimiseks peate olema liige

Loo konto

Liituge meie kommuuni uue kontoga. See on lihtne!

Loo uus konto

Logi sisse

On juba konto? Logi sisse siit.

Logi sisse nüüd
Jälgi teemat sisse logides  

×
×
  • Loo uus...

Oluline informatsioon

Selle veebisaidi paremaks muutmiseks oleme teie seadmesse paigutanud küpsised . Võite kohandada oma küpsiste seadeid , vastasel juhul eeldame, et te olete küpsiste kasutamisega nõus kui jätkate veebisaidil sirvimist.. Palun lugege läbi Kasutustingimused ja Privaatsuspoliitika.