What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Data from a week with Pokefarmer

j0sh77

New Member
Joined
Jan 12, 2017
Messages
12
Hello everyone!

I just started using Pokefarmer on January 4th with a new account. I've been running it about 8 hours a day since then with a walking pace, looting Pokestops, and catching Pokemon. I'm running this in a college town in Michigan.

Within this time, I've caught 4,757, hatched 48, and reached level 26.

Here's a spreadsheet showing the data.

If you'd like to count your own results, feel free to use this Java code to count caught/hatched. I may add more fields to analyze in the future, but for now this is what I have!

Code:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Hashtable;

public class Counter {

	public static void main(String[] args) throws IOException {
		Hashtable<String, Integer> caught = new Hashtable<String, Integer>();
		Hashtable<String, Integer> hatched = new Hashtable<String, Integer>();
		File f = new File("FULL-PATH-TO-THIS-FOLDER/PokeFarmer 1.0.166/Logs");

	    File[] files = f.listFiles();
	    for (File file : files) {
	    	//filter directories and non .txt
	        if(file.isDirectory() || !file.getCanonicalPath().contains(".txt"))continue;
	        
	        try(BufferedReader br = new BufferedReader(new FileReader(file))) {
	            for(String line; (line = br.readLine()) != null; ) {
	            	//caught
	            	if(line.contains("Trying to catch Pokemon")){
		            	String pokemon = line.substring(101, line.indexOf(" CP("));
		                addValue(caught, pokemon);
	            	}

	            	//hatched
	            	if(line.contains("hatched from egg")){
		            	String pokemon = line.substring(85, line.indexOf("</b></font>"));
		                addValue(hatched, pokemon);
	            	}
	            }
	        }
	    }
	    
	    //print results 
	    
	    System.out.println("CAUGHT:");
	    for (String key : caught.keySet()) {
	        System.out.println(key + "\t" + caught.get(key));
	    }

	    System.out.println("\n\n\nHATCHED:");
	    for (String key : hatched.keySet()) {
	        System.out.println(key + "\t" + hatched.get(key));
	    }
	    
	}
	
	//add values to hashtables
	static void addValue(Hashtable<String, Integer> map, String word) {
	    if (map.containsKey(word)) {
	      map.put(word, map.get(word) + 1);
	    } else {
	      map.put(word, 1);
	    }
	  }
}
 
Oh, this is cool... thanks, but:
Any tips how I have to compile this?
I save the code in a text-file. Ending of the file must be? *.js? How can I execute?
 
Oh, this is cool... thanks, but:
Any tips how I have to compile this?
I save the code in a text-file. Ending of the file must be? *.js? How can I execute?

Yep! Save the code in a file, but with the extension .java (which doesn't really matter, but it's good to stick to convention).

  1. Make sure you have a Java Development Kit (JDK) installed
  2. Save this code to a file
  3. Put in your own Pokefarmer Log location in place of FULL-PATH-TO-THIS-FOLDER/PokeFarmer 1.0.166/Logs
  4. Open this folder in command prompt (shift-right click, Open Command Window here)
  5. Type "javac FILENAME.java", where FILENAME is what you named the code file, and press enter
  6. Type "java FILENAME", note: without the .java, and press enter
  7. Your results will print out

Hopefully this helps. :)
 
So it works, but I need the keywords for german please :)
The line "Trying to catch pokemon" is "Versuche Pokemon zu fangen" in german. But also with this change it doesn't work, only for hatched pokemon :)
I would looking forward for a german code :)

Code:
INFO <b><font color="#0094FF">[19:28:41]</font></b> Versuche Pokemon <font color="#0094FF"><b>Rhyhorn CP(1166) IV(36)</b></font> with <b><font color="#0094FF">Ultraball</font></b> zu fangen...
INFO <b><font color="#0094FF">[19:28:41]</font></b> Straight ball and Great-Hit!
INFO <b><font color="#0094FF">[19:28:42]</font></b> <b><font color="#0094FF">Rhyhorn CP(1166) IV(36)</font></b> geschnappt!
 
