Minor updates
This commit is contained in:
parent
39dbcaa27d
commit
42c430213f
@ -1099,7 +1099,6 @@ class Citizen(classes.CitizenAPI):
|
|||||||
self._post_delete_message([msg_id])
|
self._post_delete_message([msg_id])
|
||||||
|
|
||||||
def get_market_offers(self, country_id: int = None, product: str = None, quality: int = None) -> dict:
|
def get_market_offers(self, country_id: int = None, product: str = None, quality: int = None) -> dict:
|
||||||
ret = dict()
|
|
||||||
raw_short_names = dict(frm="foodRaw", wrm="weaponRaw", hrm="houseRaw", arm="airplaneRaw")
|
raw_short_names = dict(frm="foodRaw", wrm="weaponRaw", hrm="houseRaw", arm="airplaneRaw")
|
||||||
q1_industries = ["aircraft"] + list(raw_short_names.values())
|
q1_industries = ["aircraft"] + list(raw_short_names.values())
|
||||||
if product in raw_short_names:
|
if product in raw_short_names:
|
||||||
@ -1210,7 +1209,7 @@ class Citizen(classes.CitizenAPI):
|
|||||||
value="New amount {o.cc}cc, {o.gold}g".format(o=self.details))
|
value="New amount {o.cc}cc, {o.gold}g".format(o=self.details))
|
||||||
return not response.json().get("error", False)
|
return not response.json().get("error", False)
|
||||||
|
|
||||||
def activate_dmg_booster(self, battle_id: int) -> None:
|
def activate_dmg_booster(self, battle_id: int):
|
||||||
if self.config.boosters:
|
if self.config.boosters:
|
||||||
duration = 0
|
duration = 0
|
||||||
if self.boosters.get("100_damageBoosters_5_600", 0) > 0:
|
if self.boosters.get("100_damageBoosters_5_600", 0) > 0:
|
||||||
@ -1253,7 +1252,7 @@ class Citizen(classes.CitizenAPI):
|
|||||||
self.sleep(5)
|
self.sleep(5)
|
||||||
|
|
||||||
def reject_money_donations(self) -> int:
|
def reject_money_donations(self) -> int:
|
||||||
r = self.get_message_alerts()
|
r = self._get_notifications_ajax_system()
|
||||||
count = 0
|
count = 0
|
||||||
donation_ids = re.findall(r"erepublik.functions.acceptRejectDonation\(\"reject\", (\d+)\)", r.text)
|
donation_ids = re.findall(r"erepublik.functions.acceptRejectDonation\(\"reject\", (\d+)\)", r.text)
|
||||||
while donation_ids:
|
while donation_ids:
|
||||||
@ -1261,7 +1260,7 @@ class Citizen(classes.CitizenAPI):
|
|||||||
self._get_money_donation_reject(int(don_id))
|
self._get_money_donation_reject(int(don_id))
|
||||||
count += 1
|
count += 1
|
||||||
self.sleep(5)
|
self.sleep(5)
|
||||||
r = self.get_message_alerts()
|
r = self._get_notifications_ajax_system()
|
||||||
donation_ids = re.findall(r"erepublik.functions.acceptRejectDonation\(\"reject\", (\d+)\)", r.text)
|
donation_ids = re.findall(r"erepublik.functions.acceptRejectDonation\(\"reject\", (\d+)\)", r.text)
|
||||||
return count
|
return count
|
||||||
|
|
||||||
@ -1617,8 +1616,8 @@ class Citizen(classes.CitizenAPI):
|
|||||||
ret = {}
|
ret = {}
|
||||||
r = self._get_military_unit_data(mu_id)
|
r = self._get_military_unit_data(mu_id)
|
||||||
|
|
||||||
for page in range(1, int(r.json()["panelContents"]["pages"]) + 1):
|
for page in range(int(r.json()["panelContents"]["pages"])):
|
||||||
r = self._get_military_unit_data(mu_id, page)
|
r = self._get_military_unit_data(mu_id, currentPage=page + 1)
|
||||||
for user in r.json()["panelContents"]["members"]:
|
for user in r.json()["panelContents"]["members"]:
|
||||||
if not user["isDead"]:
|
if not user["isDead"]:
|
||||||
ret.update({user["citizenId"]: user["name"]})
|
ret.update({user["citizenId"]: user["name"]})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user