[Source] Unfinished Fishing Bot [Help] menu

User Tag List

Results 1 to 11 of 11
  1. #1
    Molleren's Avatar Member
    Reputation
    2
    Join Date
    Nov 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Source] Unfinished Fishing Bot [Help]

    I am posting this 'cause I have major problems with it, which I hope you guys could help me with. I think the problem is when it is scanning. It lags like hell, and doesnt find bobber.

    I have never done Java except for this!

    Code:
    import java.awt.*;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import java.awt.image.BufferedImage;
    import java.awt.image.PixelGrabber;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    public class myBot{
        //USER VARIABLES
        public static int MAX_CASTS=  100;
        
        //KEY BINDINGS
        public static int FISHSKILL = 49, FISHINGPOLE = 50, BAIT = 51;
        
        //SYSTEM VARIABLE
        public static Robot myRobot;
        public static int PAUSE = 0, UNPAUSE = 1, RUNNING = 2;
        public static int MODE = PAUSE;
        public static int red = 0, green = 0, blue = 0;
        public static Color cBobber;
        public static Color cMouse;
        public static int bobberX = 0;
        public static int bobberY = 0;
      
        public static void main(String[] args)throws AWTException, IOException{
        myRobot = new Robot();
        
        //MAIN
        myRobot.delay(5000);
        System.out.println("5seconds");
        myRobot.delay(5000);
        int mX = MouseInfo.getPointerInfo().getLocation().x; //Get location
        int mY = MouseInfo.getPointerInfo().getLocation().y; //Get location 
        cMouse = myRobot.getPixelColor(mX, mY);
        red = cMouse.getRed();
        green = cMouse.getGreen();
        blue = cMouse.getBlue();
        //System.out.println(cMouse.getRGB());
        
        Fish();
        
      }
        
        public static void Fish(){
            //CAST FISHING POLE
            Press(FISHSKILL);
            myRobot.delay(5000);
            Aim(red, green, blue);
            
        }
    
        public static void Say(String a){
            //START CHAT WINDOW
            Press(KeyEvent.VK_ENTER); //PRESS ENTER
            
            for(int i=0; i<a.length(); i++){
                Press(((int)a.charAt(i)), 100);
            }
            
            Press(KeyEvent.VK_ENTER);
        }
        
        public static void Whisper(String a){
            //START WISPER BACK
            Press(KeyEvent.VK_R);
            
            for(int i=0; i<a.length(); i++){
                Press(((int)a.charAt(i)), 100);
            }
            
            Press(KeyEvent.VK_R);
        }
        
        public static void Press(int a, int time){
            myRobot.keyPress(a);
            myRobot.delay(time);
            myRobot.keyRelease(a);
        }
        
        public static void Press(int a){
            myRobot.keyPress(a);
            myRobot.delay(100);
            myRobot.keyRelease(a);
        }
        
        public static void MouseWheel(){
            myRobot.mouseWheel(-100);
        }
        
        public static String Input(String A) throws IOException{
            
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            System.out.println(A);
            String userInput = in.readLine();
            
            return userInput;
            
        }
        
        public static void getInputs(){
            
        }
        
        public static void LogOut(){
            Say("I have go now, dads yelling at me >_>. Bye.");
            myRobot.delay(2500); //Wait 2,5seconds before logging out. More human-like.
            Say("/logout");
            myRobot.delay(25000); //Waits 25seconds before doing continuing. This is only needed if not in city.
        }
        
        public static void Aim(int red, int green, int blue){
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            int centerX = screenSize.width / 2;
            int centerY = screenSize.height / 2;
            
            for(int x = centerX - 50; x < centerX + 50; x++){
                for(int y = centerY - 50; y < centerY + 50; y++){
                    cBobber = myRobot.getPixelColor(x, y);
                     
                    /*System.out.println(x); //TESTING PURPOSE
                    System.out.println(y);*/ //TESTIONG PURPOSE
                    if (cBobber.getRGB() == -16777216){
                        bobberX = x;
                        bobberY = y;
                        break;
                    }
                }
            }
            myRobot.mouseMove(bobberX, bobberY);
            Scan(bobberX, bobberY);
            System.out.println(bobberX);
            System.out.println(bobberY);
        }
        
        public static void Scan(int x, int y){
            boolean scanning = true;
            while (scanning == true){
                cBobber = myRobot.getPixelColor(x, y);
                if (cBobber.getRGB() != -16777216){
                    myRobot.mouseMove(x, y);
                    myRobot.delay(100);
                    myRobot.mousePress(InputEvent.BUTTON2_MASK);
                    myRobot.mouseRelease(InputEvent.BUTTON2_MASK);
                    myRobot.delay(2000);
                    Fish();
                    break;
                }
            }
        }
        
        public static int CompareRGB(Color c1, Color c2){
                if (c1.getRGB() > c2.getRGB()){
                    return c1.getRGB() - c2.getRGB();
                } else {
                    if (c1.getRGB() < c2.getRGB()){
                        return c2.getRGB() - c1.getRGB();
                } else {
                    return 0;
                }
                }
            
        }
        
    
    }

    [Source] Unfinished Fishing Bot [Help]
  2. #2
    Strichnine's Avatar Knight-Champion
    Reputation
    82
    Join Date
    Sep 2007
    Posts
    497
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why have you done 2 press methods?

    Code:
     public static void Press(int a, int time){
            myRobot.keyPress(a);
            myRobot.delay(time);
            myRobot.keyRelease(a);
        }
        
        public static void Press(int a){
            myRobot.keyPress(a);
            myRobot.delay(100);
            myRobot.keyRelease(a);
        }

  3. #3
    Molleren's Avatar Member
    Reputation
    2
    Join Date
    Nov 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Press(int a, int time) (the 1st one) has got custom time value, so you can hold down the button for longer. It's not being used for much though.

  4. #4
    Strichnine's Avatar Knight-Champion
    Reputation
    82
    Join Date
    Sep 2007
    Posts
    497
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea but when you use Press(); you will call both methods, wont it screw up then?

  5. #5
    Molleren's Avatar Member
    Reputation
    2
    Join Date
    Nov 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Muskeljulle View Post
    Yea but when you use Press(); you will call both methods, wont it screw up then?
    No you won't. Thought that at first, as I'm used to Delphi, VB and some C, but it's not the same in Java.

  6. #6
    Strichnine's Avatar Knight-Champion
    Reputation
    82
    Join Date
    Sep 2007
    Posts
    497
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool but, I've only read 2 courses in Java in school so Idon't know much about making bots and stuff with it, maybe ill use ur code for learning purposes, tho I dont know the answer of your question, sorry

  7. #7
    Molleren's Avatar Member
    Reputation
    2
    Join Date
    Nov 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't really got any questions. I'm completely new as well, I just hope somebody will take this code and improve it.

  8. #8
    Strichnine's Avatar Knight-Champion
    Reputation
    82
    Join Date
    Sep 2007
    Posts
    497
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im completely new as in never programmed before (atleast not an application outside of CMD-window)

  9. #9
    _duracell's Avatar Active Member
    Reputation
    43
    Join Date
    May 2007
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Muskeljulle View Post
    Yea but when you use Press(); you will call both methods, wont it screw up then?
    Java allows overloading methods.

    Java Quick Reference - Overloading, Overriding, Runtime Types and Object Orientation - Polymorphism

  10. #10
    Kissy's Avatar Active Member
    Reputation
    60
    Join Date
    Jun 2006
    Posts
    332
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Comment out has been placed after,
    system.out println.
    Last edited by >>Khurune<<; 08-23-2009 at 04:21 AM.

  11. #11
    Oaysis's Avatar Member
    Reputation
    1
    Join Date
    Sep 2009
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming you haven't already gotten an answer from somewhere else...

    First of all, you are calling Fish() recursively.
    Second, don't use breaks.
    Third, you have an endless loop in Scan().

Similar Threads

  1. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 2
    Last Post: 12-10-2024, 05:46 PM
  2. [Bot] SimpleFisher - C# SOURCE CODE fishing bot
    By llamafood in forum Rift
    Replies: 3
    Last Post: 10-13-2017, 07:17 AM
  3. Fishing Bot Help
    By nathan2022001 in forum WoW Memory Editing
    Replies: 1
    Last Post: 08-10-2009, 12:00 PM
  4. Help with fishing bots
    By Vagi99 in forum World of Warcraft General
    Replies: 1
    Last Post: 08-31-2006, 10:42 AM
  5. Fishing Bot Help
    By RichyG in forum World of Warcraft General
    Replies: 0
    Last Post: 07-05-2006, 01:26 AM
All times are GMT -5. The time now is 03:34 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search