So it works, but I need the keywords for german please :)
The line "Trying to catch pokemon" is "Versuche Pokemon zu fangen" in german. But also with this change it doesn't work, only for hatched pokemon :)
I would looking forward for a german code :)

Code:
INFO <b><font color="#0094FF">[19:28:41]</font></b> Versuche Pokemon <font color="#0094FF"><b>Rhyhorn CP(1166) IV(36)</b></font> with <b><font color="#0094FF">Ultraball</font></b> zu fangen...
INFO <b><font color="#0094FF">[19:28:41]</font></b> Straight ball and Great-Hit!
INFO <b><font color="#0094FF">[19:28:42]</font></b> <b><font color="#0094FF">Rhyhorn CP(1166) IV(36)</font></b> geschnappt!


I got you covered. Take a look at the settings section I added to the top. This should work, but is not tested in other languages.
Also, make sure any double quotes (") are preceded by a back slash (\). Take a look at my lines below for examples.

Code:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Hashtable;

public class Counter {

	public static void main(String[] args) throws IOException {

		//SETTINGS
		//this is where your logs are located. use full path.
		String logLocation = "PUTYOURLOCATIONHERE/PokeFarmer 1.0.166/Logs";
		//lines are everything preceding the pokemon's name
		//phrases are the phrases used to tell us what was done. in english, catch is "Trying to catch" and hatch is "hatched from egg"
		String catchPokemonLine = "INFO <b><font color=\"#0094FF\">[04:08:13]</font></b> Trying to catch Pokemon <font color=\"#0094FF\"><b>";
		String catchPokemonPhrase = "Trying to catch";
		String hatchPokemonLine = "INFO <b><font color=\"#0094FF\">[13:38:09]</font></b> Pokemon <font color=\"#FFB200\"><b>";
		String hatchPokemonPhrase = "hatched from egg";
		//use this if you want to specify a date. leave blank if you don't. format the same as a log file (ex. 2017-01-11)
		String date = "";



		Hashtable<String, Integer> caught = new Hashtable<String, Integer>();
		Hashtable<String, Integer> hatched = new Hashtable<String, Integer>();
		File f = new File(logLocation);

		File[] files = f.listFiles();
		for (File file : files) {
			//filter directories and non .txt
			if(file.isDirectory() || !file.getCanonicalPath().contains(".txt")) continue;
			if(!date.isEmpty() && !file.getName().contains(date)) continue;

			try(BufferedReader br = new BufferedReader(new FileReader(file))) {
				for(String line; (line = br.readLine()) != null; ) {
					//caught
					if(line.toLowerCase().contains(catchPokemonPhrase.toLowerCase())){
						String pokemon = line.substring(catchPokemonLine.length(), line.indexOf(" CP("));
						addValue(caught, pokemon);
					}

					//hatched
					if(line.toLowerCase().contains(hatchPokemonPhrase.toLowerCase())){
						String pokemon = line.substring(hatchPokemonLine.length(), line.indexOf("</b></font>"));
						addValue(hatched, pokemon);
					}
				}
			}
		}

		//print results 
		System.out.println("Results for " + (date.isEmpty() ? "all dates" : date) + ":\n");
		System.out.println("CAUGHT:");
		for (String key : caught.keySet()) {
			System.out.println(key + "\t" + caught.get(key));
		}

		System.out.println("\n\n\nHATCHED:");
		for (String key : hatched.keySet()) {
			System.out.println(key + "\t" + hatched.get(key));
		}

	}

	//add values to hashtables
	static void addValue(Hashtable<String, Integer> map, String word) {
		if (map.containsKey(word)) {
			map.put(word, map.get(word) + 1);
		} else {
			map.put(word, 1);
		}
	}
}
 
So it works, thanks :)
But this counts also the pokemon, which fled isn't it?

Code:
INFO <b><font color=\"#0094FF\">[04:08:13]</font></b> Trying to catch Pokemon <font color=\"#0094FF\"><b>"



