Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
moved to genshin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati authored Mar 23, 2022
1 parent 0ee4917 commit f28db2e
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions real-time-notes.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import genshinstats as gs
gs.set_cookie(ltuid=7368957, ltoken="X5VJAbNxdKpMp96s7VGpyIBhSnEJr556d5fFMcT5")

uid = 901211014
notes = gs.get_notes(uid)
time = (notes['max_resin']-notes['resin'])*8/60
hours = int(time)
minutes = (time*60) % 60.
print(f"User UID: {uid}")
print(f"Current resin: {notes['resin']}/{notes['max_resin']}")
print(f"Resin full in %d hours %02d minutes" % (hours, minutes))
print(f"Current realm currency: {notes['realm_currency']}/{notes['max_realm_currency']}")
print(f"Expeditions completed: {len(notes['expeditions'])}/{notes['max_expeditions']}")
import asyncio
import genshin

async def main():
client = genshin.GenshinClient()
cookies = genshin.get_browser_cookies()
client.set_cookies(cookies)

notes = await client.get_notes(901211014)
time = notes.until_resin_recovery
hours, minutes = divmod(time // 60, 60)
print(f"Current resin: {notes.current_resin}/{notes.max_resin}")
print(f"Resin full in {hours:.0f} hours {minutes:.0f} minutes")
print(f"Comissions left: {notes.completed_commissions}/{notes.max_comissions}")
print(f"Current realm currency: {notes.current_realm_currency}/{notes.max_realm_currency}")
print(f"Expeditions finished: {sum(expedition.finished for expedition in notes.expeditions)}")

await client.close()

asyncio.run(main())

0 comments on commit f28db2e

Please sign in to comment.