Skip to content

Commit

Permalink
Merge pull request #5772 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
Dev merge to master
  • Loading branch information
solderzzc authored Oct 6, 2016
2 parents bc295f3 + 985fa78 commit 6d12193
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
2 changes: 1 addition & 1 deletion configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,6 @@
},
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000"
"server_url": "127.0.0.1:4000"
}
}
2 changes: 1 addition & 1 deletion configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,6 @@
},
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000"
"server_url": "127.0.0.1:4000"
}
}
2 changes: 1 addition & 1 deletion configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,6 @@
},
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000"
"server_url": "127.0.0.1:4000"
}
}
2 changes: 1 addition & 1 deletion configs/config.json.path.example
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,6 @@
},
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000"
"server_url": "127.0.0.1:4000"
}
}
2 changes: 1 addition & 1 deletion configs/config.json.pokemon.example
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,6 @@
},
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000"
"server_url": "127.0.0.1:4000"
}
}
8 changes: 4 additions & 4 deletions data/locales/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
"Lampent": "燈火幽靈",
"Landorus": "土地雲",
"Lanturn": "電燈怪",
"Lapras": "拉普拉斯",
"Lapras": "乘龍",
"Larvesta": "燃燒蟲",
"Larvitar": "由基拉",
"Latias": "拉帝亞斯",
Expand Down Expand Up @@ -433,8 +433,8 @@
"Natu": "天然雀",
"Nidoking": "尼多王",
"Nidoqueen": "尼多后",
"Nidoran": "尼多蘭",
"Nidoran": "尼多朗",
"Nidoran F": "尼多蘭",
"Nidoran M": "尼多朗",
"Nidorina": "尼多娜",
"Nidorino": "尼多力諾",
"Nincada": "土居忍士",
Expand Down Expand Up @@ -743,4 +743,4 @@
"Zubat": "超音蝠",
"Zweilous": "雙頭龍",
"Zygarde": "基格爾德"
}
}
8 changes: 7 additions & 1 deletion docs/manual_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ Ubuntu will be used for the Linux Example

####First install required packages

#####Linux
#####Linux - Ubuntu
```bash
sudo apt-get install build-essential autoconf libtool pkg-config make python2.7-dev wget git
```
#####Linux - Centos 7
```bash
sudo yum install -y epel-release
sudo yum install -y git wget python python-pip
sudo yum groupinstall -y "Development Tools"
```
####
if you are on a different Linux OS you maybe have to adapt things like:

Expand Down
10 changes: 9 additions & 1 deletion pokemongo_bot/cell_workers/pokemon_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def initialize(self):
self.evolution_map = {}
self.ongoing_stardust_count = 0
self.buddy = None
self.buddyid = 0
self.lock_buddy = True
self.no_log_until = 0

Expand Down Expand Up @@ -241,6 +242,7 @@ def work(self):

def check_buddy(self):
self.buddy = self.bot.player_data.get("buddy_pokemon", {})
self.buddyid = self._get_buddyid()

if not self.buddy:
self.lock_buddy = False
Expand Down Expand Up @@ -523,7 +525,7 @@ def get_evolution_plan(self, family_id, family_list, keep, try_evolve, try_upgra
# All the rest is crap, for now
crap = list(family_list)
crap = [p for p in crap if p not in keep]
crap = [p for p in crap if not p.in_fort and not p.is_favorite]
crap = [p for p in crap if not p.in_fort and not p.is_favorite and not (p.unique_id == self.buddyid)]
crap.sort(key=lambda p: (p.iv, p.cp), reverse=True)

# We will gain a candy whether we choose to transfer or evolve these Pokemon
Expand Down Expand Up @@ -858,6 +860,7 @@ def set_buddy_pokemon(self, pokemon):

if not self.bot.config.test:
self.buddy = response_dict.get("responses", {}).get("SET_BUDDY_POKEMON", {}).get("updated_buddy", {})
self.buddyid = self._get_buddyid()

self.emit_event("buddy_pokemon",
formatted="Buddy {pokemon} [IV {iv}] [CP {cp}]",
Expand Down Expand Up @@ -908,3 +911,8 @@ def get_buddy_walked(self, pokemon):
action_delay(self.config_action_wait_min, self.config_action_wait_max)

return True

def _get_buddyid(self):
if self.buddy and'id' in self.buddy:
return self.buddy['id']
return 0
11 changes: 9 additions & 2 deletions pokemongo_bot/cell_workers/transfer_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def initialize(self):
self.min_free_slot = self.config.get('min_free_slot', 5)
self.transfer_wait_min = self.config.get('transfer_wait_min', 1)
self.transfer_wait_max = self.config.get('transfer_wait_max', 4)
self.buddy = self.bot.player_data.get('buddy_pokemon', {})
self.buddyid = self._get_buddyid()

def work(self):
if not self._should_work():
Expand All @@ -31,7 +33,7 @@ def work(self):

if self.bot.config.release.get('all'):
group = [p for p in inventory.pokemons().all()
if p.in_fort is False and p.is_favorite is False]
if not p.in_fort and not p.is_favorite and not (p.unique_id == self.buddyid)]
self._release_pokemon_worst_in_group(group, 'all')

def _should_work(self):
Expand All @@ -41,7 +43,7 @@ def _should_work(self):
def _release_pokemon_get_groups(self):
pokemon_groups = {}
for pokemon in inventory.pokemons().all():
if pokemon.in_fort or pokemon.is_favorite:
if pokemon.in_fort or pokemon.is_favorite or pokemon.unique_id == self.buddyid:
continue

group_id = pokemon.pokemon_id
Expand Down Expand Up @@ -339,3 +341,8 @@ def _validate_keep_best_config(self, pokemon_name):
keep_best = False

return keep_best, keep_best_cp, keep_best_iv, keep_best_ivcp

def _get_buddyid(self):
if self.buddy and'id' in self.buddy:
return self.buddy['id']
return 0

0 comments on commit 6d12193

Please sign in to comment.