Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyperclip as py
- import requests
- import math
- import keyboard as kb
- import time
- while True:
- if kb.is_pressed('control') & kb.is_pressed('c'):
- try:
- url = 'https://poe.ninja/api/data/currencyoverview?league=Expedition&type=Currency'
- time.sleep(0.05)
- clipboard = py.paste()
- currency = str(clipboard.split('\n')[2][:-1])
- currency_amount = int(clipboard.split('\n')[4][12:-4])
- currency_amount = int(clipboard.split('\n')[4][12:-4])
- r = requests.get(url).json()
- for i in range(0, len(r['lines'])):
- if (r['lines'][i]['currencyTypeName']) == currency:
- sale_price = currency_amount * float(r['lines'][i]['receive']['value'])
- sale_price_floor = math.floor(sale_price)
- print(r['lines'][i]['currencyTypeName'])
- print("Value: " + str(r['lines'][i]['receive']['value']) + " Chaos")
- print("Available to sell: " + str(currency_amount))
- print("Sale price rounded down: " + str(math.floor((sale_price))) + " Chaos")
- print(str(sale_price_floor) + "/" + str(currency_amount) + " Copied to clipboard")
- print("---------------------------------------\n")
- py.copy(str(sale_price_floor) + "/" + str(currency_amount))
- time.sleep(1)
- except Exception as e:
- print(e)
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement