Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit fb0ac6a

Browse files
bug fix
1 parent cf8ba05 commit fb0ac6a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

eSim/Fight/hunt_specific_battle.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ async def hunt_specific_battle(link, side, max_dmg_for_bh="1", weapon_quality="0
2323
time_till_round_end = r["hoursRemaining"]*3600 + r["minutesRemaining"]*60 + r["secondsRemaining"] - randint(15, 45)
2424
print(f"Hunting at {link} ({side}). sleeping for {time_till_round_end} seconds.")
2525
await asyncio.sleep(time_till_round_end)
26-
tree = await get_content(link, login_first=True)
26+
main_tree = await get_content(link, login_first=True)
2727
DamageDone = 0
2828
while DamageDone < int(max_dmg_for_bh):
29-
Health = int(float(str(tree.xpath("//*[@id='actualHealth']")[0].text)))
30-
food = tree.xpath('//*[@id="foodLimit2"]')[0].text
31-
food_limit = tree.xpath('//*[@id="sfoodQ5"]/text()')[0]
32-
gift = tree.xpath('//*[@id="giftLimit2"]')[0].text
29+
Health = int(float(str(main_tree.xpath("//*[@id='actualHealth']")[0].text)))
30+
food = main_tree.xpath('//*[@id="foodLimit2"]')[0].text
31+
food_limit = main_tree.xpath('//*[@id="sfoodQ5"]/text()')[0]
32+
gift = main_tree.xpath('//*[@id="giftLimit2"]')[0].text
3333
if Health < 50:
3434
if int(food) and int(food_limit):
3535
await get_content(f"{URL}eat.html", data={'quality': 5})
@@ -38,7 +38,7 @@ async def hunt_specific_battle(link, side, max_dmg_for_bh="1", weapon_quality="0
3838
Damage = 0
3939
for _ in range(5):
4040
try:
41-
tree, status = await send_fight_request(URL, tree, weapon_quality, side)
41+
tree, status = await send_fight_request(URL, main_tree, weapon_quality, side)
4242
Damage = int(str(tree.xpath('//*[@id="DamageDone"]')[0].text).replace(",", ""))
4343
break
4444
except:

0 commit comments

Comments
 (0)