Compare commits
7 Commits
v0.23.2.7
...
v0.23.2.10
Author | SHA1 | Date | |
---|---|---|---|
c0122eccdf | |||
2524173da0 | |||
4a4b991faf | |||
e87c48124c | |||
f0f47566a0 | |||
f88eaccf67 | |||
7be129a781 |
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
__author__ = """Eriks Karls"""
|
__author__ = """Eriks Karls"""
|
||||||
__email__ = 'eriks@72.lv'
|
__email__ = 'eriks@72.lv'
|
||||||
__version__ = '0.23.2.7'
|
__version__ = '0.23.2.10'
|
||||||
|
|
||||||
from erepublik import classes, utils, constants
|
from erepublik import classes, utils, constants
|
||||||
from erepublik.citizen import Citizen
|
from erepublik.citizen import Citizen
|
||||||
|
@ -1039,16 +1039,22 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
|
|
||||||
global_cheapest = self.get_market_offers("House", q)[f"q{q}"]
|
global_cheapest = self.get_market_offers("House", q)[f"q{q}"]
|
||||||
if global_cheapest.price + 200 < local_cheapest.price:
|
if global_cheapest.price + 200 < local_cheapest.price:
|
||||||
if self.travel_to_country(global_cheapest.country):
|
if global_cheapest.price + 2000 < self.details.cc:
|
||||||
buy = self.buy_market_offer(global_cheapest, 1)
|
if self.travel_to_country(global_cheapest.country):
|
||||||
|
buy = self.buy_market_offer(global_cheapest, 1)
|
||||||
|
else:
|
||||||
|
buy = dict(error=True, message='Unable to travel!')
|
||||||
else:
|
else:
|
||||||
buy = {'error': True, 'message': 'Unable to travel!'}
|
buy = dict(error=True, message='Not enough money to buy house!')
|
||||||
else:
|
else:
|
||||||
buy = self.buy_market_offer(local_cheapest, 1)
|
if local_cheapest.price < self.details.cc:
|
||||||
|
buy = self.buy_market_offer(local_cheapest, 1)
|
||||||
|
else:
|
||||||
|
buy = dict(error=True, message='Not enough money to buy house!')
|
||||||
if buy is None:
|
if buy is None:
|
||||||
pass
|
pass
|
||||||
elif buy["error"]:
|
elif buy["error"]:
|
||||||
msg = f"Unable to buy q{q} house! \n{buy['message']}"
|
msg = f'Unable to buy q{q} house! \n{buy["message"]}'
|
||||||
self.write_log(msg)
|
self.write_log(msg)
|
||||||
else:
|
else:
|
||||||
ok_to_activate = True
|
ok_to_activate = True
|
||||||
@ -1690,6 +1696,8 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
for battle in self.sorted_battles(self.config.sort_battles_time):
|
for battle in self.sorted_battles(self.config.sort_battles_time):
|
||||||
if not isinstance(battle, classes.Battle):
|
if not isinstance(battle, classes.Battle):
|
||||||
continue
|
continue
|
||||||
|
if battle.is_dict_lib:
|
||||||
|
continue
|
||||||
battle_zone: Optional[classes.BattleDivision] = None
|
battle_zone: Optional[classes.BattleDivision] = None
|
||||||
for div in battle.div.values():
|
for div in battle.div.values():
|
||||||
if div.terrain == 0:
|
if div.terrain == 0:
|
||||||
@ -1841,6 +1849,9 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
elif r_json.get("message") == "ZONE_INACTIVE":
|
elif r_json.get("message") == "ZONE_INACTIVE":
|
||||||
self.write_log("Wrong division!!")
|
self.write_log("Wrong division!!")
|
||||||
return 0, 10, 0
|
return 0, 10, 0
|
||||||
|
elif r_json.get("message") == "NON_BELLIGERENT":
|
||||||
|
self.write_log("Dictatorship/Liberation wars are not supported!")
|
||||||
|
return 0, 10, 0
|
||||||
elif r_json.get("message") in ["FIGHT_DISABLED", "DEPLOYMENT_MODE"]:
|
elif r_json.get("message") in ["FIGHT_DISABLED", "DEPLOYMENT_MODE"]:
|
||||||
self._post_main_profile_update('options',
|
self._post_main_profile_update('options',
|
||||||
params='{"optionName":"enable_web_deploy","optionValue":"off"}')
|
params='{"optionName":"enable_web_deploy","optionValue":"off"}')
|
||||||
@ -2437,9 +2448,10 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenEconomy, CitizenLeade
|
|||||||
|
|
||||||
self.update_citizen_info()
|
self.update_citizen_info()
|
||||||
self.reporter.do_init()
|
self.reporter.do_init()
|
||||||
if self.config.telegram:
|
if self.config.telegram and self.config.telegram_chat_id:
|
||||||
if self.config.telegram_chat_id and self.config.telegram_token:
|
self.telegram.do_init(self.config.telegram_chat_id,
|
||||||
self.telegram.do_init(self.config.telegram_chat_id, self.config.telegram_token, self.name)
|
self.config.telegram_token or "864251270:AAFzZZdjspI-kIgJVk4gF3TViGFoHnf8H4o",
|
||||||
|
self.name)
|
||||||
self.telegram.send_message(f"*Started* {utils.now():%F %T}")
|
self.telegram.send_message(f"*Started* {utils.now():%F %T}")
|
||||||
|
|
||||||
self.update_all(True)
|
self.update_all(True)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.23.2.7
|
current_version = 0.23.2.10
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
||||||
|
2
setup.py
2
setup.py
@ -50,6 +50,6 @@ setup(
|
|||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
tests_require=test_requirements,
|
tests_require=test_requirements,
|
||||||
url='https://github.com/eeriks/erepublik/',
|
url='https://github.com/eeriks/erepublik/',
|
||||||
version='0.23.2.7',
|
version='0.23.2.10',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user