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

Dev merge to mater #4659

Merged
merged 34 commits into from
Aug 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bc73d61
Map expieration timestamps / names (#4633)
BreezeRo Aug 23, 2016
d87733e
Add files via upload (#4637)
BreezeRo Aug 23, 2016
a1a71fb
Merge branch 'master' into dev
solderzzc Aug 23, 2016
81ba624
Added text toast to screen if send by human.
solderzzc Aug 24, 2016
2a5898b
Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot int…
solderzzc Aug 24, 2016
04c5ec5
Fixed #4621 (broken 'any' after addition of 'all') (#4639)
LitRidl Aug 24, 2016
fe7768c
Catcher improvements (#4640)
mjmadsen Aug 24, 2016
d586ce9
Increase config default wait times (#4642)
mjmadsen Aug 24, 2016
b16bd50
enable polywalker on FollowPath (#4644)
alexyaoyang Aug 24, 2016
f44d1a7
update docs with working pokemongo-map link
C-o-r-E Aug 24, 2016
e3442e9
Fixed variable reference (#4650)
mjmadsen Aug 24, 2016
a0cb16f
Reduce reachable range (#4651)
mjmadsen Aug 24, 2016
9fb370e
teleporting do not update last-location
helloj Aug 23, 2016
722f86d
typo: `min_evolve_speed` -> `max_evolve_speed`
geminiyellow Aug 24, 2016
47adbfc
Merge pull request #4645 from C-o-r-E/dev
solderzzc Aug 24, 2016
60d1272
Merge pull request #4655 from geminiyellow/patch-1
solderzzc Aug 24, 2016
fd95ce8
Merge pull request #4653 from helloj/hotfix_teleport
solderzzc Aug 24, 2016
40a2716
Level limit
Aug 24, 2016
1bfa03a
Modify to hide the google translate.
solderzzc Aug 24, 2016
7df7ad0
Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot int…
solderzzc Aug 24, 2016
f2905c4
Only change the native part of mqtt broker, cname won't work on the w…
solderzzc Aug 24, 2016
67df2c9
Enable this line if you are doing the snip code, off stress
solderzzc Aug 24, 2016
951d102
Removed code to avoid exception.
solderzzc Aug 24, 2016
ba62504
Need remove the name since some are UTF8 encode.
solderzzc Aug 24, 2016
42eeb80
Fixed typo.
solderzzc Aug 24, 2016
b035269
Merge pull request #4656 from alexyaoyang/feature-level-limit
solderzzc Aug 24, 2016
56a5d11
switch to self hosted mqtt server.
solderzzc Aug 24, 2016
22fb757
Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot int…
solderzzc Aug 24, 2016
3f32ba8
Submit code for sniper testing.
solderzzc Aug 24, 2016
204af22
Revert "Stops bot after a set level limit"
solderzzc Aug 24, 2016
af7d82c
Merge pull request #4658 from PokemonGoF/revert-4656-feature-level-limit
solderzzc Aug 24, 2016
3248b91
Comment out some code to let code run.
solderzzc Aug 24, 2016
fae2fb2
Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot int…
solderzzc Aug 24, 2016
5d198c5
Merge remote-tracking branch 'origin/master' into dev
solderzzc Aug 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"config": {
"enabled": true,
"min_free_slot": 5,
"transfer_wait_min": 1,
"transfer_wait_max": 4
"transfer_wait_min": 3,
"transfer_wait_max": 5
}
},
{
Expand Down Expand Up @@ -108,8 +108,8 @@
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 1,
"recycle_wait_max": 4
"recycle_wait_min": 3,
"recycle_wait_max": 5
}
},
{
Expand All @@ -131,12 +131,12 @@
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_min": 3,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
}
}
},
Expand Down
18 changes: 9 additions & 9 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"config": {
"enabled": true,
"min_free_slot": 5,
"transfer_wait_min": 1,
"transfer_wait_max": 4
"transfer_wait_min": 3,
"transfer_wait_max": 5
}
},
{
Expand Down Expand Up @@ -121,8 +121,8 @@
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 1,
"recycle_wait_max": 4
"recycle_wait_min": 3,
"recycle_wait_max": 5
}
},
{
Expand All @@ -146,12 +146,12 @@
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_min": 3,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
}
}
},
Expand Down
18 changes: 9 additions & 9 deletions configs/config.json.optimizer.example
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"transfer": true,
"// 'transfer_wait_min' and 'transfer_wait_max' are the minimum and maximum": {},
"// time to wait when transferring a pokemon": {},
"transfer_wait_min": 2,
"transfer_wait_max": 4,
"transfer_wait_min": 3,
"transfer_wait_max": 5,
"// the 'evolve' parameter activate or deactivate the evolution of pokemons": {},
"// at false, no pokemon is going to be evolved, ever": {},
"// at false, you will still get the log information of what the": {},
Expand Down Expand Up @@ -169,8 +169,8 @@
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 1,
"recycle_wait_max": 4
"recycle_wait_min": 3,
"recycle_wait_max": 5
}
},
{
Expand All @@ -193,12 +193,12 @@
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_min": 3,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
}
}
},
Expand Down
19 changes: 10 additions & 9 deletions configs/config.json.path.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"config": {
"enabled": true,
"min_free_slot": 5,
"transfer_wait_min": 1,
"transfer_wait_max": 4
"transfer_wait_min": 3,
"transfer_wait_max": 5
}
},
{
Expand Down Expand Up @@ -108,8 +108,8 @@
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 1,
"recycle_wait_max": 4
"recycle_wait_min": 3,
"recycle_wait_max": 5
}
},
{
Expand All @@ -132,12 +132,12 @@
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_min": 3,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
}
}
},
Expand All @@ -153,6 +153,7 @@
"type": "FollowPath",
"config": {
"enabled": true,
"walker": "StepWalker",
"path_mode": "loop",
"path_start_mode": "first",
"path_file": "configs/path.example.json",
Expand Down
18 changes: 9 additions & 9 deletions configs/config.json.pokemon.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"config": {
"enabled": true,
"min_free_slot": 5,
"transfer_wait_min": 1,
"transfer_wait_max": 4
"transfer_wait_min": 3,
"transfer_wait_max": 5
}
},
{
Expand Down Expand Up @@ -107,8 +107,8 @@
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 1,
"recycle_wait_max": 4
"recycle_wait_min": 3,
"recycle_wait_max": 5
}
},
{
Expand All @@ -131,12 +131,12 @@
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_min": 3,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The behaviors of the bot are configured via the `tasks` key in the `config.json`
* EvolvePokemon
* `evolve_all`: Default `NONE` | Set to `"all"` to evolve Pokémon if possible when the bot starts. Can also be set to individual Pokémon as well as multiple separated by a comma. e.g "Pidgey,Rattata,Weedle,Zubat"
* `min_evolve_speed`: Default `25` | Minimum seconds to wait between each evolution
* `min_evolve_speed`: Default `30` | Maximum seconds to wait between each evolution
* `max_evolve_speed`: Default `30` | Maximum seconds to wait between each evolution
* `use_lucky_egg`: Default: `False`
* FollowPath
* `path_mode`: Default `loop` | Set the mode for the path navigator (loop or linear).
Expand Down Expand Up @@ -495,7 +495,7 @@ If you want to make your bot behave as it did prior to the catch_simulation upda
### Description
[[back to top](#table-of-contents)]

This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map instance. For information on how to properly setup PokemonGo-Map have a look at the Github page of the project [here](https://github.com/AHAAAAAAA/PokemonGo-Map/). There is an example config in `config/config.json.map.example`
This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map instance. For information on how to properly setup PokemonGo-Map have a look at the Github page of the project [here](https://github.com/PokemonGoMap/PokemonGo-Map). There is an example config in `config/config.json.map.example`

### Options
[[back to top](#table-of-contents)]
Expand Down
10 changes: 5 additions & 5 deletions map-chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<body>

<!-- Google translate -->
<!-- Google translate
<div class="translation-wrapper hide-on-small-and-down">
Translation
<div id="google_translate_element" style="float: right; padding-left: 10px"></div>
Expand All @@ -34,11 +34,10 @@
}
</script>
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<div class="navbar">
<nav>
<div class="nav-wrapper blue">
<a class="brand-logo center" href="http://idoco.github.io/map-chat/">MapChat</a>
<a class="brand-logo center" href="https://github.com/PokemonGoF/PokemonGo-Bot/tree/master/map-chat">MapChat</a>
<a id="side-nav-button" href="#" data-activates="side-nav"><i class="mdi-navigation-menu"></i></a>
<ul class="side-nav" id="side-nav">
<li>
Expand All @@ -63,9 +62,10 @@
</div>
</nav>
</div>
-->

<!--fork me link-->
<a href="https://github.com/idoco/map-chat/" class="hide-on-med-and-down">
<a href="https://github.com/PokemonGoF/PokemonGo-Bot/tree/master/map-chat" class="hide-on-med-and-down">
<img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"
class="fork-me-link" alt="Fork me on GitHub">
</a>
Expand Down Expand Up @@ -111,7 +111,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/js/materialize.min.js"></script>
<script src="https://cdn.jsdelivr.net/sockjs/1.0.0/sockjs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vertx/2.0.0/vertxbus.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&language=en"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCbS09u00uAutq-SzZFzwabK0ihFCFCwU0&v=3.exp&language=en"></script>

<script type="text/javascript" src="javascript/modernizr.custom.js"></script>
<script type="text/javascript" src="javascript/html-sanitizer-minified.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion map-chat/javascript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var urlHashTopic = location.hash ? location.hash.substring(1).toLowerCase() : nu
var topic = urlHashTopic ? urlHashTopic : "pgomapcatch/chat";

function initialiseEventBus(){
window.client = mqtt.connect('ws://test.mosca.io'); // you add a ws:// url here
window.client = mqtt.connect('ws://broker.pikabot.org'); // you add a ws:// url here
client.subscribe("pgomapcatch/#");

client.on("message", function(topic, payload) {
Expand All @@ -18,6 +18,7 @@ function initialiseEventBus(){
if(topic === 'pgomapcatch/chat'){
console.log('Chatting event')
displayChatMessageOnMap(payload)
Materialize.toast(payload, 5000);
} else {

//@ro: let's grab the message and split that shit. (simple for now, maybe we could just parse the json instead)
Expand Down
6 changes: 3 additions & 3 deletions map-chat/javascript/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function displayChatMessageOnMap(raw){
});

// msg.text = msg.text ? embedTweet(msg.text) : "";
msg.text = msg.text.replace(/&#35;(\S*)/g,'<a href="http://idoco.github.io/map-chat/#$1" target="_blank">#$1</a>');
msg.text = msg.text.replace(/&#35;(\S*)/g,'<a href="http://maps.pikabot.org/#$1" target="_blank">#$1</a>');

// linkify
msg.text = msg.text.replace(/(\b(https?|ftp|file):&#x2F;&#x2F;[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
Expand Down Expand Up @@ -240,7 +240,7 @@ function displayMessageOnMap(msg, olat, olong, sessid, icostr, expir, pokenick){
});

// msg.text = msg.text ? embedTweet(msg.text) : "";
msg.text = msg.text.replace(/&#35;(\S*)/g,'<a href="http://idoco.github.io/map-chat/#$1" target="_blank">#$1</a>');
msg.text = msg.text.replace(/&#35;(\S*)/g,'<a href="http://maps.pikabot.org/#$1" target="_blank">#$1</a>');

// linkify
msg.text = msg.text.replace(/(\b(https?|ftp|file):&#x2F;&#x2F;[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
Expand Down Expand Up @@ -323,7 +323,7 @@ function displayMessageOnMap(msg, olat, olong, sessid, icostr, expir, pokenick){

function embedTweet(text) {
var tweetText = "Someone wrote " + text + " on ";
var tweetUrl = "https:\/\/twitter.com\/share?url=http://idoco.github.io/map-chat&text=" + tweetText;
var tweetUrl = "https:\/\/twitter.com\/share?url=http://maps.pikabot.org/&text=" + tweetText;
var width = 500, height = 300;
var left = (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (height / 2);
Expand Down
4 changes: 4 additions & 0 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@ def update_web_location(self, cells=[], lat=None, lng=None, alt=None):
if alt is None:
alt = self.api._position_alt

# dont cache when teleport_to
if self.api.teleporting:
return

if cells == []:
location = self.position[0:2]
cells = self.find_close_cells(*location)
Expand Down
6 changes: 4 additions & 2 deletions pokemongo_bot/api_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, config=None):
PGoApi.__init__(self)
# Set to default, just for CI...
self.actual_lat, self.actual_lng, self.actual_alt = PGoApi.get_position(self)
self.teleporting = False
self.noised_lat, self.noised_lng, self.noised_alt = self.actual_lat, self.actual_lng, self.actual_alt

self.useVanillaRequest = False
Expand Down Expand Up @@ -81,14 +82,15 @@ def login(self, *args):
self.useVanillaRequest = False
return ret_value

def set_position(self, lat, lng, alt=None):
def set_position(self, lat, lng, alt=None, teleporting=False):
self.actual_lat = lat
self.actual_lng = lng
if None != alt:
self.actual_alt = alt
else:
alt = self.actual_alt

self.teleporting = teleporting

if self.config.replicate_gps_xy_noise:
lat_noise = gps_noise_rng(self.config.gps_xy_noise_range)
lng_noise = gps_noise_rng(self.config.gps_xy_noise_range)
Expand Down
4 changes: 1 addition & 3 deletions pokemongo_bot/cell_workers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from catch_lured_pokemon import CatchLuredPokemon
from catch_visible_pokemon import CatchVisiblePokemon
from evolve_pokemon import EvolvePokemon
from incubate_eggs import IncubateEggs
from move_to_fort import MoveToFort
Expand All @@ -22,4 +20,4 @@
from update_live_inventory import UpdateLiveInventory
from catch_pokemon import CatchPokemon
from complete_tutorial import CompleteTutorial
from random_pause import RandomPause
from random_pause import RandomPause
Loading