Switch to Fight mode if deployed is active
This commit is contained in:
parent
39defc0fd7
commit
cd5c0b161f
@ -5,7 +5,7 @@
|
||||
__author__ = """Eriks Karls"""
|
||||
__email__ = 'eriks@72.lv'
|
||||
__version__ = '0.20.2.1'
|
||||
__commit_id__ = "6c8dbcd"
|
||||
__commit_id__ = "39defc0"
|
||||
|
||||
from erepublik import classes, utils
|
||||
from erepublik.citizen import Citizen
|
||||
|
@ -565,6 +565,10 @@ class ErepublikProfileAPI(CitizenBaseAPI):
|
||||
data = dict(_token=self.token, rewardId=reward_id)
|
||||
return self.post("{}/main/weekly-challenge-collect-reward".format(self.url), data=data)
|
||||
|
||||
def _post_main_profile_update(self, action: str, params: str):
|
||||
data = {"action": action, "params": params, "_token": self.token}
|
||||
return self.post(f"{self.url}/main/profile-update", data=data)
|
||||
|
||||
|
||||
class ErepublikTravelAPI(CitizenBaseAPI):
|
||||
def _post_main_travel(self, check: str, **kwargs) -> Response:
|
||||
|
@ -1669,6 +1669,9 @@ class CitizenMilitary(CitizenTravel):
|
||||
pass
|
||||
elif r_json.get("message") == "NOT_ENOUGH_WEAPONS":
|
||||
self.set_default_weapon(battle_id, zone_id)
|
||||
elif r_json.get("message") == "FIGHT_DISABLED":
|
||||
self._post_main_profile_update('options', params='{"optionName":"enable_web_deploy","optionValue":"off"}')
|
||||
self.set_default_weapon(battle_id, zone_id)
|
||||
else:
|
||||
if r_json.get("message") == "UNKNOWN_SIDE":
|
||||
self._rw_choose_side(battle_id, side_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user