Guest User

Untitled

a guest
Dec 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.85 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.util.Random;
  4.  
  5. import org.tribot.api.Banking;
  6. import org.tribot.api.Clicking;
  7. import org.tribot.api.Game;
  8. import org.tribot.api.Inventory;
  9. import org.tribot.api.ScreenModels;
  10. import org.tribot.api.Textures;
  11. import org.tribot.api.Timing;
  12. import org.tribot.api.input.Mouse;
  13. import org.tribot.api.types.InventoryItem;
  14. import org.tribot.api.types.ScreenModel;
  15. import org.tribot.api.types.Texture;
  16. import org.tribot.script.Script;
  17. import org.tribot.script.ScriptManifest;
  18.  
  19. @ScriptManifest(authors = { "iRoc" }, category = "Herblore", name = "Iroc's Herblore")
  20. public class iRocHerblore extends Script {
  21.  
  22.     int grimyHerb = 628267;
  23.     int cleanHerb = 656168;
  24.     // int spirit = 434763;
  25.  
  26.     // int unfPot = 428282;
  27.     // int vialWater = 428867;
  28.  
  29.     final Random random = new Random();
  30.     int randomize = 5;
  31.  
  32.     int[] row = { 580, 625, 665, 705 };
  33.     int[] coll = { 278, 315, 350, 385, 425, 460, 495 };
  34.  
  35.     int herbCleaned;
  36.     int depositAllTextureId = 39493;
  37.  
  38.     long cwBank = 2550191772L;
  39.  
  40.     String grimyGuam = "Grimy guam";
  41.     String grimyMarrantill = "Grimy marrentill";
  42.     String grimyTarromin = "Grimy tarromin";
  43.     String grimyHarralander = "Grimy Harralander";
  44.     String grimyRanarr = "Grimy ranarr";
  45.     String grimyToadflax = "Grimy toadflax";
  46.     String grimySpiritweed = "Grimy spirit weed";
  47.     String grimyIrit = "Grimy irit";
  48.     String grimyWergali = "Grimy wegali";
  49.     String grimyAvantoe = "Grimy avantoe";
  50.     String grimyKwuarm = "Grimy kwuarm";
  51.     String grimySnapdragon = "Grimy snapdragon";
  52.     String grimyCadantine = "Grimy cadantine";
  53.     String grimyLantadyme = "Grimy lantadyme";
  54.     String grimyDwarfweed = "grimy dwarf weed";
  55.     String grimyTorstol = "Grimy torstol";
  56.  
  57.     String herb = grimyTarromin;
  58.  
  59.     public int random(int r) {
  60.         int rn = random.nextInt(r);
  61.         return rn;
  62.     }
  63.  
  64.     public void run() {
  65.         for (;;) {
  66.             if (Inventory.find(cleanHerb).length > 0
  67.                     || Inventory.getAll().length >= 0) {
  68.                 bank();
  69.             }
  70.             if (Inventory.find(grimyHerb).length > 0) {
  71.                 cleanReverse();
  72.                 println(herbCleaned);
  73.             }
  74.         }
  75.     }
  76.  
  77.     public void bank() {
  78.         ScreenModel[] bankSM = ScreenModels.find(cwBank);
  79.         if (bankSM != null) {
  80.             Clicking.click("Bank", bankSM);
  81.             sleep(1500, 2000);
  82.             if (Inventory.getAll().length > 0) {
  83.                 Texture[] text = Textures.find(depositAllTextureId);
  84.                 Clicking.click(text);
  85.                 sleep(1000, 1200);
  86.             }
  87.             if (Inventory.getAll().length == 0) {
  88.                 Mouse.move(55 + random(5), 160 + random(5));
  89.                 while (!Game.isUptext(herb)) {
  90.                     sleep(250, 300);
  91.                 }
  92.                 if (Game.isUptext(herb)) {
  93.                     Mouse.click(3);
  94.                     Timing.waitChooseOption("Withdraw-All", 1000);
  95.                     sleep(500, 600);
  96.                 }
  97.  
  98.             }
  99.             Banking.closeBankScreen();
  100.             sleep(500, 600);
  101.  
  102.         }
  103.     }
  104.  
  105.     public void cleanForward() {
  106.         clickRow(row[0], row[1], row[2], row[3], coll[0]);
  107.         clickRow(row[3], row[2], row[1], row[0], coll[1]);
  108.         clickRow(row[0], row[1], row[2], row[3], coll[2]);
  109.         clickRow(row[3], row[2], row[1], row[0], coll[3]);
  110.         clickRow(row[0], row[1], row[2], row[3], coll[4]);
  111.         clickRow(row[3], row[2], row[1], row[0], coll[5]);
  112.         clickRow(row[0], row[1], row[2], row[3], coll[6]);
  113.  
  114.         InventoryItem[] herb = Inventory.find(cleanHerb);
  115.         herbCleaned = herbCleaned + herb.length;
  116.     }
  117.  
  118.     public void cleanReverse() {
  119.         clickRow(row[3], row[2], row[1], row[0], coll[6]);
  120.         clickRow(row[0], row[1], row[2], row[3], coll[5]);
  121.         clickRow(row[3], row[2], row[1], row[0], coll[4]);
  122.         clickRow(row[0], row[1], row[2], row[3], coll[3]);
  123.         clickRow(row[3], row[2], row[1], row[0], coll[2]);
  124.         clickRow(row[0], row[1], row[2], row[3], coll[1]);
  125.         clickRow(row[3], row[2], row[1], row[0], coll[0]);
  126.  
  127.         InventoryItem[] herb = Inventory.find(cleanHerb);
  128.         herbCleaned = herbCleaned + herb.length;
  129.     }
  130.  
  131.     public void cleanSnake() {
  132.         clickColumn(row[3], coll[0], coll[1], coll[2], coll[3], coll[4],
  133.                 coll[5], coll[6]);
  134.         clickColumn(row[2], coll[6], coll[5], coll[4], coll[3], coll[2],
  135.                 coll[1], coll[0]);
  136.         clickColumn(row[1], coll[0], coll[1], coll[2], coll[3], coll[4],
  137.                 coll[5], coll[6]);
  138.         clickColumn(row[0], coll[6], coll[5], coll[4], coll[3], coll[2],
  139.                 coll[1], coll[0]);
  140.         InventoryItem[] herb = Inventory.find(cleanHerb);
  141.         herbCleaned = herbCleaned + herb.length;
  142.     }
  143.  
  144.     public void cleanSnakeReverse() {
  145.         clickColumn(row[0], coll[0], coll[1], coll[2], coll[3], coll[4],
  146.                 coll[5], coll[6]);
  147.         clickColumn(row[1], coll[6], coll[5], coll[4], coll[3], coll[2],
  148.                 coll[1], coll[0]);
  149.         clickColumn(row[2], coll[0], coll[1], coll[2], coll[3], coll[4],
  150.                 coll[5], coll[6]);
  151.         clickColumn(row[3], coll[6], coll[5], coll[4], coll[3], coll[2],
  152.                 coll[1], coll[0]);
  153.         InventoryItem[] herb = Inventory.find(cleanHerb);
  154.         herbCleaned = herbCleaned + herb.length;
  155.     }
  156.  
  157.     public void clickSlot(int x, int y) {
  158.         Mouse.move(x - random(randomize), y - random(randomize));
  159.         Mouse.click(1);
  160.     }
  161.  
  162.     public void clickColumn(int x, int ay, int by, int cy, int dy, int ey,
  163.             int fy, int gy) {
  164.         Mouse.move(x + random(randomize), ay + random(randomize));
  165.         Mouse.click(1);
  166.         Mouse.move(x + random(randomize), by + random(randomize));
  167.         Mouse.click(1);
  168.         Mouse.move(x + random(randomize), cy + random(randomize));
  169.         Mouse.click(1);
  170.         Mouse.move(x + random(randomize), dy + random(randomize));
  171.         Mouse.click(1);
  172.         Mouse.move(x + random(randomize), ey + random(randomize));
  173.         Mouse.click(1);
  174.         Mouse.move(x + random(randomize), fy + random(randomize));
  175.         Mouse.click(1);
  176.         Mouse.move(x + random(randomize), gy + random(randomize));
  177.         Mouse.click(1);
  178.  
  179.     }
  180.  
  181.     public void clickRow(int ax, int bx, int cx, int dx, int y) {
  182.         Mouse.move(ax + random(randomize), y + random(randomize));
  183.         Mouse.click(1);
  184.         Mouse.move(bx + random(randomize), y + random(randomize));
  185.         Mouse.click(1);
  186.         Mouse.move(cx + random(randomize), y + random(randomize));
  187.         Mouse.click(1);
  188.         Mouse.move(dx + random(randomize), y + random(randomize));
  189.         Mouse.click(1);
  190.     }
  191.  
  192. }
Add Comment
Please, Sign In to add comment