This is the line, where the pokemon is caught.
Code:
INFO <b><font color="#0094FF">[12:09:16]</font></b> <b><font color="#0094FF">Nidoran? CP(69) IV(56)</font></b> geschnappt!
At this time the the pokemon is in my pocket. When I try to catch the pokemon, it could flee or not?

But very interesting tool, thanks :)
 
Last edited:
So it works, thanks :)

No problem. :)

But this counts also the pokemon, which fled isn't it?

Code:
INFO <b><font color="#0094FF">[12:09:16]</font></b> <b><font color="#0094FF">Nidoran? CP(69) IV(56)</font></b> geschnappt!

Could you post what settings you're using?

Edit: Also, copy and paste one of your logs that's in German?
 
Code:
INFO <b><font color="#0094FF">[15:46:33]</font></b> Gestartet
INFO <b><font color="#0094FF">[15:46:34]</font></b> Die nächste Pause ist in 54 Minuten.
INFO <b><font color="#0094FF">[15:46:43]</font></b> Versuche Pokemon <font color="#0094FF"><b>Hitmonlee CP(283) IV(27)</b></font> with <b><font color="#0094FF">Pokeball</font></b> zu fangen...
INFO <b><font color="#0094FF">[15:46:43]</font></b> Straight ball and Nice-Hit!
INFO <b><font color="#0094FF">[15:46:44]</font></b> Pokemon <font color="#FFB200"><b>Hitmonlee</b> entwischt. Versuche es nochmal.</font>
INFO <b><font color="#0094FF">[15:46:50]</font></b> Versuche Pokemon <font color="#0094FF"><b>Hitmonlee CP(283) IV(27)</b></font> with <b><font color="#0094FF">Pokeball</font></b> zu fangen...
INFO <b><font color="#0094FF">[15:46:50]</font></b> Straight ball and Nice-Hit!
INFO <b><font color="#0094FF">[15:46:51]</font></b> <b><font color="#0094FF">Hitmonlee CP(283) IV(27)</font></b> geschnappt!

This is a example:
first line = starting bot
second line = next break is in 54 minutes
third line = Trying to catch Hitmonlee
fourth line = nice hit
fifth line = pokemon break out of pokeball, try again
sixth line = trying to catch
seventh line = nice hit
eigth line = caught hitmonlee successfull

Your code uses the line "trying to catch", or isn't it?
But the pokemon could break out or flee. When it breaks out, the bot tries again.

Code:
String catchPokemonLine = "INFO <b><font color=\"#0094FF\">[04:08:13]</font></b> Trying to catch Pokemon <font color=\"#0094FF\"><b>";
String catchPokemonPhrase = "Trying to catch";
This is your code, I think he counts this lines, or isn't it? Maybe I'm wrong, I don't know exactly what your code is doing.


EDIT:
Code:
INFO <b><font color="#0094FF">[10:22:50]</font></b> Trying to catch Pokemon <font color="#0094FF"><b>Magnemite CP(261) IV(78)</b></font> with <b><font color="#0094FF">Greatball</font></b>...
INFO <b><font color="#0094FF">[10:22:50]</font></b> Curve ball and Nice-Hit!
INFO <b><font color="#0094FF">[10:22:52]</font></b> Caught <b><font color="#0094FF">Magnemite CP(261) IV(78)</font></b> successfully.

This is a example of an english log. Also here the line "caught mangemite successfully" is the right line, "trying to catch" is the try, but the pokemon is not caught.
 
Last edited:
This is your code, I think he counts this lines, or isn't it? Maybe I'm wrong, I don't know exactly what your code is doing.

Good catch. Yeah, that was my bad. Change these two settings to look like this:

Code:
String catchPokemonLine = "INFO <b><font color=\"#0094FF\">[15:46:51]</font></b> <b><font color=\"#0094FF\">";
String catchPokemonPhrase = "geschnappt";

This code searches for the word "geschnappt". If it's in a line, it will find the Pokemon's name and count it. As long as "geschnappt" is only used in the "caught successfully" line, it will only count those.
 
good work j0sh77, now it's working and counts the caught pokemon :)
thx a lot :)
 
Back
Top