daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2. import java.awt.*;
  3. import java.awt.Graphics;
  4. import java.awt.Image;
  5. import java.io.IOException;
  6. import org.rsbot.script.Script;
  7. import org.rsbot.script.ScriptManifest;
  8. import org.rsbot.script.methods.Game;
  9. import org.rsbot.script.methods.Bank;
  10. import org.rsbot.script.wrappers.RSObject;
  11. import org.rsbot.script.wrappers.RSTile;
  12. import org.rsbot.script.wrappers.RSArea;
  13. import org.rsbot.script.wrappers.RSItem;
  14. import org.rsbot.script.methods.Skills;
  15. import org.rsbot.script.methods.Calculations;
  16. import org.rsbot.script.wrappers.RSGroundItem;
  17. import org.rsbot.script.wrappers.RSComponent;
  18. import org.rsbot.script.methods.Mouse;
  19. import org.rsbot.event.listeners.PaintListener;
  20.  
  21. @ScriptManifest(authors = "Brianpsv1", keywords = "Runecrafting", name = "Brian's AIO RuneCrafter", version = 1.1, description = "Multiple Location Runecrafter.")
  22. public class AIORuneCrafter extends Script implements PaintListener {
  23. // ------------------------------ //
  24. // Paths & Areas //
  25. public RSTile[] ToBank;
  26. public RSArea MindArea = new RSArea(new RSTile(2798, 4832), new RSTile(2769, 4823));
  27. public RSTile[] BankToFire = { new RSTile(3268,3168), new RSTile(3272,3168), new RSTile(3277,3171), new RSTile(3277,3174), new RSTile(3277,3175), new RSTile(3278,3176), new RSTile(3279,3178), new RSTile(3279,3180), new RSTile(3283,3183), new RSTile(3283,3184), new RSTile(3283,3186), new RSTile(3282,3187), new RSTile(3283,3188), new RSTile(3283,3189), new RSTile(3283,3190), new RSTile(3283,3192), new RSTile(3283,3193), new RSTile(3283,3194), new RSTile(3284,3195), new RSTile(3294,3196), new RSTile(3302,3199), new RSTile(3303,3201), new RSTile(3302,3203), new RSTile(3302,3204), new RSTile(3302,3206), new RSTile(3302,3209), new RSTile(3301,3210), new RSTile(3302,3212), new RSTile(3302,3214), new RSTile(3302,3216), new RSTile(3302,3218), new RSTile(3303,3220), new RSTile(3303,3223), new RSTile(3304,3225), new RSTile(3306,3230), new RSTile(3307,3233), new RSTile(3306,3234), new RSTile(3307,3237), new RSTile(3307,3239), new RSTile(3307,3241), new RSTile(3307,3242), new RSTile(3307,3244), new RSTile(3307,3245), new RSTile(3307,3247), new RSTile(3306,3248), new RSTile(3306,3249), new RSTile(3305,3249), new RSTile(3312, 3253) };
  28. public RSTile[] goMindAltar = { new RSTile(2792, 4834)};
  29. public RSTile[] goFireAltar = { new RSTile(2584, 4840)};
  30. public RSTile[] goEarthTalis = { new RSTile(2657, 4839)};
  31. public RSTile[] goWaterTalis = { new RSTile(3486, 4835)};
  32. public RSTile[] BankToEarth = { new RSTile(3253,3419), new RSTile(3254,3422), new RSTile(3254,3423), new RSTile(3254,3426),new RSTile(3265, 3429),new RSTile(3275, 3428), new RSTile(3281,3429), new RSTile(3283,3430), new RSTile(3285,3430), new RSTile(3285,3433), new RSTile(3285,3434), new RSTile(3286,3438), new RSTile(3285,3441), new RSTile(3284,3446), new RSTile(3286,3447), new RSTile(3287,3448), new RSTile(3287,3452), new RSTile(3287,3454), new RSTile(3287,3456), new RSTile(3288,3458), new RSTile(3289,3460), new RSTile(3296,3463), new RSTile(3298,3465), new RSTile(3304,3473), new RSTile(3306,3475)};
  33. public RSTile[] BankToAir = { new RSTile(3189, 3435), new RSTile(3181, 3430), new RSTile(3170, 3428), new RSTile(3161, 3420), new RSTile(3148, 3416), new RSTile(3136, 3417), new RSTile(3127, 3408) };
  34. public RSTile[] BankToWater = { new RSTile(3092,3244),new RSTile(3092,3248), new RSTile(3099,3241),new RSTile(3105, 3234),new RSTile(3112, 3225), new RSTile(3125,3221),new RSTile(3135,3219), new RSTile(3138,3211), new RSTile(3139,3208), new RSTile(3145,3205), new RSTile(3145,3204), new RSTile(3157,3196), new RSTile(3158,3193), new RSTile(3159,3190), new RSTile(3161,3187), new RSTile(3162,3184), new RSTile(3166,3180), new RSTile(3168,3175), new RSTile(3171,3173), new RSTile(3177,3169), new RSTile(3179,3165), new RSTile(3183,3165), new RSTile(3184,3165) };
  35. public RSTile[] BankToBody = { new RSTile(3094, 3489), new RSTile(3085, 3501), new RSTile(3072, 3496), new RSTile(3071, 3487), new RSTile(3071, 3477), new RSTile(3069, 3468), new RSTile(3071, 3458), new RSTile(3071, 3448), new RSTile(3064, 3444), new RSTile(3054, 3443)};
  36. public RSTile[] BankToMind = { new RSTile(2946,3368), new RSTile(2945,3369), new RSTile(2945,3370), new RSTile(2945,3371), new RSTile(2945,3373), new RSTile(2951,3376), new RSTile(2965,3383), new RSTile(2965,3385), new RSTile(2965,3387), new RSTile(2964,3389), new RSTile(2965,3391), new RSTile(2965,3392), new RSTile(2965,3393), new RSTile(2966,3396), new RSTile(2966,3397), new RSTile(2966,3399), new RSTile(2966,3400), new RSTile(2967,3402), new RSTile(2971,3410), new RSTile(2973,3412), new RSTile(2980,3415), new RSTile(2981,3416), new RSTile(2983,3419), new RSTile(2985,3420), new RSTile(2987,3421), new RSTile(2987,3423), new RSTile(2987,3424), new RSTile(2987,3425), new RSTile(2987,3426), new RSTile(2987,3428), new RSTile(2987,3429), new RSTile(2986,3432), new RSTile(2985,3435), new RSTile(2985,3436), new RSTile(2984,3439), new RSTile(2983,3440), new RSTile(2982,3441), new RSTile(2982,3442), new RSTile(2982,3444), new RSTile(2981,3445), new RSTile(2981,3447), new RSTile(2980,3449), new RSTile(2979,3450), new RSTile(2979,3451), new RSTile(2979,3453), new RSTile(2978,3454), new RSTile(2977,3455), new RSTile(2977,3457), new RSTile(2976,3459), new RSTile(2975,3461), new RSTile(2974,3462), new RSTile(2974,3464), new RSTile(2974,3465), new RSTile(2973,3472), new RSTile(2974,3476), new RSTile(2974,3480), new RSTile(2974,3484), new RSTile(2975,3488), new RSTile(2976,3490), new RSTile(2977,3493), new RSTile(2978,3495), new RSTile(2978,3497), new RSTile(2978,3499), new RSTile(2978,3501), new RSTile(2979,3505), new RSTile(2980,3506), new RSTile(2981,3508), new RSTile(2981,3509), new RSTile(2981,3511), new RSTile(2981,3512)};
  37. // Objects //
  38. int WaterTalis = 1444;
  39. int WaterPortal = 2454;
  40. int WaterAltar = 2480;
  41. int WaterExit = 2467;
  42. int EarthTalis = 1440;
  43. int EarthPortal = 2455;
  44. int EarthAltar = 2481;
  45. int EarthExit = 2468;
  46. int FireTalis = 1442;
  47. int FirePortal = 2456;
  48. int FireAltar = 2482;
  49. int FireExit = 2469;
  50. int MindTalis = 1448;
  51. int MindPortal = 2453;
  52. int MindAltar = 2479;
  53. int MindExit = 2466;
  54. int BodyTalis = 1446;
  55. int BodyPortal = 2457;
  56. int BodyAltar = 2483;
  57. int BodyExit = 2470;
  58. int AirPortal = 2452;
  59. int AirAltar = 2478;
  60. int AirExit = 2465;
  61. int AirTalis = 1438;
  62. int EssenceRockID = 1436;
  63. int bankID[] = {782, 26972, 11758, 27663, 35647, 2213};
  64. int AllTalis[] = {1438, 1446, 1440, 1442, 1448, 1444};
  65. int AllRunes[] = {556, 559, 557, 554, 558, 555};
  66. // GUI //
  67. private AIOCrafterGUI AIOCrafterGUI;
  68. // Booleans //
  69. boolean talisman = false;
  70. boolean start = false;
  71. boolean aircraft = false;
  72. boolean bodycraft = false;
  73. boolean mindcraft = false;
  74. boolean firecraft = false;
  75. boolean earthcraft = false;
  76. boolean watercraft = false;
  77. // Extras //
  78. public long startTime = System.currentTimeMillis();
  79. String state;
  80. int antiban;
  81. int startexp = 0;
  82. int xpGained = 0;
  83. int startlvl = 0;
  84. int essused = 0;
  85. // ------------------------------- //
  86.     public boolean onStart() {
  87.         log("Brian's AIO RuneCrafter");
  88.         AIOCrafterGUI = new AIOCrafterGUI();
  89.         AIOCrafterGUI.setVisible(true);
  90.         startlvl = skills.getCurrentLevel(Skills.RUNECRAFTING);
  91.         mouse.setSpeed(random(7, 8));
  92.         return true;
  93.     }
  94.     public void onRepaint(Graphics g) {
  95.             if ( startexp == 0) {
  96.             startexp = skills.getCurrentExp(Skills.RUNECRAFTING);
  97.             }
  98.              int lvlGain = skills.getCurrentLevel(Skills.RUNECRAFTING) - startlvl;
  99.             xpGained = skills.getCurrentExp(Skills.RUNECRAFTING) - startexp;
  100.             long millis = System.currentTimeMillis() - startTime;
  101.            
  102.             int xpPerHour = (int) (3600000.0 / millis * xpGained);
  103.             long hours = millis / (1000 * 60 * 60);
  104.             millis -= hours * (1000 * 60 * 60);
  105.             long minutes = millis / (1000 * 60);
  106.             millis -= minutes * (1000 * 60);
  107.             long seconds = millis / 1000;
  108.             long minutes2 = minutes + (hours * 60);
  109.            float xpsec = 0;
  110.         g.setColor(new Color(0, 0, 0, 158));
  111.         g.fillRect(547, 204, 192, 262);
  112.         g.setFont(new Font("Comic Sans MS", 0, 17));
  113.         g.setColor(new Color(255, 0, 0));
  114.         g.drawString("Brian's Runecrafter", 554, 227);
  115.         g.setFont(new Font("Comic Sans MS", 0, 12));
  116.         g.setColor(new Color(255, 0, 0));
  117.         g.drawString("RunTime: " + hours + ":" + minutes + ":" + seconds , 554, 247);
  118.         g.setFont(new Font("Comic Sans MS", 0, 12));
  119.         g.setColor(new Color(255, 0, 0));
  120.         g.drawString("Exp Gained: " + xpGained, 554, 264);
  121.         g.setFont(new Font("Comic Sans MS", 0, 12));
  122.         g.setColor(new Color(255, 0, 0));
  123.         g.drawString("Exp/H: " + xpPerHour, 554, 281);
  124.         g.setFont(new Font("Comic Sans MS", 0, 12));
  125.         g.setColor(new Color(255, 0, 0));
  126.         g.drawString("Level: " + skills.getCurrentLevel(Skills.RUNECRAFTING), 554, 298);
  127.         g.setFont(new Font("Comic Sans MS", 0, 12));
  128.         g.setColor(new Color(255, 0, 0));
  129.         g.drawString("Levels Gained: " + lvlGain, 554, 315);
  130.         g.setFont(new Font("Comic Sans MS", 0, 12));
  131.         g.setColor(new Color(255, 0, 0));
  132.         g.drawString("Essence Used: " + essused, 554, 332);
  133.         g.setFont(new Font("Comic Sans MS", 0, 12));
  134.         g.setColor(new Color(255, 0, 0));
  135.         g.drawString("Exp: " + skills.getCurrentExp(Skills.RUNECRAFTING), 554, 349);
  136.         g.drawString("State: " + state, 554, 366);
  137.         g.setFont(new Font("Comic Sans MS", 0, 12));
  138.         g.setColor(new Color(255, 0, 0));
  139.         g.drawString("Brianpsv1", 679, 461);
  140.     }
  141.    
  142.     public int loop() {
  143.        
  144.         if(start == true) {
  145.         AIOCrafterGUI.setVisible(false);
  146.         antiban = antiban + 1;
  147.         if ( walking.getEnergy() > random(60,100)) {
  148.         walking.setRun(true);
  149.         }
  150.         if(antiban == 30) {
  151.         sleep(random(200, 300));
  152.         int randomizer = random(1, 5);
  153.         if(randomizer == 2) {
  154.         camera.setAngle(random(0, 180));
  155.         camera.setPitch(random(80, 100));
  156.         }
  157.         if(randomizer == 3) {
  158.         game.openTab(Game.TAB_STATS);
  159.         mouse.move(582, 394);
  160.         sleep(random(500, 1250));
  161.         game.openTab(Game.TAB_INVENTORY);
  162.         }
  163.         if(randomizer == 4) {
  164.         game.openTab(Game.TAB_FRIENDS);
  165.         sleep(random(500, 1250));
  166.         game.openTab(Game.TAB_INVENTORY);
  167.         }
  168. antiban = 0;
  169. }
  170.             if(!inventory.contains(EssenceRockID)) {
  171.             // Go To Bank
  172.             //if(!inventory.containsOneOf(AllRunes)) {
  173.             //RSObject bankBooth = objects.getNearest(bankID);
  174.             //if(bankBooth != null) {
  175.             //if (!bank.isOpen()) {
  176.             //bankBooth.doAction("Use-quickly");
  177.             //} else if (bank.isOpen()) {
  178.             //if(talisman == true) {
  179.             //bank.withdraw(1436, 27);
  180.             //} else {
  181.             //bank.withdraw(1436, );
  182.             //}
  183.             //bank.close();
  184.             //}
  185.             //}
  186.             //}
  187.                 if(aircraft == true) {
  188.                 BankAir();
  189.                 }
  190.                 if(firecraft == true) {
  191.                 BankFire();
  192.                 }
  193.                 if(bodycraft == true) {
  194.                 BankBody();
  195.                 }
  196.                 if(mindcraft == true) {
  197.                 BankMind();
  198.                 }
  199.                 if(earthcraft == true) {
  200.                 BankEarth();
  201.                 }
  202.                 if(watercraft == true) {
  203.                 BankWater();
  204.                 }
  205.                 return 1500;
  206.             }
  207.             if(inventory.contains(EssenceRockID)) {
  208.             // Go To Altar
  209.                 if(watercraft == true) {
  210.                 CraftWater();
  211.                 }
  212.                 if(earthcraft == true) {
  213.                 CraftEarth();
  214.                 }
  215.                 if(firecraft == true) {
  216.                 CraftFire();
  217.                 }
  218.                 if(aircraft == true) {
  219.                 CraftAir();
  220.                 }
  221.                 if(bodycraft == true) {
  222.                 CraftBody();
  223.                 }
  224.                 if(mindcraft == true) {
  225.                 CraftMind();
  226.                 }
  227.             }
  228.         }
  229.         return 100;
  230.     }
  231.     public void CraftMind() {
  232.     RSObject Altar = objects.getNearest(MindAltar);
  233.     RSObject Portal = objects.getNearest(MindPortal);
  234.     if ( MindArea.contains(getMyPlayer().getLocation())) {
  235.     walking.walkPathMM(goMindAltar, 1 ,1);
  236.     }
  237.     if (Altar != null) {
  238.     RSTile goaltar = new RSTile(Altar.getLocation().getX(), Altar.getLocation().getY());
  239.     if (calc.distanceTo(Altar) < 3) {
  240.     state = "Crafting";
  241.     camera.turnToObject(Altar);
  242.     Altar.doAction("Craft-rune");
  243.     sleep(2000);
  244.     } else {
  245.     state = "Walking";
  246.     walking.walkTileMM(goaltar);
  247.     }
  248.     } else if(Portal != null) {
  249.     if ( calc.distanceTo(Portal) < 5 ) {
  250.         if ( talisman == true) {
  251.         state = "Entering Portal";
  252.         camera.turnToObject(Portal);
  253.         RSItem item = inventory.getItem(MindTalis);
  254.         inventory.useItem(item, Portal);
  255.         sleep(1500);
  256.         } else if ( talisman == false) {
  257.         state = "Entering Portal";
  258.         camera.turnToObject(Portal);
  259.         Portal.doAction("Enter");
  260.         }
  261.         } else {
  262.         state = "Walking";
  263.         walking.walkPathMM(BankToMind, 1 ,1);
  264.         }
  265.     } else {
  266.     state = "Walking";
  267.     walking.walkPathMM(BankToMind, 1 ,1);
  268.     }
  269.     }
  270.     public void BankMind() {
  271.     RSObject Altar = objects.getNearest(MindAltar);
  272.     RSObject Exit = objects.getNearest(MindExit);
  273.     RSObject bankBooth = objects.getNearest(bankID);
  274.     if (Altar != null) {
  275.     if (calc.distanceTo(Altar) < 3) {
  276.     walking.walkPathMM(goMindAltar, 1 ,1);
  277.     }
  278.     }
  279.     if (Exit != null) {
  280.     RSTile goexit = new RSTile(Exit.getLocation().getX(), Exit.getLocation().getY());
  281.     if (calc.distanceTo(Exit) < 3) {
  282.     Exit.doAction("Enter");
  283.     } else {
  284.     walking.walkTileMM(goexit);
  285.     }
  286.     } else if (bankBooth != null) {
  287.         if ( calc.distanceTo(bankBooth) < 5 ) {
  288.             if (!bank.isOpen()) {
  289.             camera.turnToObject(bankBooth);
  290.             bankBooth.doAction("Use-quickly");
  291.             } else if (bank.isOpen()) {
  292.             bank.depositAllExcept(AllTalis);
  293.             if(talisman == true) {
  294.             essused = essused + 27;
  295.             bank.withdraw(1436, 27);
  296.             } else {
  297.             essused = essused + 28;
  298.             bank.withdraw(1436, 28);
  299.             }
  300.             bank.close();
  301.             }
  302.         } else {
  303.         walking.walkPathMM(ToBank, 1 ,1);
  304.         }
  305.     } else {
  306.     walking.walkPathMM(ToBank, 1 ,1);
  307.     }
  308.     }
  309.     public void CraftBody() {
  310.     RSObject Altar = objects.getNearest(BodyAltar);
  311.     RSObject Portal = objects.getNearest(BodyPortal);
  312.     if (Altar != null) {
  313.     camera.turnToObject(Altar);
  314.     Altar.doAction("Craft-rune");
  315.     sleep(2000);
  316.     } else if(Portal != null) {
  317.     if ( calc.distanceTo(Portal) < 5 ) {
  318.         if ( talisman == true) {
  319.         camera.turnToObject(Portal);
  320.         RSItem item = inventory.getItem(BodyTalis);
  321.         inventory.useItem(item, Portal);
  322.         } else if ( talisman == false) {
  323.         camera.turnToObject(Portal);
  324.         Portal.doAction("Enter");
  325.         }
  326.         } else {
  327.         walking.walkPathMM(BankToBody, 1 ,1);
  328.         }
  329.     } else {
  330.     walking.walkPathMM(BankToBody, 1 ,1);
  331.     }
  332.     }
  333.     public void BankBody() {
  334.     RSObject Exit = objects.getNearest(BodyExit);
  335.     RSObject bankBooth = objects.getNearest(bankID);
  336.     if (Exit != null) {
  337.     RSTile goexit = new RSTile(Exit.getLocation().getX(), Exit.getLocation().getY());
  338.     if (calc.distanceTo(Exit) < 3) {
  339.     Exit.doAction("Enter");
  340.     } else {
  341.     walking.walkTileMM(goexit);
  342.     }
  343.     } else if (bankBooth != null) {
  344.         if ( calc.distanceTo(bankBooth) < 5 ) {
  345.             if (!bank.isOpen()) {
  346.             camera.turnToObject(bankBooth);
  347.             bankBooth.doAction("Use-quickly");
  348.             } else if (bank.isOpen()) {
  349.             bank.depositAllExcept(AllTalis);
  350.             if(talisman == true) {
  351.             essused = essused + 27;
  352.             bank.withdraw(1436, 27);
  353.             } else {
  354.             essused = essused + 28;
  355.             bank.withdraw(1436, 28);
  356.             }
  357.             bank.close();
  358.             }
  359.         } else {
  360.         walking.walkPathMM(ToBank, 1 ,1);
  361.         }
  362.     } else {
  363.     walking.walkPathMM(ToBank, 1 ,1);
  364.     }
  365.     }
  366.     public void CraftAir() {
  367.     RSObject Altar = objects.getNearest(AirAltar);
  368.     RSObject Portal = objects.getNearest(AirPortal);
  369.     if (Altar != null) {
  370.     camera.turnToObject(Altar);
  371.     Altar.doAction("Craft-rune");
  372.     sleep(2000);
  373.     } else if(Portal != null) {
  374.     if ( calc.distanceTo(Portal) < 5 ) {
  375.         if ( talisman == true) {
  376.         camera.turnToObject(Portal);
  377.         RSItem item = inventory.getItem(AirTalis);
  378.         inventory.useItem(item, Portal);
  379.         } else if ( talisman == false) {
  380.         camera.turnToObject(Portal);
  381.         Portal.doAction("Enter");
  382.         }
  383.         } else {
  384.         walking.walkPathMM(BankToAir, 1 ,1);
  385.         }
  386.     } else {
  387.     walking.walkPathMM(BankToAir, 1 ,1);
  388.     }
  389.     }
  390.    
  391.     public void BankAir() {
  392.     RSObject Exit = objects.getNearest(AirExit);
  393.     RSObject bankBooth = objects.getNearest(bankID);
  394.     if (Exit != null) {
  395.     camera.turnToObject(Exit);
  396.     Exit.doAction("Enter");
  397.     } else if (bankBooth != null) {
  398.         if ( calc.distanceTo(bankBooth) < 5 ) {
  399.             if (!bank.isOpen()) {
  400.             camera.turnToObject(bankBooth);
  401.             bankBooth.doAction("Use-quickly");
  402.             } else if (bank.isOpen()) {
  403.             bank.depositAllExcept(AllTalis);
  404.             if(talisman == true) {
  405.             essused = essused + 27;
  406.             bank.withdraw(1436, 27);
  407.             } else {
  408.             essused = essused + 28;
  409.             bank.withdraw(1436, 28);
  410.             }
  411.             bank.close();
  412.             }
  413.         } else {
  414.         walking.walkPathMM(ToBank, 1 ,1);
  415.         }
  416.     } else {
  417.     walking.walkPathMM(ToBank, 1 ,1);
  418.     }
  419.     }
  420.     public void CraftEarth() {
  421.     RSObject Altar = objects.getNearest(EarthAltar);
  422.     RSObject Portal = objects.getNearest(EarthPortal);
  423.     if (Altar != null) {
  424.     if ( calc.distanceTo(Altar) < 4 ) {
  425.     camera.turnToObject(Altar);
  426.     Altar.doAction("Craft-rune");
  427.     sleep(2000);
  428.     } else {
  429.     walking.walkPathMM(goEarthTalis, 1 ,1);
  430.     }
  431.     } else if(Portal != null) {
  432.     if ( calc.distanceTo(Portal) < 5 ) {
  433.         if ( talisman == true) {
  434.         camera.turnToObject(Portal);
  435.         RSItem item = inventory.getItem(EarthTalis);
  436.         inventory.useItem(item, Portal);
  437.         } else if ( talisman == false) {
  438.         camera.turnToObject(Portal);
  439.         Portal.doAction("Enter");
  440.         }
  441.         } else {
  442.         walking.walkPathMM(BankToEarth, 1 ,1);
  443.         sleep(1000);
  444.         }
  445.     } else {
  446.     walking.walkPathMM(BankToEarth, 1 ,1);
  447.     sleep(1000);
  448.     }
  449.     }
  450.    
  451.     public void BankEarth() {
  452.     RSObject Exit = objects.getNearest(EarthExit);
  453.     RSObject bankBooth = objects.getNearest(bankID);
  454.    
  455.     if (Exit != null) {
  456.     RSTile goexit = new RSTile(Exit.getLocation().getX(), Exit.getLocation().getY());
  457.     if ( calc.distanceTo(Exit) < 3 ) {
  458.     Exit.doAction("Enter");
  459.     } else {
  460.     walking.walkTileMM(goexit);
  461.     }
  462.     } else if (bankBooth != null) {
  463.         if ( calc.distanceTo(bankBooth) < 5 ) {
  464.             if (!bank.isOpen()) {
  465.             camera.turnToObject(bankBooth);
  466.             bankBooth.doAction("Use-quickly");
  467.             } else if (bank.isOpen()) {
  468.             bank.depositAllExcept(AllTalis);
  469.             if(talisman == true) {
  470.             bank.withdraw(1436, 27);
  471.             essused = essused + 27;
  472.             } else {
  473.             bank.withdraw(1436, 28);
  474.             essused = essused + 28;
  475.             }
  476.             bank.close();
  477.             }
  478.         } else {
  479.         walking.walkPathMM(ToBank, 1 ,1);
  480.         }
  481.     } else {
  482.     walking.walkPathMM(ToBank, 1 ,1);
  483.     }
  484.     }
  485.     public void CraftWater() {
  486.     RSObject Altar = objects.getNearest(WaterAltar);
  487.     RSObject Portal = objects.getNearest(WaterPortal);
  488.     if (Altar != null) {
  489.     if ( calc.distanceTo(Altar) < 4 ) {
  490.     camera.turnToObject(Altar);
  491.     Altar.doAction("Craft-rune");
  492.     sleep(2000);
  493.     } else {
  494.    
  495.     walking.walkPathMM(goWaterTalis, 1 ,1);
  496.     }
  497.     } else if(Portal != null) {
  498.     if ( calc.distanceTo(Portal) < 5 ) {
  499.         if ( talisman == true) {
  500.         camera.turnToObject(Portal);
  501.         RSItem item = inventory.getItem(WaterTalis);
  502.         inventory.useItem(item, Portal);
  503.         } else if ( talisman == false) {
  504.         camera.turnToObject(Portal);
  505.         Portal.doAction("Enter");
  506.         }
  507.         } else {
  508.         walking.walkPathMM(BankToWater, 1 ,1);
  509.        
  510.         }
  511.     } else {
  512.    
  513.     walking.walkPathMM(BankToWater, 1 ,1);
  514.     }
  515.     }
  516.    
  517.     public void BankWater() {
  518.     RSObject Exit = objects.getNearest(WaterExit);
  519.     RSObject bankBooth = objects.getNearest(bankID);
  520.    
  521.     if (Exit != null) {
  522.     RSTile goexit = new RSTile(Exit.getLocation().getX(), Exit.getLocation().getY());
  523.     if ( calc.distanceTo(Exit) < 3 ) {
  524.     Exit.doAction("Enter");
  525.     } else {
  526.     walking.walkTileMM(goexit);
  527.     }
  528.     } else if (bankBooth != null) {
  529.         if ( calc.distanceTo(bankBooth) < 5 ) {
  530.             if (!bank.isOpen()) {
  531.             camera.turnToObject(bankBooth);
  532.             bankBooth.doAction("Use-quickly");
  533.             } else if (bank.isOpen()) {
  534.             bank.depositAllExcept(AllTalis);
  535.             if(talisman == true) {
  536.             bank.withdraw(1436, 27);
  537.             essused = essused + 27;
  538.             } else {
  539.             bank.withdraw(1436, 28);
  540.             essused = essused + 28;
  541.             }
  542.             bank.close();
  543.             }
  544.         } else {
  545.         walking.walkPathMM(ToBank, 1 ,1);
  546.         }
  547.     } else {
  548.     walking.walkPathMM(ToBank, 1 ,1);
  549.     }
  550.     }
  551.     public void CraftFire() {
  552.     RSObject Altar = objects.getNearest(FireAltar);
  553.     RSObject Portal = objects.getNearest(FirePortal);
  554.     if (Altar != null) {
  555.     RSTile goaltar = new RSTile(Altar.getLocation().getX(), Altar.getLocation().getY());
  556.     if ( calc.distanceTo(Altar) < 4 ) {
  557.     camera.turnToObject(Altar);
  558.     Altar.doAction("Craft-rune");
  559.     } else {
  560.     walking.walkPathMM(goFireAltar, 0 ,0);
  561.     }
  562.    
  563.    
  564.     sleep(2000);
  565.     } else if(Portal != null) {
  566.     if ( calc.distanceTo(Portal) < 5 ) {
  567.         if ( talisman == true) {
  568.         camera.turnToObject(Portal);
  569.         RSItem item = inventory.getItem(FireTalis);
  570.         inventory.useItem(item, Portal);
  571.         } else if ( talisman == false) {
  572.         camera.turnToObject(Portal);
  573.         Portal.doAction("Enter");
  574.         }
  575.         } else {
  576.         walking.walkPathMM(BankToFire, 1 ,1);
  577.         }
  578.     } else {
  579.     walking.walkPathMM(BankToFire, 1 ,1);
  580.     }
  581.     }
  582.    
  583.     public void BankFire() {
  584.     RSObject Exit = objects.getNearest(FireExit);
  585.     RSObject bankBooth = objects.getNearest(bankID);
  586.     if (Exit != null) {
  587.     RSTile goexit = new RSTile(Exit.getLocation().getX(), Exit.getLocation().getY());
  588.     if ( calc.distanceTo(Exit) < 3 ) {
  589.     Exit.doAction("Enter");
  590.     } else {
  591.     walking.walkTileMM(goexit);
  592.     }
  593.     } else if (bankBooth != null) {
  594.         if ( calc.distanceTo(bankBooth) < 5 ) {
  595.             if (!bank.isOpen()) {
  596.             camera.turnToObject(bankBooth);
  597.             bankBooth.doAction("Use-quickly");
  598.             } else if (bank.isOpen()) {
  599.             bank.depositAllExcept(AllTalis);
  600.             if(talisman == true) {
  601.             bank.withdraw(1436, 27);
  602.             essused = essused + 27;
  603.             } else {
  604.             bank.withdraw(1436, 28);
  605.             essused = essused + 28;
  606.             }
  607.             bank.close();
  608.             }
  609.         } else {
  610.         walking.walkPathMM(ToBank, 1 ,1);
  611.         }
  612.     } else {
  613.     walking.walkPathMM(ToBank, 1 ,1);
  614.     }
  615.     }
  616.  
  617.  
  618.     public void onFinish() {
  619.         log("Thanks for using - Brianpsv1");
  620.     }
  621.     public class AIOCrafterGUI extends javax.swing.JFrame {
  622.  
  623.    
  624.     public AIOCrafterGUI() {
  625.         initComponents();
  626.     }
  627.  
  628.  
  629.     @SuppressWarnings("unchecked")
  630.     // <editor-fold defaultstate="collapsed" desc="Generated Code">
  631.     private void initComponents() {
  632.  
  633.         jLabel1 = new javax.swing.JLabel();
  634.         jComboBox1 = new javax.swing.JComboBox();
  635.         jLabel2 = new javax.swing.JLabel();
  636.         jCheckBox1 = new javax.swing.JCheckBox();
  637.         jButton1 = new javax.swing.JButton();
  638.  
  639.         setTitle("Brian's AIO Crafter");
  640.         setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
  641.  
  642.         jLabel1.setFont(new java.awt.Font("Comic Sans MS", 0, 24)); // NOI18N
  643.         jLabel1.setForeground(new java.awt.Color(255, 0, 51));
  644.         jLabel1.setText("Brian's AIO Crafter");
  645.  
  646.         jComboBox1.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
  647.         jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Air Altar", "Body Altar", "Water Altar", "Mind Altar", "Fire Altar", "Earth Altar" }));
  648.  
  649.         jLabel2.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
  650.         jLabel2.setText("Location");
  651.  
  652.         jCheckBox1.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
  653.         jCheckBox1.setText("Talisman");
  654.  
  655.         jButton1.setFont(new java.awt.Font("Comic Sans MS", 0, 11));
  656.         jButton1.setText("Start");
  657.         jButton1.addActionListener(new java.awt.event.ActionListener() {
  658.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  659.                 jButton1ActionPerformed(evt);
  660.             }
  661.         });
  662.  
  663.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  664.         getContentPane().setLayout(layout);
  665.         layout.setHorizontalGroup(
  666.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  667.             .addGroup(layout.createSequentialGroup()
  668.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  669.                     .addGroup(layout.createSequentialGroup()
  670.                         .addContainerGap()
  671.                         .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  672.                     .addGroup(layout.createSequentialGroup()
  673.                         .addGap(99, 99, 99)
  674.                         .addComponent(jLabel2))
  675.                     .addGroup(layout.createSequentialGroup()
  676.                         .addContainerGap()
  677.                         .addComponent(jComboBox1, 0, 225, Short.MAX_VALUE))
  678.                     .addGroup(layout.createSequentialGroup()
  679.                         .addContainerGap()
  680.                         .addComponent(jCheckBox1))
  681.                     .addGroup(layout.createSequentialGroup()
  682.                         .addContainerGap()
  683.                         .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)))
  684.                 .addContainerGap())
  685.         );
  686.         layout.setVerticalGroup(
  687.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  688.             .addGroup(layout.createSequentialGroup()
  689.                 .addContainerGap()
  690.                 .addComponent(jLabel1)
  691.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  692.                 .addComponent(jLabel2)
  693.                 .addGap(1, 1, 1)
  694.                 .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  695.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  696.                 .addComponent(jCheckBox1)
  697.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  698.                 .addComponent(jButton1)
  699.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  700.         );
  701.  
  702.         pack();
  703.     }// </editor-fold>
  704.  
  705.     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  706.         if(jComboBox1.getSelectedItem().toString().contains("Air Altar")) {
  707.         aircraft = true;
  708.         ToBank = walking.reversePath(BankToAir);
  709.         }
  710.         if(jComboBox1.getSelectedItem().toString().contains("Fire Altar")) {
  711.         firecraft = true;
  712.         ToBank = walking.reversePath(BankToFire);
  713.         }
  714.         if(jComboBox1.getSelectedItem().toString().contains("Body Altar")) {
  715.         bodycraft = true;
  716.         ToBank = walking.reversePath(BankToBody);
  717.         }
  718.         if(jComboBox1.getSelectedItem().toString().contains("Mind Altar")) {
  719.         mindcraft = true;
  720.         ToBank = walking.reversePath(BankToMind);
  721.         }
  722.         if(jComboBox1.getSelectedItem().toString().contains("Earth Altar")) {
  723.         earthcraft = true;
  724.         ToBank = walking.reversePath(BankToEarth);
  725.         }
  726.         if(jComboBox1.getSelectedItem().toString().contains("Water Altar")) {
  727.         watercraft = true;
  728.         ToBank = walking.reversePath(BankToWater);
  729.         }
  730.         if(jCheckBox1.isSelected()) {
  731.         talisman = true;
  732.         }
  733.        
  734.         start = true;
  735.     }
  736.  
  737.  
  738.  
  739.     // Variables declaration - do not modify
  740.     private javax.swing.JButton jButton1;
  741.     private javax.swing.JCheckBox jCheckBox1;
  742.     private javax.swing.JComboBox jComboBox1;
  743.     private javax.swing.JLabel jLabel1;
  744.     private javax.swing.JLabel jLabel2;
  745.     // End of variables declaration
  746.  
  747. }
  748. }
RAW Paste Data
Pastebin PRO CHRISTMAS Special!
Get 60% OFF on Pastebin PRO accounts!
Top