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

Experimental #5002 #5106

Merged
merged 4 commits into from
Sep 3, 2016
Merged

Experimental #5002 #5106

merged 4 commits into from
Sep 3, 2016

Conversation

sohje
Copy link
Contributor

@sohje sohje commented Sep 2, 2016

Short Description:

Experimental wait at fort with lure module plugged

Fixes/Resolves/Closes (please use correct syntax):

To enable:

      {
        "type": "MoveToFort",
        "config": {
            "enabled": true,
            "lure_attraction": true,
            "lure_max_distance": 1000,
            "wait_on_lure": true,
            "log_interval": 5
        }
      }

TODO:

  • Need some tests (already spent 15 lure modules)
  • Implement wait at fort for specified amount of time config option (like: wait_on_lure_max: "20", etc)
  • Documentation update

@mention-bot
Copy link

@sohje, thanks for your PR! By analyzing the annotation information on this pull request, we identified @douglascamata, @TheSavior and @z4ppy to be potential reviewers

@MZorzy
Copy link

MZorzy commented Sep 2, 2016

question (can't undertand code ) when it stop near fort, gps noise is active or is extremely fixed?

@th3w4y
Copy link
Contributor

th3w4y commented Sep 2, 2016

@sohje I cannot see how you are waiting...

@sohje
Copy link
Contributor Author

sohje commented Sep 2, 2016

@th3w4y We filter forts by 'active_fort_modifier' if self.wait_at_fort enabled.
Always receiving fort with Lure module on get_nearest_fort() untill it expired.

x.get('active_fort_modifier', False) and self.wait_at_fort
),
forts
)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still removing the forts on timeout?

In [31]: wait_at_fort = True

In [32]: forts
Out[32]: 
[{'active': True, 'id': 10},
 {'active': True, 'id': 20},
 {'active': True, 'id': 40}]

In [33]: timeouts_ids
Out[33]: [10, 20, 30]

In [34]: filter(lambda q: q["id"] not in timeouts_ids or (q.get("active", False) and wait_at_fort), forts)
Out[34]: 
[{'active': True, 'id': 10},
 {'active': True, 'id': 20},
 {'active': True, 'id': 40}]

In [35]: 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, cause we dont need to care about forts_on timeout here. We standing and waiting for lures and spin fort with lure module on timeout(check spin_fort.py update L186)

@solderzzc solderzzc closed this Sep 2, 2016
@solderzzc solderzzc reopened this Sep 2, 2016
@z4ppy
Copy link
Contributor

z4ppy commented Sep 2, 2016

Nice PR ! thanks you :)

@solderzzc
Copy link
Contributor

@sohje Will it spin forts when wait on fort? is the timeout checking already in code?

@sohje
Copy link
Contributor Author

sohje commented Sep 2, 2016

@solderzzc Yeap, bot will spin forts.

    def get_forts_in_range(self):
        forts = self.bot.get_forts(order_by_distance=True)
        now = time.time() * 1000
        forts = filter(lambda x: x.get('cooldown_complete_timestamp_ms', 0) < now, forts)
        # forts = filter(lambda fort: fort["id"] not in self.bot.fort_timeouts, forts)

@solderzzc
Copy link
Contributor

solderzzc commented Sep 2, 2016

👍

Approved with PullApprove

@sohje
Copy link
Contributor Author

sohje commented Sep 2, 2016

@solderzzc re-approve and merge?

@solderzzc
Copy link
Contributor

solderzzc commented Sep 3, 2016

👍

Approved with PullApprove

@solderzzc solderzzc merged commit 5b3cfbb into PokemonGoF:dev Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants