Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ---- Made by Himekp ----
- * The Current Version is V1.30
- */
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JSlider;
- import javax.swing.JTextField;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSPath;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = "Himekp", keywords = "Fishing", name = "ProRocktails, By: Himekp", version = 1.30, description = "To check for Updates, Right click me!", website = "http://dl.dropbox.com/u/27626614/ProFisher.java")
- public class ProRocktails extends Script {
- private String TypeofFish = "";
- private String Banking = "";
- private boolean startScript;
- boolean start;
- public boolean guiWait = true, guiExit = false;
- ProFisherGUI gui;
- public int feather = 314;
- public int rod = 309;
- private int rocksspot = 8842;
- private int cavesspot = 8841;
- private int rocksbank = 45079;
- public boolean startrunning = false;
- public boolean hpresting = false;
- private int mouseSpeed;
- public int[] dontDrop = { 309, 314, 303, 311, 301, 360, 372, 378, 305, 307, 313, 11323, 14109, 15263 };
- private int[] fishingAnim = { 622, 623, 621, 619, 618, 620, 5108, 9980, 6708, 14723, 6711, 10617 };
- public int myhp = 0;
- public int hitpoints = 300;
- public boolean restup = false;
- public int amount = 200;
- public int[] rocksstuff = { 15263, 307 };
- public int[] cavestuff = { 380, 307 };
- private int laddermines = 30942;
- private int rockmines = 45077;
- public int bait = 15263;
- public int cavebait = 380;
- public void drop() {
- inventory.dropAllExcept(dontDrop);
- }
- public boolean onStart(){
- log(Color.blue, "Welcome to Himekp's AIO ProRocktails");
- log(Color.red, "Check for updates by right clicking my script!");
- log(Color.red, "Then check the version and if it isn't V1.30 then theres an update! Recopy and recompile!");
- log("Loading GUI...Please wait...");
- gui = new ProFisherGUI();
- gui.setVisible(true);
- log(Color.green, "The higher the Mouse Speed number is, the faster your mouse will be! Speed 6 is recomended!");
- startScript = true;
- while (!startScript) {
- sleep(10);
- }
- return true;
- }
- public void onFinish(){
- log("Thank You!");
- }
- public boolean walktomines2() {
- if(!atmines2()) {
- RSPath path = walking.newTilePath(gotomines2);
- path.traverse();
- }
- return true;
- }
- private boolean walktomines(){
- if(!atmines()) {
- RSPath path = walking.newTilePath(gotomines);
- path.traverse();
- }
- return true;
- }
- public boolean atdraynorrocks() {
- RSArea area = new RSArea(new RSTile(3081,3484), new RSTile(3102, 3507));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean atmines() {
- RSArea area = new RSArea(new RSTile(3011,3445), new RSTile(3024, 3453));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean atsecondarymines() {
- RSArea area = new RSArea(new RSTile(3000,9818), new RSTile(3033, 9860));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean atmines2() {
- RSArea area = new RSArea(new RSTile(3010,9830), new RSTile(3016, 9833));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean getstuff(){
- if (!bank.isOpen()) {
- bank.open();
- if(!inventory.contains(rod)){
- bank.withdraw(rod, 1);
- }
- if(!inventory.contains(bait)){
- bank.withdraw(bait, amount);
- }
- bank.close();
- } else {
- if (bank.isOpen())
- if(!inventory.contains(rod)){
- bank.withdraw(rod, 1);
- }
- if(!inventory.contains(bait)){
- bank.withdraw(bait, amount);
- }
- bank.close();
- sleep (50,400);
- }
- return true;
- }
- public boolean getstuffcaves(){
- if (!bank.isOpen()) {
- bank.open();
- if(!inventory.contains(rod)){
- bank.withdraw(rod, 1);
- }
- if(!inventory.contains(cavebait)){
- bank.withdraw(cavebait, amount);
- }
- bank.close();
- } else {
- if (bank.isOpen())
- if(!inventory.contains(rod)){
- bank.withdraw(rod, 1);
- }
- if(!inventory.contains(cavebait)){
- bank.withdraw(cavebait, amount);
- }
- bank.close();
- sleep (50,400);
- }
- return true;
- }
- @SuppressWarnings("deprecation")
- public boolean climb(){
- RSObject Ladder = objects.getNearest(laddermines);
- if (Ladder != null) {
- if (calc.distanceTo(Ladder) <= 4) {
- Ladder.doAction("Climb");
- sleep(800, 2400);
- } else if (calc.distanceTo(Ladder) > 4) {
- walking.walkTo(Ladder.getLocation());
- sleep(800, 2600);
- }
- }
- return true;
- }
- @SuppressWarnings("deprecation")
- public boolean climb2(){
- RSObject Ladder = objects.getNearest(rockmines);
- if (Ladder != null) {
- if (calc.distanceTo(Ladder) <= 4) {
- Ladder.doAction("Climb");
- sleep(800, 2400);
- } else if (calc.distanceTo(Ladder) > 4) {
- walking.walkTo(Ladder.getLocation());
- sleep(800, 2600);
- }
- }
- return true;
- }
- public int loop(){
- for (int i : fishingAnim) {
- if (getMyPlayer().getAnimation() == i) {
- sleep(100, 250);
- }
- if(getMyPlayer().isInCombat()){
- walktobankfromrocks();
- }
- if(myhp() < hitpoints){
- restup = true;
- }
- if(myhp() > hitpoints){
- restup = false;
- }
- if(restup == true){
- if(atrocksBank()){
- if(getMyPlayer().getAnimation() == -1){
- rest();
- sleep(1000);
- }else{
- sleep(500);
- }
- }else{
- walktobankfromrocks();
- }
- }
- else if(restup == false){
- if(TypeofFish.equals("Rocktails")){
- if(atdraynorrocks() && inventory.getCount(bait) <= 3 && inventory.contains(rod)){
- getstuff();
- }
- if(game.getPlane() == 0 && inventory.containsAll(rocksstuff)){
- walktomines();
- }
- if(atmines()){
- climb();
- }
- if(!atmines2() && atsecondarymines()){
- walktomines2();
- }
- if(atmines2()){
- climb2();
- sleep(2000);
- }
- if(Banking.equals("Drop")){
- if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
- drop();
- }
- }
- if(Banking.equals("Bank")){
- if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
- bankrocks();
- }
- else if(!inventory.isFull() && !atrocks() && !getMyPlayer().isInCombat()) {
- walktorocksfrombank();
- }
- }
- if (!inventory.isFull() && !getMyPlayer().isInCombat() && atrocks()) {
- fishrocks();
- }
- }
- if(TypeofFish.equals("Cavefish")){
- if(atdraynorrocks() && inventory.getCount(cavebait) <= 5 && inventory.contains(rod)){
- getstuffcaves();
- }
- if(game.getPlane() == 0 && inventory.containsAll(cavestuff)){
- walktomines();
- }
- if(atmines()){
- climb();
- }
- if(!atmines2() && atsecondarymines()){
- walktomines2();
- }
- if(atmines2()){
- climb2();
- sleep(2000);
- }
- if(Banking.equals("Drop")){
- if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
- drop();
- }
- }
- if(Banking.equals("Bank")){
- if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
- bankrocks();
- }
- else if(!inventory.isFull() && !atrocks() && !getMyPlayer().isInCombat()) {
- walktorocksfrombank();
- }
- }
- if (!inventory.isFull() && !getMyPlayer().isInCombat() && atrocks()) {
- fishcaves();
- }
- }
- }
- }
- enableRun();
- sleep(100);
- mouse.setSpeed(mouseSpeed);
- return 100;
- }
- public void enableRun() {
- if (walking.getEnergy() > random(50, 100)
- && settings.getSetting(173) != 1) {
- walking.setRun(true);
- sleep(1000, 2000);
- }
- }
- @SuppressWarnings("deprecation")
- public boolean fishcaves() {
- if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) {
- RSNPC Spot = npcs.getNearest(cavesspot); // Finds nearest
- // fishing spot by ID
- if (Spot != null) {
- if (Spot.isOnScreen()) {
- camera.turnTo(Spot);
- Spot.doAction("Bait");
- sleep(800, 2400);
- } else if (!Spot.isOnScreen()) {
- walking.walkTo(Spot.getLocation());
- sleep(800, 2600);
- }
- }
- }
- return true;
- }
- @SuppressWarnings("deprecation")
- public boolean fishrocks() {
- if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) {
- RSNPC Spot = npcs.getNearest(rocksspot); // Finds nearest
- // fishing spot by ID
- if (Spot != null) {
- if (Spot.isOnScreen()) {
- camera.turnTo(Spot);
- Spot.doAction("Bait");
- sleep(800, 2400);
- } else if (!Spot.isOnScreen()) {
- walking.walkTo(Spot.getLocation());
- sleep(800, 2600);
- }
- }
- }
- return true;
- }
- public boolean bankrocks() {
- if (inventory.isFull() && !atrocksBank()) {
- walktobankfromrocks();
- }
- else if(inventory.isFull() && atrocksBank()) {
- depositrocks();
- }
- return true;
- }
- public boolean atrocksBank() {
- RSArea area = new RSArea(new RSTile(3650,5112), new RSTile(3657, 5116));
- return area.contains(getMyPlayer().getLocation());
- }
- public boolean atrocks() {
- RSArea area = new RSArea(new RSTile(3642,5079), new RSTile(3658, 5087));
- return area.contains(getMyPlayer().getLocation());
- }
- RSTile[] gotorocksbank = { new RSTile(3018, 3450), new RSTile(3023, 3459),
- new RSTile(3031, 3467), new RSTile(3044, 3472),
- new RSTile(3056, 3473), new RSTile(3065, 3485),
- new RSTile(3065, 3497), new RSTile(3073, 3502),
- new RSTile(3087, 3498), new RSTile(3094, 3493) };
- RSTile[] gotorocks = { new RSTile(3094, 3493), new RSTile(3087, 3498),
- new RSTile(3073, 3502), new RSTile(3065, 3497),
- new RSTile(3065, 3485), new RSTile(3056, 3473),
- new RSTile(3044, 3472), new RSTile(3031, 3467),
- new RSTile(3044, 3472), new RSTile(3031, 3467),
- new RSTile(3023, 3459), new RSTile(3018, 3450) };
- RSTile[] gotomines = { new RSTile(3092, 3502), new RSTile(3088, 3503),
- new RSTile(3084, 3504), new RSTile(3079, 3504),
- new RSTile(3074, 3506), new RSTile(3070, 3510),
- new RSTile(3064, 3510), new RSTile(3063, 3505),
- new RSTile(3063, 3500), new RSTile(3063, 3496),
- new RSTile(3063, 3491), new RSTile(3063, 3486),
- new RSTile(3063, 3481), new RSTile(3057, 3478),
- new RSTile(3055, 3473), new RSTile(3053, 3469),
- new RSTile(3047, 3470), new RSTile(3041, 3471),
- new RSTile(3035, 3471), new RSTile(3031, 3468),
- new RSTile(3026, 3466), new RSTile(3024, 3463),
- new RSTile(3021, 3460), new RSTile(3019, 3456),
- new RSTile(3015, 3455), new RSTile(3017, 3450) };
- RSTile[] gotomines2 = { new RSTile(3020, 9848), new RSTile(3020, 9844),
- new RSTile(3019, 9841), new RSTile(3019, 9837),
- new RSTile(3019, 9833), new RSTile(3016, 9832),
- new RSTile(3012, 9830) };
- private RSTile safespot = new RSTile(3654, 5113);
- public boolean walktobankfromrocks() {
- if(!atrocksBank()) {
- RSPath path = walking.newTilePath(gotorocks);
- path.traverse();
- }
- return true;
- }
- private boolean walktorocksfrombank(){
- if(!atrocks()) {
- RSPath path = walking.newTilePath(gotorocksbank);
- path.traverse();
- }
- return true;
- }
- @SuppressWarnings("deprecation")
- public boolean depositrocks() {
- RSObject Lift = objects.getNearest(rocksbank);
- if (Lift != null) {
- if (calc.distanceTo(Lift) <= 4) {
- Lift.doAction("Deposit");
- if (!interfaces.get(11).isValid()) {
- sleep(800, 2400);
- }
- if (interfaces.get(11).isValid()) {
- bank.depositAllExcept(dontDrop);
- }
- sleep(800, 2400);
- } else if (calc.distanceTo(Lift) > 4) {
- walking.walkTo(Lift.getLocation());
- sleep(800, 2600);
- }
- }
- return true;
- }
- public int myhp(){
- if (interfaces.get(748).getComponent(8).isValid()) {
- myhp = Integer.parseInt(interfaces.get(748).getComponent(8).getText());
- }
- return myhp;
- }
- public boolean rest(){
- return true;
- }
- public boolean runfromCombat() {
- if (getMyPlayer().isInCombat()) {
- startrunning = true;
- if (calc.distanceTo(safespot) > 4) {
- walktobankfromrocks();
- }else{
- rest();
- hpresting = true;
- }
- }
- else if(!getMyPlayer().isInCombat() && (myhp() > hitpoints)){
- hpresting = false;
- }
- return true;
- }
- public class ProFisherGUI extends JPanel {
- private static final long serialVersionUID = 1L;
- public ProFisherGUI() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- TypeofFish = comboBox2.getSelectedItem().toString();
- Banking = comboBox3.getSelectedItem().toString();
- mouseSpeed = slider1.getValue();
- hitpoints = Integer.parseInt(textField1.getText());
- amount = Integer.parseInt(textField2.getText());
- if (slider1.getValue() == 10) {
- mouseSpeed = 1;
- } else if (slider1.getValue() == 9) {
- mouseSpeed = 2;
- } else if (slider1.getValue() == 8) {
- mouseSpeed = 3;
- } else if (slider1.getValue() == 7) {
- mouseSpeed = 4;
- } else if (slider1.getValue() == 6) {
- mouseSpeed = 5;
- } else if (slider1.getValue() == 5) {
- mouseSpeed = 6;
- } else if (slider1.getValue() == 4) {
- mouseSpeed = 7;
- } else if (slider1.getValue() == 3) {
- mouseSpeed = 8;
- } else if (slider1.getValue() == 2) {
- mouseSpeed = 9;
- } else if (slider1.getValue() == 1) {
- mouseSpeed = 10;
- } else if (slider1.getValue() == 0) {
- mouseSpeed = 11;
- }
- start = true;
- guiWait = false;
- frame1.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- frame1 = new JFrame();
- label1 = new JLabel();
- label2 = new JLabel();
- label3 = new JLabel();
- comboBox1 = new JComboBox();
- label4 = new JLabel();
- comboBox2 = new JComboBox();
- comboBox3 = new JComboBox();
- label5 = new JLabel();
- button1 = new JButton();
- slider1 = new JSlider();
- label6 = new JLabel();
- label7 = new JLabel();
- textField1 = new JTextField("300");
- textField2 = new JTextField("200");
- label8 = new JLabel();
- label9 = new JLabel();
- label10 = new JLabel();
- //======== frame1 ========
- {
- Container frame1ContentPane = frame1.getContentPane();
- frame1ContentPane.setLayout(null);
- frame1.setVisible(true);
- frame1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- //---- label1 ----
- label1.setText("ProFisher");
- label1.setFont(new Font("Aerosol", Font.BOLD, 48));
- frame1ContentPane.add(label1);
- label1.setBounds(10, 5, 275, 50);
- //---- label2 ----
- label2.setText("By: Himekp");
- label2.setFont(new Font("Aerosol", Font.PLAIN, 36));
- frame1ContentPane.add(label2);
- label2.setBounds(55, 45, 220, 40);
- //---- label3 ----
- label3.setText("Location:");
- label3.setEnabled(false);
- label3.setFont(new Font("Tahoma", Font.PLAIN, 22));
- frame1ContentPane.add(label3);
- label3.setBounds(10, 95, 95, 30);
- //---- label4 ----
- label4.setText("Type of Fish:");
- label4.setFont(new Font("Tahoma", Font.PLAIN, 22));
- label4.setEnabled(false);
- frame1ContentPane.add(label4);
- label4.setBounds(10, 130, 135, 30);
- //---- label5 ----
- label5.setText("Banking:");
- label5.setEnabled(false);
- label5.setFont(new Font("Tahoma", Font.PLAIN, 22));
- frame1ContentPane.add(label5);
- label5.setBounds(10, 165, 95, 30);
- //---- button1 ----
- button1.setText("Start");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- button1.setFont(new Font("Tahoma", Font.PLAIN, 26));
- frame1ContentPane.add(button1);
- button1.setBounds(5, 380, 275, 100);
- //---- comboBox1 ----
- frame1ContentPane.add(comboBox1);
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Living Rock Caverns"
- }));
- comboBox1.setBounds(105, 95, 170, 30);
- //---- comboBox2 ----
- frame1ContentPane.add(comboBox2);
- comboBox2.setModel(new DefaultComboBoxModel(new String[] {
- "Rocktails",
- "Cavefish"
- }));
- comboBox2.setBounds(145, 130, 130, 30);
- //---- comboBox3 ----
- frame1ContentPane.add(comboBox3);
- comboBox3.setModel(new DefaultComboBoxModel(new String[] {
- "Bank",
- "Drop"
- }));
- comboBox3.setBounds(105, 165, 170, 30);
- //---- slider1 ----
- slider1.setMajorTickSpacing(1);
- slider1.setSnapToTicks(true);
- slider1.setPaintTicks(true);
- slider1.setPaintLabels(true);
- slider1.setMaximum(10);
- frame1ContentPane.add(slider1);
- slider1.setBounds(10, 230, 265, 40);
- //---- label6 ----
- label6.setText("Mouse Speed:");
- label6.setFont(new Font("Tahoma", Font.PLAIN, 22));
- label6.setEnabled(false);
- frame1ContentPane.add(label6);
- label6.setBounds(70, 200, 140, 30);
- //---- label7 ----
- label7.setText("HP to heal at:");
- label7.setEnabled(false);
- label7.setFont(new Font("Tahoma", Font.PLAIN, 16));
- frame1ContentPane.add(label7);
- label7.setBounds(10, 310, 115, 26);
- //---- textfield1 ----
- frame1ContentPane.add(textField1);
- textField1.setBounds(30, 355, 55, textField1.getPreferredSize().height);
- //---- label8 ----
- label8.setText("Rockfish/Cavefish Settings");
- label8.setEnabled(false);
- label8.setFont(new Font("Tahoma", Font.PLAIN, 18));
- frame1ContentPane.add(label8);
- label8.setBounds(new Rectangle(new Point(40, 280), label8.getPreferredSize()));
- //---- label9 ----
- label9.setText("Living Rock Material");
- label9.setEnabled(false);
- label9.setFont(new Font("Tahoma", Font.PLAIN, 16));
- frame1ContentPane.add(label9);
- label9.setBounds(135, 310, label9.getPreferredSize().width, 25);
- //---- textField2 ----
- frame1ContentPane.add(textField2);
- textField2.setBounds(180, 355, 55, textField2.getPreferredSize().height);
- //---- label10 ----
- label10.setText("Withdraw(If Dead)");
- label10.setEnabled(false);
- label10.setFont(new Font("Tahoma", Font.PLAIN, 14));
- frame1ContentPane.add(label10);
- label10.setBounds(new Rectangle(new Point(155, 335), label10.getPreferredSize()));
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < frame1ContentPane.getComponentCount(); i++) {
- Rectangle bounds = frame1ContentPane.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 = frame1ContentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- frame1ContentPane.setMinimumSize(preferredSize);
- frame1ContentPane.setPreferredSize(preferredSize);
- }
- frame1.pack();
- frame1.setLocationRelativeTo(frame1.getOwner());
- }
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- private JFrame frame1;
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- private JComboBox comboBox1;
- private JLabel label4;
- private JComboBox comboBox2;
- private JComboBox comboBox3;
- private JLabel label5;
- private JButton button1;
- private JSlider slider1;
- private JLabel label6;
- private JLabel label7;
- private JTextField textField1;
- private JTextField textField2;
- private JLabel label8;
- private JLabel label9;
- private JLabel label10;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment