Fishing Bot in Java Help menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Neverdie00's Avatar Member
    Reputation
    3
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fishing Bot in Java Help

    Hello MMowned!

    Recently I decided to try teaching myself Java and made a goal that I would try to make a fishing bot. This I quickly learned can be very dificult for someone just learning the language.

    I was wondering if I could get some feedback on the concept I am using in order to search for a pixel of a certain color (in this case it is white). Also, the code compiles and runs but never encounters a white pixel, I cant figure this one out because there are tons of white pixels on my screen!

    Any comments, critisicm, feedback or concerns are all welcome!

    Code:
    package fishingbot;
    
    import java.awt.*;
    import java.awt.event.*;
    
    public class FishingScanner {
    
        public static void main(String[] args) 
                          throws AWTException{
            
            int R = 255; int x = 0;
            int G = 255; int y = 0;
            int B = 255;
            
            Robot roboCop = new Robot();
            Color C = roboCop.getPixelColor(x, y);
            if ((C.getRed()==R) && (C.getGreen()==G) && (C.getBlue()==B)){ 
            
                System.out.println("White pixel found. " + x + y);
                
            }else{
           
                if (x == 1280){ //Thats how big my screen resolution is.
                    x=0;
                    y++;
                    C = roboCop.getPixelColor(x, y);
                }else{
                    x++;
                    C = roboCop.getPixelColor(x, y);
                }
            }
            
            
            
            
           
        }
    
        }
    Thanks to the people in this thread for filling my head with ideas
    http://www.mmowned.com/forums/progra...bot-class.html

    On a side note I read the the rules section but the link Apoc provides appears to be broken, I apoligize in advance if I have broken any.
    Last edited by Neverdie00; 03-22-2010 at 02:04 PM. Reason: Spelling

    Fishing Bot in Java Help
  2. #2
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So where is the loop going through all your pixels on your screen?
    Viano

  3. #3
    Neverdie00's Avatar Member
    Reputation
    3
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The logic that I am trying to implement works like this.

    1. Identify the pixel color of pixel x,y (x = 0, y =0)
    2. Check to see if the selected pixel meets the RGB codes for the color white.
    3. If it does not, it checks to see if integer "x" is == 1280

    3a. TRUE: Return x to other side of screen by setting it to 0 and go up a pixel row by incrementing y, Goto Step 1

    3b. FALSE: If x hasnt reached the other side of the screen then keep on going Goto Step 1

    I realize that what I have explained may not be indicative of what is written in the code. However from what I see (keep in mind that I picked up a book on java two weeks ago) that is what is represented in the code.

    I intend on adding some more code that checks to see if x == 1280 and y == 1024 in which case it would end the loop and say something like "pixel not found".

    Thanks a million for your quick response Viano!

  4. #4
    Neverdie00's Avatar Member
    Reputation
    3
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I reread the section in my book about the "if" statement and now I feel like a tool : /

    I now realize that the "if" statement does not act like a loop :P. While I may have learnt something new, it now leaves me to ponder how to make the loop. What my current train of thought is picturing is a while loop that evaluates true until x == 1280 and y == 1240 which kills too birds with one stone!

    Amazing what a third party perspective can bring to a project however simple it may be (thanks again Viano, it may not look like it but your post led me to the right direction).

  5. #5
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might want to learn to program (and I'm not talking about a language's syntax) prior to writing a bot of any kind.

    It will save yourself (and us) a severe headache.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  6. #6
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Neverdie00's Avatar Member
    Reputation
    3
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Robske - I'm all for saving the world from a bad headache Are there any resources you would recommend?

    !@^^@! - Nifty

  8. #8
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm feeling nice today so here's some code for ya

    Code:
    Robot roboCop = new Robot();
    for(int x = 0; x < ScreenX; x++) //ScreenX is the width of your screen
    {
            for(int y = 0; y < ScreenY; y++) //ScreenY is the hight of your screen
            { 
                 Color C = roboCop.getPixelColor(x, y);
                  if ((C.getRed()==R) && (C.getGreen()==G) && (C.getBlue()==B))
                 { 
                         System.out.println("White pixel found. " + x + y);
                  }
             }
        }
    }
    Last edited by !@^^@!; 03-22-2010 at 04:33 PM.

  9. #9
    Neverdie00's Avatar Member
    Reputation
    3
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EDIT: Thanks a billion !@^^@! for the source code but its so unsatisfying just ripping it off.
    I got it working my own way!
    Code:
    while (x < 1441 && y < 901){
            if ((C.getRed()==R) && (C.getGreen()==G) && (C.getBlue()==B)){
    
                System.out.println("White pixel found. " + x + ", " + y);
            }
                if (x == 1440){             //Thats how big my screen resolution is.
                    x=0;                    //Send x back to left side
                    y++;                    //Go up a row
                    C = roboCop.getPixelColor(x, y);
                }else{
                    x++;
                    C = roboCop.getPixelColor(x, y);
                }
            
            }
    Victory is sweet!

    White pixel found. 1286, 46
    White pixel found. 1287, 46
    White pixel found. 1288, 46
    White pixel found. 1289, 46
    White pixel found. 1290, 46
    White pixel found. 1291, 46
    White pixel found. 1292, 46
    White pixel found. 1293, 46
    White pixel found. 1294, 46
    White pixel found. 1295, 46
    White pixel found. 1296, 46
    White pixel found. 1297, 46
    White pixel found. 1298, 46
    White pixel found. 1299, 46
    White pixel found. 1300, 46
    White pixel found. 1301, 46
    White pixel found. 1302, 46
    White pixel found. 1303, 46
    White pixel found. 1304, 46
    White pixel found. 1305, 46
    White pixel found. 1306, 46
    White pixel found. 1307, 46
    White pixel found. 1308, 46
    Last edited by Neverdie00; 03-22-2010 at 09:24 PM.

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. Ultimate Fishing Bot i need help!!!!!!!!!
    By zeks777 in forum World of Warcraft General
    Replies: 1
    Last Post: 01-13-2007, 07:14 PM
  3. help with ultimate fishing bot
    By ragingazn628 in forum World of Warcraft Bots and Programs
    Replies: 12
    Last Post: 11-25-2006, 02:53 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 04:12 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