SHARE
TWEET

Untitled

a guest Feb 21st, 2020 211 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import hypixel
  2. import time
  3. import re
  4.  
  5. API_KEYS = ['2c06713d-a617-41a3-b598-e0c608e0d6da']
  6. hypixel.setKeys(API_KEYS)
  7.  
  8. l = -1
  9.  
  10. f = re.findall(r"^(.+?):", open('nicknames.txt', 'r'))
  11. f1 = open('sorted.txt', 'w', encoding='utf-8')
  12. lines = f.readlines()
  13.  
  14. for i in f:
  15.     l += 1
  16.     try:
  17.         Player = hypixel.Player(lines[l].replace('\n', ''))
  18.         PlayerName = Player.getName()
  19.         PlayerRank = Player.getRank()['rank']
  20.         PlayerLevel = str(Player.getLevel()).split('.')[0]
  21.         f1.write('=================')
  22.         f1.write('\n')
  23.         f1.write(f'nickname - {PlayerName}')
  24.         f1.write('\n')
  25.         f1.write(f'Rank - {PlayerRank}')
  26.         f1.write('\n')
  27.         f1.write(f'Level - {PlayerLevel}')
  28.         f1.write('\n')
  29.         f1.write('=================')
  30.     except hypixel.PlayerNotFoundException:
  31.         print('хуяк,акка нет в базе)')
  32.     except hypixel.HypixelAPIError:
  33.         print('Жду 30 сек и продолжаю)')
  34.         time.sleep(30)
  35.         continue
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top