Jump to content

[Tool] Automatic Encounter Counter *updated*


Recommended Posts

On 4/8/2020 at 5:16 PM, CaptnBaklava said:

Thats a common problem I myself did not find a solution for this.

@Fixedgaming a couple things I've noticed.

 

1) Your counter adds in your Pokemon as an encounter when it shouldn't. Decrease it by one before incrementing the count. Unless I've done something wrong during setup, but based on the source code you have some OCR going to count the number of times HP appears on screen.

2) Make an "Always on Top" option please, on a single display system there shouldn't be a reason to snap the client window to the side to set this up and see your counter.

3) To fix the issue of multiple counts per encounter if someone battles and doesn't run you need to require the user not have the overworld rendered in battle. This will produce a black screen around the battle UI. After that you should solicit user input for a single point outside the battle UI, set the flag for in battle after you increment the counter, and check for the pixel to no longer be black. Once the selected pixel is no longer black, clear the flag. Encounters will no longer be counted incorrectly. As it currently sits, a single 5 Pokemon horde can produce a count of up to 27 per battle if the user does not flee. The user should not be required to flee to use this program to get a correct count.

Link to comment
  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

Error when execute initial_setup.bat

 



  Using cached PyMsgBox-1.0.8.tar.gz (18 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:

Link to comment
On 7/30/2020 at 1:17 PM, linkzt said:

Error when execute initial_setup.bat

 

 

  Reveal hidden contents

 

 


  Using cached PyMsgBox-1.0.8.tar.gz (18 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
 

 

 

The last edit of the main post are february, so the program is outdated and currently doesn´t work.

But let me say an annotation, if the people are triying to find shiny´s with these type of tools... you´re going to waste yout time, the shiny ratio is... really low, and with a counter you dont get a real estimation of how more pokemon you need too see to get a wild shiny.

I´m a software dev too, and the last year i maded a similar tool like this (only for personal use), and with Premium of 30 days + 30K of PP Berrys (to don´t move and restore sweet scent PP´s) i got more than 27k+ encounter and i don´t got any shiny.

You need a lot of luck to find a shiny, tools like this doesn´t gonna to help anyone to find one of them. (Or you can try the combo of the ticket + Shiny amulet x4 in party, that reduces the shiny´s ratio to 1/22000 if i´m not wrong)

Its only a tip, everyone is free to try these type of tools, but by personal experience, this doesn´t work.

Link to comment
7 hours ago, Digifanatic said:

The last edit of the main post are february, so the program is outdated and currently doesn´t work.

But let me say an annotation, if the people are triying to find shiny´s with these type of tools... you´re going to waste yout time, the shiny ratio is... really low, and with a counter you dont get a real estimation of how more pokemon you need too see to get a wild shiny.

I´m a software dev too, and the last year i maded a similar tool like this (only for personal use), and with Premium of 30 days + 30K of PP Berrys (to don´t move and restore sweet scent PP´s) i got more than 27k+ encounter and i don´t got any shiny.

You need a lot of luck to find a shiny, tools like this doesn´t gonna to help anyone to find one of them. (Or you can try the combo of the ticket + Shiny amulet x4 in party, that reduces the shiny´s ratio to 1/22000 if i´m not wrong)

Its only a tip, everyone is free to try these type of tools, but by personal experience, this doesn´t work.

Of course tools like this don't help you find a shiny - but players like to keep track of their encounter amount. After all, RNG is RNG. 

In addition, the best shiny rate you can get from single encounter is approximately 1/24300 (with donator (10%) + shiny charm (10%)). In fact, it goes from 1/30k -> 1/27k (+10%) -> 1/24.3k (another +10%, which is calculated from 1/27k). Shiny charms do not stack. You can read more details in my shiny hunting guide:

Have a good day. 

Link to comment
3 hours ago, Sethsen said:

In addition, the best shiny rate you can get from single encounter is approximately 1/24300 (with donator (10%) + shiny charm (10%)). In fact, it goes from 1/30k -> 1/27k (+10%) -> 1/24.3k (another +10%, which is calculated from 1/27k). Shiny charms do not stack.

If you farm hordes of 5 your effective rate becomes and impressive 1/4860 since 5 encounters each with a 1/24.3k chance becomes 5/24.3k. While each roll is independent, you are knocking 5 encounters out in one fell swoop.

Link to comment
3 hours ago, XelaKebert said:

If you farm hordes of 5 your effective rate becomes and impressive 1/4860 since 5 encounters each with a 1/24.3k chance becomes 5/24.3k. While each roll is independent, you are knocking 5 encounters out in one fell swoop.

Correct! As I wrote in my message, that was for single encounter. ^^

Link to comment
On 8/1/2020 at 2:49 AM, Digifanatic said:

The last edit of the main post are february, so the program is outdated and currently doesn´t work.

But let me say an annotation, if the people are triying to find shiny´s with these type of tools... you´re going to waste yout time, the shiny ratio is... really low, and with a counter you dont get a real estimation of how more pokemon you need too see to get a wild shiny.

I´m a software dev too, and the last year i maded a similar tool like this (only for personal use), and with Premium of 30 days + 30K of PP Berrys (to don´t move and restore sweet scent PP´s) i got more than 27k+ encounter and i don´t got any shiny.

You need a lot of luck to find a shiny, tools like this doesn´t gonna to help anyone to find one of them. (Or you can try the combo of the ticket + Shiny amulet x4 in party, that reduces the shiny´s ratio to 1/22000 if i´m not wrong)

Its only a tip, everyone is free to try these type of tools, but by personal experience, this doesn´t work.

This tool is not outdated, make sure to follow the steps provided in the tutorial to start it, and nope this tool won't help u with getting shinies. 

Link to comment
  • 2 weeks later...

Why not convert this to an executable so that it's easier to install for people that don't want to deal with installing python? The program is simple enough that converting shouldn't be difficult.

 

edit: then again I forget how nicely pygame converts to .exe...

Edited by Gilan
Link to comment
  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...

Please update the tutorial with new python patch. I did the exact same steps of the tutorial and its not working. When I enter ''python'' in CMD it redirect me in windows shop to download python again ..

 

EDIT : NVM I found a video on youtube and it worked :) Thanks

Edited by wigglediggle
Problem Solved
Link to comment
  • 2 weeks later...
  • 1 month later...

I got this working on Linux (Xubuntu 18.04). Mostly, I followed the steps of the OP.  But, here are the additional steps that I had to do to make this work.

 

Step 1: Skip. Xubuntu comes with Python, no need to download Windows version of Python.

Step 2: Download the file as described

Step 3: Skip. I will be using a different method. I will be running it from the terminal (xfce4-terminal, although all terminals should work). Which shell you use shouldn't matter.

Step 4: This is where the differences begin. I opened the "initial_setup.bat" file, then modified each line from "python -m ..." to "python3 -m ..." (Yes, it uses Python3.) I then copied each line and pasted it to the terminal to run it.

Also, I had to install the following program (requires administrator privilages).

sudo apt-get install scrot

Step 5: I edited "encounter_counter.pyw" with my favorite text editor (leafpad). Then, I changed the Character Coding to Linux encoding (from windows) (LF only) and save the file. To run the script, in the terminal, use two commands (corrected for my unzipped location):

cd /path/to/script/folder

python3 /path/to/script/folder/encounter_counter.pyw

Step 6: Follow as instructed.

 

If you want to have the counter on top of other windows, right click on it's entry on the task bar, and select "On Top of Other Windows" or similar methods for your Desktop Environment.

 

Also note that for my personal taste, I added the hash-bang (#!/usr/bin/python3) at the start of the python script and marked the executable flag because I prefer just typing the file name.

 

Hopefully this will help those Linux users out there.

 

Edit: Forgot to mention the installation of scrot and a few font changes.

 

 

Edited by WingCommander
adding installation of scrot program
Link to comment

I noticed that the script was double-plus-one counting. I made a few modifications and it seems to be working better now. I include the diff command and output here (comparing the old version with mine) for the OP. Among the changes, I add a simple python header (for linux hash-bang, and to indicate the source) and modify the main() function call to be standard python.

 

Spoiler

diff encounter_counter.pyw encounter_counter_new.pyw

0a1,3
> #!/usr/bin/python3
> # https://forums.pokemmo.eu/index.php?/topic/109206-tool-automatic-encounter-counter-updated/
>
12a16,17
> encounter_reset_count = 10 # number of loops to delay before saying encounter is over (for AoE moves, etc that remove hp boxes temporarily)
> hp_box_top_tolerance = 50 # in percent -- percentage difference tolerance for enemy pokemon hp boxes to be, to detect play hp box
14c19,20
< global clicked
---
> global hp_box_top, clicked
> hp_box_top = -1
88a95,110
> def remove_player_hp(hp_boxes):
>     if len(hp_boxes) > 0:
>         trimmed_hp_boxes = hp_boxes.copy()
>         global hp_box_top
>         for box in hp_boxes:
>             if hp_box_top < 0 or box.top < hp_box_top:
>                 hp_box_top = box.top
>             elif (box.top - hp_box_top) * 100 / hp_box_top > hp_box_top_tolerance:
>                 # remove player's pokemon from the trimmed_hp_boxes list
>                 trimmed_hp_boxes.remove(box)
>         trimmed_hp_boxes.insert(0,len(trimmed_hp_boxes))
>         return trimmed_hp_boxes
>     else:
>         return [-1]
>
>
101a124,125
>     encounter_reset_delay = -1
>     max_matches = 0
139,141c163,166
<             matches = len(search_for_hp("ec_resources/hp_img.png"))
<             if matches > 0:
<                 if not in_encounter:
---
>             matches = remove_player_hp(search_for_hp("ec_resources/hp_img.png"))[0]
>             if matches >= 0:
>                 if not in_encounter and matches > 0:
>                     max_matches = matches
144a170,174
>                 elif matches > max_matches:
>                     encounters += (matches - max_matches)
>                     max_matches = matches
>                     update_encounters(screen, main_screen, encounters)
>                 encounter_reset_delay = encounter_reset_count
146c176,180
<                 in_encounter = False
---
>                 encounter_reset_delay -= 1
>                 if encounter_reset_delay < 0:
>                     encounter_reset_delay = -1
>                     max_matches = 0
>                     in_encounter = False
156c190,192
< main()
---
> # This is the standard boilerplate that calls the main() function.
> if __name__ == '__main__':
>   main()

 

 

Edit: Initial fix did not work as expected. Fixed the code again and replaced the code in post for the update.

Edit 2: Another minor code change, and formatting change.

 

Edited by WingCommander
minor code correction
Link to comment
On 1/16/2021 at 6:35 AM, Sintatic said:

Why can't I open "encounter_counter" file? I just can run the counter by the "start" icon. Any clue?

The "encounter_counter.pyw" is a plain ASCII text file. Notepad can open it for example. However, with the file extension "pyw", your computer doesn't know how to open it (which should be to call the Python interpreter, passing the file as an argument). However, "start.bat" is ALSO a plain ASCII text file. But, with the file extension "bat", Windows know how to execute each line (if properly formatted).

Link to comment
21 minutes ago, WingCommander said:

The "encounter_counter.pyw" is a plain ASCII text file. Notepad can open it for example. However, with the file extension "pyw", your computer doesn't know how to open it (which should be to call the Python interpreter, passing the file as an argument). However, "start.bat" is ALSO a plain ASCII text file. But, with the file extension "bat", Windows know how to execute each line (if properly formatted).

Oh right, this file is just the code start icon calls, ty

Link to comment
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.