@@ -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