jekirl / poketrainer

The original Pokemon Go bot
Other
120 stars 58 forks source link

Request: Set path of pokestops which should be visited #573

Open brainprince opened 8 years ago

brainprince commented 8 years ago

Hi there,

I was always wondering how the bot decides which path to take and when to go back to the starting point. In the line of this thoughts I asked myself if it would be possible to give him a bunch of coordinates (of pokestops e.g.) and in this way a clear defined path along which he should walk. You could give him a closed path so that he circulates along or let him go back and forth. If I catch pokemon myself I always go the same path knowing where the nests are and where the good pokemon spawns are. Additionally you could tell the bot to repeat the path 10 times and then to stop .... Just an idea, would be interesting to know if this is realizable.

piprees commented 8 years ago

I attempted to do this using the Multi Locations PR a week orso ago, but after the rebase the method I was using (walk_to_origin) no longer functions in the same way, and I'm too noob too understand how the new method gets its location/route data.

I'd love to know how the new function works properly so that I could add this feature back in; it's not -exactly- what you're looking for, however it made the bot do a "run" of one area before literally walking (not teleporting) to the next location and performing a "run" there too. It looped over however many locations you set, then went back to the original point specified in "location:".

Any pointers on how I'd go about restoring this PR, i'd love to hear. Adding the features you spoke about @brainprince wouldn't be much on top of that (setting a "max loop" in the config).

mhofer117 commented 8 years ago

Check out the PREDEFINED_PATH option available in the dev branch, it should offer exactly what you want. For example you can set:

      "PREDEFINED_PATH": [
        "38.xxx, -121.xxx",
        "38.xxx, -121.xxx",
        "38.xxx, -121.xxx"
      ]

and it will only walk to those 3 points then start at the first point again.

I suggest you make your route min. 15 minutes long for optimal xp/hr results.

there is no stopping behavior though!

piprees commented 8 years ago

Fantastic @destiny117 :) Works really well. I'm going to look into extending it by making a new fort_walker and having a play around, see what I can do to make the bot have a wander then camp out and patrol an area before moving on.

piprees commented 8 years ago

So i've been thinking about how to expand on this, here's what I have so far (really crap pseudo code, will try and get enough time to flesh it out this weekend)

L[] = predefined_locations
CurrentOrigin   #keep track of current origin in list (start at 0)
OriginListLength    #what is length of list of origin (back to 0 at end)
Switch = "SIMULATE_DRIVING" #if false, engage regular "Predefined_locations" walker system
Controller = "DRIVING_MODE" #If true, we are currently in driving mode. If false, we are in camping mode
TimeScale = "HANGAROUND_TIME" (set to 1/OriginListLength of RUNTIME_HOUR_LIMIT) #Dish out the time evenly between the locations. RHL gets randomised a bit too, so should stop it seeming so robotic.
ArrivalTime = time() (updates whenever arriving at new origin)

when "walk back to origin" is called
    #If enabled, and we have hung around here long enough:
    if SIMULATE_DRIVING = true & ((CurrentTime-ArrivalTime/OriginListLength) > HANGAROUND_TIME)
        #Get the new origin point
        get origin[CurrentOrigin] from L[]
        #Setup the next origin point
        increase CurrentOrigin +1
        if CurrentOrigin > OriginListLength: CurrentOrigin = 0
        #Speed up to simulate driving (If you typically bot slow enough to hatch eggs, this should roll out to < 40 or 50km/h)
        set step_size to step_size * randrange(4,5)
        #Stop catching pokemon, PoGO & drive is nono
        set catch_pokemon false

when arriving at location
    #Check if we are still in driving mode
    if SIMULATE_DRIVING = true AND if DRIVING_MODE = true
    #We are, so set it to false as we have arrived at our new origin
        DRIVING_MODE = false
        #Set step size back to normal and start catching pokemon again
        set step_size *1
        set catch_pokemon true

If this code makes any sense, this will simulate a player driving from one area to another, spinning the stops and catching pokemon, then moving on. It might slow the bot dramatically, but provide a wider range of pokemon (If the areas are different enough in terms of diversity). It also means that the bot will "camp" out an area for a while, if "stay_in_proximity" settings are quite low, before moving on to a new place when the timer expires. If you'd prefer to set constant circular path like the current system, it can be disengaged.

If anyone can spot any reasons this might not work, let me know :) EDIT: minor text fixes