Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gym/Pokestop Scan Scheduler #2498

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

fosJoddie
Copy link
Contributor

@fosJoddie fosJoddie commented Feb 18, 2018

Implements a gym scan scheduler.
Update: now also a pokestop scan scheduler if you're into knowing about lured spots.
Anything mentioning gyms in the description probably also goes for pokestops.

Description

Currently, the "best" way to mass scan gyms for raid alerts is to use hex scan in tandem with a carefully crafter geofence around the gyms involved.

This is very tedious work and might even skip a gym or two if you are experimenting with tiny geofences.

WARNING
Since gyms can be scanned at any speed, this scheduler will most likely not be able to spin pokestops and make fresh accounts level 2. This means you have to prepare accounts by using the levelup tool, or use already shadowbanned 2nd hand accounts.

This scheduler asumes that you have discovered all gyms in your area by using a traditional hex scan or speed scheduler first. Any gyms discovered in the process of scanning, won't be clustered until next restart of the instance.

EDIT: If you made it this far, you enable the scheduler with -scheduler: FortSearch

Introducing
The gym scan scheduler

  • Finds any gym already in your database
  • Clusters the gyms to optimize search area
  • Supports geofencing to narrow down area
  • uses scan-delay with # of workers to adjust how often all gyms are scanned.
  • toggle gyms/pokestops with -ng -nk

Motivation and Context

With the current short lifespan of accounts, this scheduler allows for a minimum of accounts to scan for
raids.

How Has This Been Tested?

Running for a week with little to no explosions

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@The-Real-Ketchum-Dev
Copy link

I like this option.. Will this have an option in the config sort of like spawn point scan or speed scan?

@friscoMad
Copy link
Contributor

Seems ok, my 3 comments:

  • Spawnpoint cluster maybe can extend this cluster system, to avoid having mostly duplicated code (I know it is not the same as spawnpoint need to check appear/disappear times).
  • Geofence before clustering, otherwise it will scan gyms outside the fence, it can happen anyway but in a lesser extent if done in this order.
  • Maybe it is the right time to have a single flag with different values for the scheduler, you can not set several at the same time and some schedulers are defined by strange flags (skip if empty) so it will be a lot clearer if we had -scheduler: speed or -scheduler: hex

@fosJoddie
Copy link
Contributor Author

Yeah I looked at reusing existing cluster code. Can probably just reuse the same code from Spawnpoint Scan.

Gf first is coming.

I did not want to start redoing the logic of how schedulers are selected. That would make this pr a breaking change. I’m not against doing that tho, naturally.

@SkOODaT
Copy link

SkOODaT commented Feb 18, 2018

thier was a fort only scanning mode PR created allready.... ive been using it to scan stops and gyms for months and its worked fine lol

#1957

i removed the need for dumping but to scan just stops and gyms this works great.... i use it to lure

@fosJoddie
Copy link
Contributor Author

@SkOODaT that PR was closed a long time ago, and used a somewhat different approach. Not sure what lures has to do with scanning gyms. The intent for this PR is to discover raids, and little more.

@SkOODaT
Copy link

SkOODaT commented Feb 18, 2018

@fosJoddie the other PR was able to do forts in general so gyms for raids or gym data and pokestops for lured pokemon/luring stops for those who have it would be nice if this PR did ALL forts like the other one but just a suggestion

@michikrug
Copy link
Contributor

Also running #1957 for a really long time now. It works okay. But I do see a lot of space for improvement. Therefore, I am looking forward to see how this approach develops.

@fosJoddie
Copy link
Contributor Author

fosJoddie commented Feb 18, 2018

@SkOODaT luring stops will never be a part of RM, it's directly interrupting the game economy in a negative way.

Sorry for tagging you wrongly @The-Real-Ketchum-Dev - my bad

@The-Real-Ketchum-Dev
Copy link

The-Real-Ketchum-Dev commented Feb 18, 2018 via email

@The-Real-Ketchum-Dev
Copy link

Sorry only seen the email and cut it off.. All good bud

@SkOODaT
Copy link

SkOODaT commented Feb 18, 2018

@fosJoddie i never said anything about adding luring to this lmao but fort scanning all forts is beneficial in other ways, such as gathering stop information.....

@fosJoddie
Copy link
Contributor Author

@friscoMad I started reworking the scheduler flags to use the single -scheduler. My only mystery guest is skip-empty which I feel like is a bad name for "hex scan minus the parts with no results".

Code now reuses the clustering from spawnpoint - I'm not sure if it broke anything with spawnpoint scheduler.

Geofencing now happens before clustering

@friscoMad
Copy link
Contributor

Not tested but the code seems to be good, thanks for taking the effort to refactor clustering and looking at -scheduler I agree that it should be in a another PR.
Skip-empty could be renamed to hex-noEmpty or something like that, right now that flag it is the worst one as no one identifies that flag with a scheduler and it takes precedence over other scheduler flags.

@fosJoddie fosJoddie changed the title [WIP/RFC] Gym Scan Scheduler [beta] Gym Scan Scheduler Feb 19, 2018
@fosJoddie fosJoddie changed the title [beta] Gym Scan Scheduler Gym Scan Scheduler Feb 19, 2018
@fosJoddie fosJoddie changed the title Gym Scan Scheduler Gym/Pokestop Scan Scheduler Feb 19, 2018
@fosJoddie
Copy link
Contributor Author

I felt like the extra work to make another pr for -scheduler was not worth it. Can split this into to PR if the scope is now too big.

PR can now scan for pokestops as well as gyms.
PR now has new argument: -scheduler that inputs what scheduler you want to use

TODO:
I have a feeling -bh is not going to be friends with this scheduler

pogom/utils.py Outdated
parser.add_argument('-sch', '--scheduler',
help=('Set scan scheduler to use. One of: '
'hex, spawnpoint, speed, gym'),
type=str, default='hex')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add choices to force validation as -wh-types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--skip-empty is no longer needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we should also change default to SpeedScan

pogom/utils.py Outdated
args.scheduler = 'HexSearch'
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if choices is added to the add argument.
And maybe the valid values should be the full name of the scheduler, that saves us for this translation code and makes configuration more inline with the docs.

@fosJoddie
Copy link
Contributor Author

Changed argument parser to use real names of scanners.

SpeedScan is now the default - gonna break configs that run without any scheduler flags.

I won't remove skip-empty, since that would be removing a full scheduler that I guess some people might be using. it is named HexSearchSpawnpoint now.

The names of the schedulers could be shortened a whole lot tho, since they are only referenced on Sceduler creation and a few odd places in code. Not sure what best course of action would be

@friscoMad
Copy link
Contributor

Umm just saying that we should remove the --skip-empty flag now that we have -scheduler HexSearchSpawnpoint

@fosJoddie
Copy link
Contributor Author

Ohh. Then we are in complete agreement.

The flag is removed. 👌

@darkelement1987
Copy link
Contributor

Is this ready to be merged?

@fosJoddie
Copy link
Contributor Author

@darkelement1987 it's ready to be tested - I just rebased and fixed conflicts

@billyjbryant
Copy link
Contributor

@fosJoddie, needs to be rebased again. Once it is I can test it.

@fosJoddie
Copy link
Contributor Author

@billyjbryant thanks for the heads up, it has been rebased back into former glory

Make a FortSearch scheduler for Gym and Pokestop scanning
Move arguments for schedulers into a single parameter "scheduler"
Make a FortSearch scheduler for Gym and Pokestop scanning
Move arguments for schedulers into a single parameter "scheduler"
# based on step size.
#scheduler: HexSearchSpawnpoint # Hex scan with skipping of empty cells.
# Normal hex scan must have been ran at least once.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line 62 can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants