Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Point;
- import java.util.ArrayList;
- import java.util.LinkedList;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.wrappers.*;
- import java.awt.event.KeyEvent; //Antiban
- import java.awt.event.KeyListener;
- import org.rsbot.script.methods.*;
- import org.rsbot.script.methods.Game.CHAT_MODE;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.UIManager.LookAndFeelInfo;
- @ScriptManifest(authors = "Delano_D & Doout", name = "Badass Summoner", version = 1.1, description = "Start In fallador with Opened bank. Uses Fala Tab. (INV)")
- public class BadassSumm extends Script implements PaintListener {
- AntiBan ab = new AntiBan();
- ArrayList<Pouch> pouch = new ArrayList<Pouch>();
- public boolean showPaint = false;
- public long runTime = 0, seconds = 0, minutes = 0, hours = 0;
- public int gainedExp = 0;
- public int expToLevel = 0;
- public long secToLevel = 0;
- public long minutesToLevel = 0;
- public long hoursToLevel = 0;
- private long startTime;
- private int startExp;
- private int startLevel;
- public float secExp = 0;
- public float minuteExp = 0;
- public float hourExp = 0;
- public String status;
- private static int PLACE;
- private static int CHARM;
- private static int ITEM_ID;
- private static boolean isUp = true;
- private static RSTile[] toT = new RSTile[] { new RSTile(2952, 3381)
- private static RSTile[] toT = new RSTile[] { new RSTile(2946, 3369), new RSTile(2948, 3375), new RSTile(2952, 3381),[FONT=monospace]
- [/FONT]new RSTile(2964, 3386), new RSTile(2962, 3398),[FONT=monospace]
- [/FONT] new RSTile(2960, 3411), new RSTile(2954, 3420),[FONT=monospace]
- [/FONT]new RSTile(2950, 3432), new RSTile(2947, 3444),[FONT=monospace]
- [/FONT]new RSTile(2937, 3451), new RSTile(2931, 3450),[FONT=monospace]
- [/FONT]new RSTile(2924, 3444), new RSTile(2925, 3444) }; //runescape tiles, might add more.
- private static RSPath path;
- public boolean onStart() {
- try {
- JFrame.setDefaultLookAndFeelDecorated(true);
- for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (Exception e) {
- log.severe("Fail to setLookAndFeel");
- }
- AddPouch();
- new GUISum().setVisible(true);
- while (isUp)
- sleep(50);
- path = walking.newTilePath(toT); //fix to only walk to sum, might be ();
- showPaint = true;
- return true;
- }
- //Working on the Antiban here, It's not finished yet i think, will be done @ Version 1.5
- public class AntiBan {
- private int [] Locations = {1 , 2, 3}; //set locations here
- // COLORS
- private int WHITE = 35;
- private int GREEN = 37;
- private int AMBER = 39;
- private int RED = 41;
- private int NONE = 53;
- // ANIMATIONS
- private int YES = 2;
- private int NO = 3;
- private int BOW = 4;
- private int ANGRY = 5;
- private int THINK = 6;
- private int WAVE = 7;
- private int SHRUG = 8;
- private int CHEER = 9;
- private int BECKON = 10;
- private int JUMP_FOR_JOY = 11;
- private int LAUGH = 12;
- private int YAWN = 13;
- private int DANCE = 14;
- private int JIG = 15;
- private int TWIRL = 16;
- private int HEADBANG = 17;
- private int CRY = 18;
- private int BLOW_KISS = 19;
- private int PANIC = 20;
- private int RASPBERRY = 20;
- private int CLAP = 22;
- private int SALUTE = 23;
- private int GOBLIN_BOW = 24;
- private int GOBLIN_SALUTE = 25;
- private int GLASS_BOX = 25;
- private int CLIMB_ROPE = 26;
- private int LEAN = 28;
- private int GLASS_WALL = 29;
- private int IDEA = 33;
- private int STOMP = 31;
- private int FLAP = 32;
- private int SLAP_HEAD = 30;
- private int ZOMBIE_WALK = 34;
- private int ZOMBIE_DANCE = 35;
- private int ZOMBIE_HAND = 36;
- private int SCARED = 37;
- private int BUNNY_HOP = 38;
- private int SKILLCAPE = 39;
- private int SNOWMAN_DANCE = 40;
- private int AIR_GUITAR = 41;
- private int SAFETY_FIRST = 42;
- private int EXPLORE = 43;
- private int TRICK = 44;
- private int FREEZE = 45;
- private int GIVE_THANKS = 46;
- private int AROUND_THE_WORLD_IN_EGGTY_DAYS = 47;
- private int DRAMATIC_POINT = 48;
- private int FAINT = 49;
- private int PUPPET_MASTER = 50;
- private int TASKMASTER = 51;
- private int SEAL_OF_APPROVAL = 52;
- private void checkXP(int Skill) { //build in anitban.
- if(game.getCurrentTab() != Game.TAB_STATS){
- game.openTab(game.TAB_STATS);
- skills.doHover(Skill);
- } else {
- skills.doHover(Skill);
- }
- }
- private void moveMouseOffScreen(int Time){
- mouse.moveOffScreen();
- sleep(Time);
- }
- private void setRunning(int Energy){
- if(!walking.isRunEnabled() && walking.getEnergy() >= Energy){
- walking.setRun(true);
- moveMouseRandomly(Locations);
- }
- }
- private void moveMouseRandomly(int[] location){
- switch(location.length){
- case 0: // chatBox
- mouse.move(random(4, 327), random(528, 483));
- break;
- case 2: // Screen
- mouse.move(random(3, 0), random(525, 352));
- break;
- case 3: //Minimap
- mouse.move(random(521, 0), random(760, 170));
- break;
- case 4: //inventory
- mouse.move(random(527, 200), random(744, 464));
- }
- }
- private void moveCameraToLeft(int minTime, int maxTime){
- keyboard.pressKey((char)KeyEvent.VK_LEFT);
- sleep(random(minTime, maxTime));
- keyboard.releaseKey((char)KeyEvent.VK_LEFT);
- }
- private void moveCameraToRight(int minTime, int maxTime){
- keyboard.pressKey((char)KeyEvent.VK_RIGHT);
- sleep(random(minTime, maxTime));
- keyboard.releaseKey((char)KeyEvent.VK_RIGHT);
- }
- private void moveCameraRandomly() {
- switch(random(0,3)) {
- case 0:
- moveCameraToLeft(750, 1000);
- camera.setPitch(random(30, 120));
- sleep(50, 100);
- break;
- case 1:
- moveCameraToRight(1000, 2500);
- camera.setPitch(random(30, 120));
- sleep(50, 100);
- break;
- }
- }
- private void addNote(String Text){
- RSInterface Notes = interfaces.get(34);
- if(game.getCurrentTab() != game.TAB_NOTES){
- game.openTab(game.TAB_NOTES);
- return;
- } else {
- mouse.click(Notes.getComponent(3).getLocation(), true);
- sleep(600, 800);
- keyboard.sendText(Text, true);
- }
- }
- private void deleteNote(String Text){
- RSInterface Notes = interfaces.get(34);
- if(game.getCurrentTab() != game.TAB_NOTES){
- game.openTab(game.TAB_NOTES);
- return;
- } else {
- for(int i = 0; i <= 30; i++){
- try {
- if(Notes.getComponent(9).getComponent(i).getText().equals(Text)){
- mouse.click(Notes.getComponent(9).getComponent(i).getLocation(), true);
- mouse.click(Notes.getComponent(8).getLocation(), true);
- } else {
- i++;
- }
- } catch(Exception e){}
- }
- }
- }
- private void setNoteColor(String Text, int Color){
- RSInterface Notes = interfaces.get(34);
- if(game.getCurrentTab() != game.TAB_NOTES){
- game.openTab(game.TAB_NOTES);
- return;
- } else {
- for(int i = 0; i <= 30; i++){
- try {
- if(Notes.getComponent(9).getComponent(i).getText().equals(Text)){
- mouse.click(Notes.getComponent(9).getComponent(i).getLocation(), false);
- Notes.getComponent(9).doAction("Colour");
- sleep(200, 500);
- mouse.click(Notes.getComponent(Color).getLocation(), true);
- } else {
- i++;
- }
- } catch(Exception e){}
- }
- }
- }
- private boolean isInScrollableArea(final int xMax, final int xMin, final int yMax, final int yMin, final int cmpID) {
- RSComponent rsc = interfaces.get(464).getComponent(cmpID);
- final int x = (int) rsc.getLocation().getX();
- final int y = (int) rsc.getLocation().getY();
- if(x >= xMin && x <= xMax && y >= yMin && y <= yMax) {
- return true;
- } else return false;
- }
- private void doEmote(int Emote){
- RSComponent rsc = interfaces.get(464).getComponent(Emote);
- int State = 0;
- boolean State1 = isInScrollableArea(735, 547, 413, 206, 2);
- boolean State2 = isInScrollableArea(735, 547, 413, 206, 28);
- boolean State3 = isInScrollableArea(735, 547, 413, 206, 52);
- mouse.click(interfaces.get(548).getComponent(103).getLocation(), true);
- if(State1 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
- rsc.doClick();
- } else {
- mouse.moveSlightly();
- mouse.click(new Point(728, 265), true);
- mouse.drag(new Point(728, 334));
- }
- if(State2 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
- rsc.doClick();
- } else {
- mouse.moveSlightly();
- mouse.click(new Point(728, 334), true);
- mouse.drag(new Point(728, 406));
- }
- if(State2 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
- rsc.doClick();
- } else {
- mouse.moveSlightly();
- mouse.click(new Point(728, 261), true);
- }
- }
- private void setMode(int chooseOption, CHAT_MODE setMode){
- switch(chooseOption){
- case 1: // setPublicMode
- game.setPublicChat(setMode);
- break;
- case 2:// setTradeMode
- game.setTradeMode(setMode);
- break;
- case 3:// setPrivateMode
- game.setPrivateChat(setMode);
- break;
- case 4: //setClanMode
- game.setClanMode(setMode);
- case 5:// setAssistMode
- game.setAssistMode(setMode);
- break;
- }
- }
- }
- private final Color color1 = new Color(0, 0, 0);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(255, 0, 0);
- private final Color color4 = new Color(204, 0, 0);
- private final Color color5 = new Color(255, 255, 255);
- final Color GREEN = new Color(0, 255, 0, 255);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Vijaya", 1, 25);
- private final Font font2 = new Font("Miriam Fixed", 0, 14);
- private final Font font3 = new Font("Miriam Fixed", 1, 14);
- public void onRepaint(Graphics g1) {
- if (!showPaint || g1 == null) {
- return;
- }
- if (startTime == 0) {
- startTime = System.currentTimeMillis();
- }
- if (startExp == 0) {
- startExp = skills.getCurrentExp(23);
- }
- if (startLevel == 0) {
- startLevel = skills.getRealLevel(23);
- }
- runTime = System.currentTimeMillis() - startTime;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= minutes * 60;
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= hours * 60;
- }
- gainedExp = skills.getCurrentExp(23) - startExp;
- expToLevel = skills.getExpToNextLevel(23);
- if ((minutes > 0 || hours > 0 || seconds > 0) && gainedExp > 0) {
- secExp = (float) gainedExp
- / (float) (seconds + minutes * 60 + hours * 60 * 60);
- }
- minuteExp = secExp * 60;
- hourExp = minuteExp * 60;
- if (secExp > 0) {
- secToLevel = (int) (expToLevel / secExp);
- }
- if (secToLevel >= 60) {
- minutesToLevel = secToLevel / 60;
- secToLevel -= minutesToLevel * 60;
- } else {
- minutesToLevel = 0;
- }
- if (minutesToLevel >= 60) {
- hoursToLevel = minutesToLevel / 60;
- minutesToLevel -= hoursToLevel * 60;
- } else {
- hoursToLevel = 0;
- }
- drawMouseLines(g1);
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRoundRect(9, 346, 495, 125, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRoundRect(9, 346, 495, 125, 16, 16);
- g.setFont(font1);
- g.drawString("BadassSummoner 0.6", 70, 366);
- g.setColor(color3);
- g.drawString("BadassSumm 0.6", 69, 365);
- g.setColor(GREEN);
- g.fillRect(280, 360, 12, 100);
- g.setColor(color4);
- g.fillRect(280, 360,12,100-skills.getPercentToNextLevel(23));
- g.setColor(color2);
- g.drawRect(280, 360, 12, 100);
- g.setFont(font2);
- g.setColor(color5);
- g.setFont(font3);
- g.setColor(color2);
- g.drawString(skills.getPercentToNextLevel(23) + "% to " + (skills.getRealLevel(23)+1) , 300, 420);
- g.setColor(color5);
- g.drawString(skills.getPercentToNextLevel(23) + "% to " + (skills.getRealLevel(23)+1), 299, 419);
- g.setFont(font2);
- g.setColor(color5);
- g.drawString("Status: "+status, 12, 388);
- g.drawString("Running for: " + hours + ":" + minutes + ":" + seconds,12, 408);
- g.drawString("Exp Gained: " + gainedExp + " ("
- + (skills.getRealLevel(23) - startLevel) + ")", 12, 420);
- g.drawString("Exp per hour: " + (int) hourExp, 12, 432);
- g.drawString("Exp TNL: " + expToLevel, 12, 444);
- g.drawString("Time to level: " + hoursToLevel + ":" + minutesToLevel
- + ":" + secToLevel, 12, 456);
- g.setFont(font3);
- } {
- }
- @Override
- public int loop() {
- BANK();
- tosum();
- Make_Pouch();
- toBank();
- return 0;
- }
- public void BANK() {
- if (npcs.getNearest(6200) != null) {
- if (!inventory.contains(ITEM_ID)) {
- if (!bank.isOpen())
- bank.open();
- if (bank.isOpen()) {
- if (inventory.contains(ITEM_ID))
- return;
- bank.depositAllExcept(12183, 12155, CHARM, 8009, 8013);
- sleep(150, 400);
- bank.withdraw(ITEM_ID,28);
- sleep(150, 400);
- }
- }
- }
- }
- public void toBank() {
- RSItem tab = inventory.getItem([COLOR=yellow]8009[/COLOR]);
- // RSTtem
- if (!inventory.contains(ITEM_ID)) {
- if (objects.getNearest(28716) != null
- && !inventory.contains(ITEM_ID)) {
- if (tab != null && getMyPlayer().getAnimation() == -1) {
- tab.doClick(true);
- sleep(1000);
- } else {
- action(objects.getNearest(28714), "Climb");
- }
- }
- if (objects.getNearest(28690) != null
- || objects.getNearest(28691) != null)
- objects.getNearest(28690).doAction("Open");
- path.traverse();
- }
- }
- private void drawMouseLines(final Graphics render) { //mouse paint
- try{
- if (!mouse.isPresent())
- return;
- render.setColor(Color.BLACK);
- render.drawLine(0, (int) mouse.getLocation().getY(), game.getWidth(),
- (int) mouse.getLocation().getY());
- render.drawLine((int) mouse.getLocation().getX(), 0, (int) mouse
- .getLocation().getX(), game.getHeight());
- }catch(Exception ex){}
- }
- private final void tosum() {
- final RSItem tab = inventory.getItem(8009); //falador tab test.
- final RSTile[] to = new RSTile[] { new RSTile(2898, 3457),
- new RSTile(2911, 3457), new RSTile(2920, 3449),
- new RSTile(2925, 3444) };
- if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
- if (npcs.getNearest(6200) != null) {
- if (tab != null && getMyPlayer().getAnimation() == -1) {
- if (bank.isOpen())
- bank.close();
- tab.doClick(true);
- sleep(1200);
- }
- }
- walking.newTilePath(to).traverse();
- if (tab == null)
- walking.newTilePath(toT).traverse();
- if (objects.getNearest(4039) != null) {
- action(objects.getNearest(4039), "Climb");
- action(objects.getNearest(4039), "Open");
- }
- }
- }
- private final void Make_Pouch() {
- if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
- if (!interfaces.get(79).isValid()) {
- open(28716);
- } else if (interfaces.get(79).isValid()) {
- Pouch p = pouch.get(PLACE);
- if (!interfaces.getComponent(79, 16).getArea().contains(
- p.getInterface().getCenter()))
- mouse.click(p.getLocation(), true);
- if (interfaces.getComponent(79, 16).getArea().contains(
- p.getInterface().getCenter()))
- if (p.getInterface().doAction("All")) {
- sleep(1000, 1000);
- inventory.getItem(8009).doAction("break");
- }
- }
- }
- }
- private void open(int id) {
- RSObject c = objects.getNearest(id);
- action(c, "Infuse-pouch");
- }
- private void AddPouch() { //names off the pouches it will load to make.
- pouch.add(new Pouch("Spirit wolf pouch", 0, null));
- pouch.add(new Pouch("Dreadfowl pouch", 1, null));
- pouch.add(new Pouch("Spirit spider pouch", 2, null));
- pouch.add(new Pouch("Thorny snail pouch", 3, null));
- pouch.add(new Pouch("Granite crab pouch", 4, null));
- pouch.add(new Pouch("Spirit mosquito pouch", 5, null));
- pouch.add(new Pouch("Desert wyrm pouch", 6, null));
- pouch.add(new Pouch("Spirit scorpion pouch", 7, null));
- pouch.add(new Pouch("Spirit tz-kih pouch", 8, null));
- pouch.add(new Pouch("Albino rat pouch", 9, null));
- pouch.add(new Pouch("Spirit kalphite pouch", 10, null));
- pouch.add(new Pouch("Compost mound pouch", 11, null));
- pouch.add(new Pouch("Giant chinchompa pouch", 12, null));
- pouch.add(new Pouch("Vampire bat pouch", 13, null));
- pouch.add(new Pouch("Honey badger pouch", 14, null));
- pouch.add(new Pouch("Beaver pouch", 15, null));
- pouch.add(new Pouch("Void ravager pouch", 16, null));
- pouch.add(new Pouch("Void spinner pouch", 17, null));
- pouch.add(new Pouch("Void torcher pouch", 18, null));
- pouch.add(new Pouch("Void shifter pouch", 19, null));
- pouch.add(new Pouch("Bull ant pouch", 20, null));
- pouch.add(new Pouch("Macaw pouch", 21, null));
- pouch.add(new Pouch("Evil turnip pouch", 22, null));
- pouch.add(new Pouch("Sp. cockatrice pouch", 23, null));
- pouch.add(new Pouch("Sp. guthatrice pouch", 24, null));
- pouch.add(new Pouch("Sp. saratrice pouch", 25, null));
- pouch.add(new Pouch("Sp. zamatrice pouch", 26, null));
- pouch.add(new Pouch("Sp. pengatrice pouch", 27, null));
- pouch.add(new Pouch("Sp. coraxatrice pouch", 28, null));
- pouch.add(new Pouch("Sp. vulatrice pouch", 29, null));
- pouch.add(new Pouch("Pyrelord pouch", 30, null));
- pouch.add(new Pouch("Magpie pouch", 31, null));
- pouch.add(new Pouch("Bloated leech pouch", 32, null));
- pouch.add(new Pouch("Spirit terrorbird pouch", 33, null));
- pouch.add(new Pouch("Abyssal parasite pouch", 34, null));
- pouch.add(new Pouch("Spirit jelly pouch", 35, null));
- pouch.add(new Pouch("Ibis pouch", 36, null));
- pouch.add(new Pouch("Spirit kyatt pouch", 37, null));
- pouch.add(new Pouch("Spirit larupia pouch", 38, null));
- pouch.add(new Pouch("Spirit graahk pouch", 39, null));
- // 6
- pouch.add(new Pouch("Karam. overlord pouch", 40, new Point(487, 259)));
- pouch.add(new Pouch("Smoke devil pouch", 41, new Point(487, 259)));
- pouch.add(new Pouch("Abyssal lurker pouch", 42, new Point(487, 259)));
- pouch.add(new Pouch("Spirit cobra pouch", 43, new Point(487, 259)));
- pouch.add(new Pouch("Stranger plant pouch", 44, new Point(487, 259)));
- pouch.add(new Pouch("Barker toad pouch", 45, new Point(487, 259)));
- pouch.add(new Pouch("War tortoise pouch", 46, new Point(487, 259)));
- pouch.add(new Pouch("Bunyip pouch", 47, new Point(487, 259)));
- pouch.add(new Pouch("Fruit bat pouch", 48, new Point(487, 259)));
- pouch.add(new Pouch("Ravenous locust pouch", 49, new Point(487, 259)));
- pouch.add(new Pouch("Arctic bear pouch", 50, new Point(487, 259)));
- pouch.add(new Pouch("Phoenix pouch", 51, new Point(487, 259)));
- pouch.add(new Pouch("Obsidian golem pouch", 52, new Point(487, 259)));
- pouch.add(new Pouch("Granite lobster pouch", 53, new Point(487, 259)));
- pouch.add(new Pouch("Praying mantis pouch", 54, new Point(487, 259)));
- pouch.add(new Pouch("Forge regent pouch", 55, new Point(487, 259)));
- pouch.add(new Pouch("Talon beast pouch", 56, new Point(487, 259)));
- pouch.add(new Pouch("Giant ent pouch", 57, new Point(487, 259)));
- pouch.add(new Pouch("Fire titan pouch", 58, new Point(487, 259)));
- pouch.add(new Pouch("Moss titan pouch", 59, new Point(487, 259)));
- pouch.add(new Pouch("Ice titan pouch", 60, new Point(487, 259)));
- pouch.add(new Pouch("Hydra pouch", 61, new Point(487, 259)));
- pouch.add(new Pouch("Spirit dagannoth pouch", 62, new Point(487, 259)));
- pouch.add(new Pouch("Lava titan pouch", 63, new Point(487, 259)));
- pouch.add(new Pouch("Swamp titan pouch", 64, new Point(487, 259)));
- pouch.add(new Pouch("Bronze minotaur pouch", 65, new Point(487, 259)));
- pouch.add(new Pouch("Iron minotaur pouch", 66, new Point(487, 259)));
- pouch.add(new Pouch("Steel minotaur pouch", 67, new Point(487, 259)));
- pouch.add(new Pouch("Mithril minotaur pouch", 68, new Point(487, 259)));
- pouch.add(new Pouch("Adamant minotaur pouch", 69, new Point(487, 259)));
- pouch.add(new Pouch("Rune minotaur pouch", 70, new Point(487, 259)));
- pouch.add(new Pouch("Unicorn stallion pouch", 71, new Point(487, 259)));
- pouch.add(new Pouch("Geyser titan pouch", 72, new Point(485, 300)));
- pouch.add(new Pouch("Wolpertinger pouch", 73, new Point(485, 300)));
- pouch.add(new Pouch("Abyssal titan pouch", 74, new Point(485, 300)));
- pouch.add(new Pouch("Iron titan pouch", 75, new Point(485, 300)));
- pouch.add(new Pouch("Pack yak pouch", 76, new Point(485, 300)));
- pouch.add(new Pouch("Steel titan pouch", 77, new Point(485, 300)));
- }
- private void action(RSObject c, String str) {
- if (c != null) {
- if (c.isOnScreen()) {
- c.doAction(str);
- sleep(1000);
- return;
- }
- }
- return;
- }
- public class Pouch {
- private String Name;
- private int POUCH_ID;
- private Point point;
- public Pouch(String name, int interfacesID, Point p) {
- this.Name = name;
- this.POUCH_ID = interfacesID;
- this.point = p;
- }
- public String getName() {
- return Name;
- }
- public RSComponent getInterface() {
- return interfaces.getComponent(79, 16).getComponent(
- (POUCH_ID * 5) + 2);
- }
- public Point getLocation() {
- return point;
- }
- public int getIndex() {
- return POUCH_ID;
- }
- }
- public class GUISum extends JFrame {
- public GUISum() {
- initComponents();
- }
- private String[] inf() {
- LinkedList<String> str = new LinkedList<String>();
- for (Pouch p : pouch)
- str.add(p.getName());
- return str.toArray(new String[str.size()]);
- }
- private void Start(ActionEvent e) {
- String c1 = comboBox1.getSelectedItem().toString();
- String c2 = comboBox2.getSelectedItem().toString();
- String s = this.textField1.getText();
- for (Pouch p : pouch) {
- if (p.getName().contains(c1))
- PLACE = p.getIndex();
- }
- ITEM_ID = Integer.parseInt(s);
- CHARM = inventory.getItemID(c2);
- log("charm ID " + CHARM + " Item ID " + ITEM_ID); //says what kinda charm you chose.
- isUp = false;
- this.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY
- // //GEN-BEGIN:initComponents
- Start = new JButton();
- comboBox1 = new JComboBox();
- label1 = new JLabel();
- comboBox2 = new JComboBox();
- label2 = new JLabel();
- textField1 = new JTextField();
- label3 = new JLabel();
- // ======== this ========
- setTitle("Badass Summoner");
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- // ---- Start ----
- Start.setText("Start");
- Start.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Start(e);
- }
- });
- comboBox1.setModel(new DefaultComboBoxModel(this.inf()));
- contentPane.add(Start);
- Start.setBounds(10, 195, 495, Start.getPreferredSize().height);
- contentPane.add(comboBox1);
- comboBox1.setBounds(5, 50, 505, 35);
- // ---- label1 ----
- label1.setText("Pouch Type:");
- contentPane.add(label1);
- label1.setBounds(205, 25, 100, 20);
- // ---- comboBox2 ----
- comboBox2.setModel(new DefaultComboBoxModel(
- new String[] { "Gold charm", "Green charm",
- "Crimson charm", "Blue charm" }));
- contentPane.add(comboBox2);
- comboBox2.setBounds(new Rectangle(new Point(105, 105), comboBox2
- .getPreferredSize()));
- // ---- label2 ----
- label2.setText("Charm Kind:");
- contentPane.add(label2);
- label2.setBounds(20, 110, 75, label2.getPreferredSize().height);
- contentPane.add(textField1);
- textField1.setBounds(105, 165, 160,
- textField1.getPreferredSize().height);
- // ---- label3 ----
- label3.setText("Item ID:");
- contentPane.add(label3);
- label3.setBounds(10, 165, 75, 20);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width,
- preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height,
- preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization
- // //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY
- // //GEN-BEGIN:variables
- private JButton Start;
- private JComboBox comboBox1;
- private JLabel label1;
- private JComboBox comboBox2;
- private JLabel label2;
- private JTextField textField1;
- private JLabel label3;
- private JLabel label4;
- private JComboBox comboBox3;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
- }
- Test at Version 1.1 look under here.
- There should be a code like this:
- [COLOR=purple] path = walking.newTilePath(toT);[/COLOR] [COLOR=yellow][SIZE=2]//deleted the ".reverse();" cause that would make u run back.[/SIZE][/COLOR]
- If it doesn't work, change the code to this:
- [COLOR=lime]path = walking.newTilePath(toT) [/COLOR]
- I need some Proggies.
- This post has been edited by delano413: 23 May 2011 - 02:45 PM
- Back to top
- Report
- MultiQuote
- Reply
- #2 Doout Posted 16 March 2011 - 06:46 PM
- OK nice to see someone took over. Really boring doing summ.
- Here is a better one. You can just update it.
- import java.awt.Point;
- import java.util.ArrayList;
- import java.util.LinkedList;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.UIManager.LookAndFeelInfo;
- @ScriptManifest(authors = "Doout", name = "Doout's Summoner", version = 0.1, description = "")
- public class Summoner extends Script {
- ArrayList<Pouch> pouch = new ArrayList<Pouch>();
- private static int PLACE;
- private static int CHARM;
- private static int ITEM_ID;
- private static boolean isUp = true;
- private static RSTile[] toT = new RSTile[] { new RSTile(2946, 3369),
- new RSTile(2948, 3375), new RSTile(2952, 3381),
- new RSTile(2964, 3386), new RSTile(2962, 3398),
- new RSTile(2960, 3411), new RSTile(2954, 3420),
- new RSTile(2950, 3432), new RSTile(2947, 3444),
- new RSTile(2937, 3451), new RSTile(2931, 3450),
- new RSTile(2924, 3444), new RSTile(2925, 3444) };
- private static RSPath path;
- public boolean onStart() {
- try {
- JFrame.setDefaultLookAndFeelDecorated(true);
- for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (Exception e) {
- log.severe("Fail to setLookAndFeel");
- }
- AddPouch();
- new GUISum().setVisible(true);
- while (isUp)
- sleep(50);
- path = walking.newTilePath(toT).reverse();
- return true;
- }
- @Override
- public int loop() {
- BANK();
- tosum();
- Make_Pouch();
- toBank();
- return 0;
- }
- public void BANK() {
- if (npcs.getNearest(6200) != null) {
- if (!inventory.contains(ITEM_ID)) {
- if (!bank.isOpen())
- bank.open();
- if (bank.isOpen()) {
- if (inventory.contains(ITEM_ID))
- return;
- bank.depositAllExcept(12183, 12155, CHARM, ITEM_ID, 8009,
- 8013);
- sleep(300, 500);
- bank.withdraw(ITEM_ID, 28);
- sleep(300, 500);
- }
- }
- }
- }
- public void toBank() {
- RSItem tab = inventory.getItem(8009);
- // RSTtem
- if (!inventory.contains(ITEM_ID)) {
- if (objects.getNearest(28716) != null
- && !inventory.contains(ITEM_ID)) {
- if (tab != null && getMyPlayer().getAnimation() == -1) {
- tab.doClick(true);
- sleep(1000);
- } else {
- action(objects.getNearest(28714), "Climb");
- }
- }
- if (objects.getNearest(28690) != null
- || objects.getNearest(28691) != null)
- objects.getNearest(28690).doAction("Open");
- path.traverse();
- }
- }
- private final void tosum() {
- final RSItem tab = inventory.getItem(8013);
- final RSTile[] to = new RSTile[] { new RSTile(2898, 3457),
- new RSTile(2911, 3457), new RSTile(2920, 3449),
- new RSTile(2925, 3444) };
- if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
- if (npcs.getNearest(6200) != null) {
- if (tab != null && getMyPlayer().getAnimation() == -1) {
- if (bank.isOpen())
- bank.close();
- tab.doClick(true);
- sleep(1000);
- }
- }
- walking.newTilePath(to).traverse();
- if (tab == null)
- walking.newTilePath(toT).traverse();
- if (objects.getNearest(4039) != null) {
- action(objects.getNearest(4039), "Climb");
- action(objects.getNearest(4039), "Open");
- }
- }
- }
- private final void Make_Pouch() {
- if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
- if (!interfaces.get(79).isValid()) {
- open(28716);
- } else if (interfaces.get(79).isValid()) {
- Pouch p = pouch.get(PLACE);
- if (!interfaces.getComponent(79, 16).getArea().contains(
- p.getInterface().getCenter()))
- mouse.click(p.getLocation(), true);
- if (interfaces.getComponent(79, 16).getArea().contains(
- p.getInterface().getCenter()))
- if (p.getInterface().doAction("All")) {
- sleep(1000, 1500);
- }
- }
- }
- }
- private void open(int id) {
- RSObject c = objects.getNearest(id);
- action(c, "Infuse-pouch");
- }
- private void AddPouch() {
- pouch.add(new Pouch("Spirit wolf pouch", 0, null));
- pouch.add(new Pouch("Dreadfowl pouch", 1, null));
- pouch.add(new Pouch("Spirit spider pouch", 2, null));
- pouch.add(new Pouch("Thorny snail pouch", 3, null));
- pouch.add(new Pouch("Granite crab pouch", 4, null));
- pouch.add(new Pouch("Spirit mosquito pouch", 5, null));
- pouch.add(new Pouch("Desert wyrm pouch", 6, null));
- pouch.add(new Pouch("Spirit scorpion pouch", 7, null));
- pouch.add(new Pouch("Spirit tz-kih pouch", 8, null));
- pouch.add(new Pouch("Albino rat pouch", 9, null));
- pouch.add(new Pouch("Spirit kalphite pouch", 10, null));
- pouch.add(new Pouch("Compost mound pouch", 11, null));
- pouch.add(new Pouch("Giant chinchompa pouch", 12, null));
- pouch.add(new Pouch("Vampire bat pouch", 13, null));
- pouch.add(new Pouch("Honey badger pouch", 14, null));
- pouch.add(new Pouch("Beaver pouch", 15, null));
- pouch.add(new Pouch("Void ravager pouch", 16, null));
- pouch.add(new Pouch("Void spinner pouch", 17, null));
- pouch.add(new Pouch("Void torcher pouch", 18, null));
- pouch.add(new Pouch("Void shifter pouch", 19, null));
- pouch.add(new Pouch("Bull ant pouch", 20, null));
- pouch.add(new Pouch("Macaw pouch", 21, null));
- pouch.add(new Pouch("Evil turnip pouch", 22, null));
- pouch.add(new Pouch("Sp. cockatrice pouch", 23, null));
- pouch.add(new Pouch("Sp. guthatrice pouch", 24, null));
- pouch.add(new Pouch("Sp. saratrice pouch", 25, null));
- pouch.add(new Pouch("Sp. zamatrice pouch", 26, null));
- pouch.add(new Pouch("Sp. pengatrice pouch", 27, null));
- pouch.add(new Pouch("Sp. coraxatrice pouch", 28, null));
- pouch.add(new Pouch("Sp. vulatrice pouch", 29, null));
- pouch.add(new Pouch("Pyrelord pouch", 30, null));
- pouch.add(new Pouch("Magpie pouch", 31, null));
- pouch.add(new Pouch("Bloated leech pouch", 32, null));
- pouch.add(new Pouch("Spirit terrorbird pouch", 33, null));
- pouch.add(new Pouch("Abyssal parasite pouch", 34, null));
- pouch.add(new Pouch("Spirit jelly pouch", 35, null));
- pouch.add(new Pouch("Ibis pouch", 36, null));
- pouch.add(new Pouch("Spirit kyatt pouch", 37, null));
- pouch.add(new Pouch("Spirit larupia pouch", 38, null));
- pouch.add(new Pouch("Spirit graahk pouch", 39, null)); // 6
- pouch.add(new Pouch("Karam. overlord pouch", 40, new Point(487, 259)));
- pouch.add(new Pouch("Smoke devil pouch", 41, new Point(487, 259)));
- pouch.add(new Pouch("Abyssal lurker pouch", 42, new Point(487, 259)));
- pouch.add(new Pouch("Spirit cobra pouch", 43, new Point(487, 259)));
- pouch.add(new Pouch("Stranger plant pouch", 44, new Point(487, 259)));
- pouch.add(new Pouch("Barker toad pouch", 45, new Point(487, 259)));
- pouch.add(new Pouch("War tortoise pouch", 46, new Point(487, 259)));
- pouch.add(new Pouch("Bunyip pouch", 47, new Point(487, 259)));
- pouch.add(new Pouch("Fruit bat pouch", 48, new Point(487, 259)));
- pouch.add(new Pouch("Ravenous locust pouch", 49, new Point(487, 259)));
- pouch.add(new Pouch("Arctic bear pouch", 50, new Point(487, 259)));
- pouch.add(new Pouch("Phoenix pouch", 51, new Point(487, 259)));
- pouch.add(new Pouch("Obsidian golem pouch", 52, new Point(487, 259)));
- pouch.add(new Pouch("Granite lobster pouch", 53, new Point(487, 259)));
- pouch.add(new Pouch("Praying mantis pouch", 54, new Point(487, 259)));
- pouch.add(new Pouch("Forge regent pouch", 55, new Point(487, 259)));
- pouch.add(new Pouch("Talon beast pouch", 56, new Point(487, 259)));
- pouch.add(new Pouch("Giant ent pouch", 57, new Point(487, 259)));
- pouch.add(new Pouch("Fire titan pouch", 58, new Point(487, 259)));
- pouch.add(new Pouch("Moss titan pouch", 59, new Point(487, 259)));
- pouch.add(new Pouch("Ice titan pouch", 60, new Point(487, 259)));
- pouch.add(new Pouch("Hydra pouch", 61, new Point(487, 259)));
- pouch.add(new Pouch("Spirit dagannoth pouch", 62, new Point(487, 259)));
- pouch.add(new Pouch("Lava titan pouch", 63, new Point(487, 259)));
- pouch.add(new Pouch("Swamp titan pouch", 64, new Point(487, 259)));
- pouch.add(new Pouch("Bronze minotaur pouch", 65, new Point(487, 259)));
- pouch.add(new Pouch("Iron minotaur pouch", 66, new Point(487, 259)));
- pouch.add(new Pouch("Steel minotaur pouch", 67, new Point(487, 259)));
- pouch.add(new Pouch("Mithril minotaur pouch", 68, new Point(487, 259)));
- pouch.add(new Pouch("Adamant minotaur pouch", 69, new Point(487, 259)));
- pouch.add(new Pouch("Rune minotaur pouch", 70, new Point(487, 259)));
- pouch.add(new Pouch("Unicorn stallion pouch", 71, new Point(487, 259)));
- pouch.add(new Pouch("Geyser titan pouch", 72, new Point(485, 300)));
- pouch.add(new Pouch("Wolpertinger pouch", 73, new Point(485, 300)));
- pouch.add(new Pouch("Abyssal titan pouch", 74, new Point(485, 300)));
- pouch.add(new Pouch("Iron titan pouch", 75, new Point(485, 300)));
- pouch.add(new Pouch("Pack yak pouch", 76, new Point(485, 300)));
- pouch.add(new Pouch("Steel titan pouch", 77, new Point(485, 300)));
- }
- private void action(RSObject c, String str) {
- if (c != null) {
- if (c.isOnScreen()) {
- c.doAction(str);
- sleep(1000);
- return;
- }
- }
- return;
- }
- public class Pouch {
- private String Name;
- private int POUCH_ID;
- private Point point;
- public Pouch(String name, int interfacesID, Point p) {
- this.Name = name;
- this.POUCH_ID = interfacesID;
- this.point = p;
- }
- public String getName() {
- return Name;
- }
- public RSComponent getInterface() {
- return interfaces.getComponent(79, 16).getComponent(
- (POUCH_ID * 5) + 2);
- }
- public Point getLocation() {
- return point;
- }
- public int getIndex() {
- return POUCH_ID;
- }
- }
- public class GUISum extends JFrame {
- public GUISum() {
- initComponents();
- }
- private String[] inf() {
- LinkedList<String> str = new LinkedList<String>();
- for (Pouch p : pouch)
- str.add(p.getName());
- return str.toArray(new String[str.size()]);
- }
- private void Start(ActionEvent e) {
- String c1 = comboBox1.getSelectedItem().toString();
- String c2 = comboBox2.getSelectedItem().toString();
- String s = this.textField1.getText();
- for (Pouch p : pouch) {
- if (p.getName().contains(c1))
- PLACE = p.getIndex();
- }
- ITEM_ID = Integer.parseInt(s);
- CHARM = inventory.getItemID(c2);
- log("charm ID " + CHARM + " Item ID " + ITEM_ID);
- isUp = false;
- this.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY
- // //GEN-BEGIN:initComponents
- Start = new JButton();
- comboBox1 = new JComboBox();
- label1 = new JLabel();
- comboBox2 = new JComboBox();
- label2 = new JLabel();
- textField1 = new JTextField();
- label3 = new JLabel();
- // ======== this ========
- setTitle("Doout's Summoner");
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- // ---- Start ----
- Start.setText("Start");
- Start.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Start(e);
- }
- });
- comboBox1.setModel(new DefaultComboBoxModel(this.inf()));
- contentPane.add(Start);
- Start.setBounds(10, 195, 495, Start.getPreferredSize().height);
- contentPane.add(comboBox1);
- comboBox1.setBounds(5, 50, 505, 35);
- // ---- label1 ----
- label1.setText(" Pouch to make");
- contentPane.add(label1);
- label1.setBounds(205, 25, 100, 20);
- // ---- comboBox2 ----
- comboBox2.setModel(new DefaultComboBoxModel(
- new String[] { "Gold charm", "Green charm",
- "Crimson charm", "Blue charm" }));
- contentPane.add(comboBox2);
- comboBox2.setBounds(new Rectangle(new Point(105, 105), comboBox2
- .getPreferredSize()));
- // ---- label2 ----
- label2.setText("Charm Colour");
- contentPane.add(label2);
- label2.setBounds(20, 110, 75, label2.getPreferredSize().height);
- contentPane.add(textField1);
- textField1.setBounds(105, 165, 160,
- textField1.getPreferredSize().height);
- // ---- label3 ----
- label3.setText("Secondary ID");
- contentPane.add(label3);
- label3.setBounds(10, 165, 75, 20);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width,
- preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height,
- preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization
- // //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY
- // //GEN-BEGIN:variables
- private JButton Start;
- private JComboBox comboBox1;
- private JLabel label1;
- private JComboBox comboBox2;
- private JLabel label2;
- private JTextField textField1;
- private JLabel label3;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement