Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.02 KB | None | 0 0
  1. import requests
  2. import time
  3. import winsound
  4. import re
  5. from bs4 import BeautifulSoup
  6. import random
  7. from random import choice
  8. from string import ascii_uppercase
  9. import string
  10. from time import sleep
  11. import imaplib
  12. import datetime
  13. import email
  14. import imaplib
  15. import mailbox
  16. global loop
  17. num = 0
  18. btcAddress = ''
  19. btcKey = ''
  20. global s
  21. s = requests.Session()
  22. loop = True
  23. x = 'true'
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. def logClear():
  32.     print("Clearing LOGS...")
  33.     logUrl = "https://legacy.hackerexperience.com/logEdit"
  34.     payload = {
  35.         'id':1,
  36.         'log':''
  37.     }
  38.     response = s.post(logUrl,payload)
  39.     newURL = response.url
  40.     Log = s.get(newURL)
  41.     Log = s.get("https://legacy.hackerexperience.com/log")
  42.     s.get("https://legacy.hackerexperience.com/logout")
  43.     print("Log cleared - Alt created - Logged out\n")
  44.  
  45. def btcLogin():
  46.     print("Logging into BTC...")
  47.     bitcoinURL = 'https://legacy.hackerexperience.com/internet?ip=99.232.28.232'
  48.     url = "https://legacy.hackerexperience.com/bitcoin.php"
  49.     payload = {
  50.         'func':'btcLogin',
  51.         'addr':'addr',
  52.         'key':'key'
  53.     }
  54.     s.post(url, payload)
  55.     test = s.get(bitcoinURL)
  56.     print("Successfully logged into BTC Market.")
  57.  
  58. def randomGenerator(N):
  59.     return ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(N))
  60.  
  61. def getRandomUsername():
  62.     addz = "z"
  63.     u = BeautifulSoup(requests.post("http://names.pub/usernames", data=dict({"requestType":"newUsernameName"})).text, "html.parser").find("h2").getText()
  64.     open("alt-names.txt", "a").write("\n"+u+addz)
  65.     print("Random name : " + u+addz)
  66.     r = requests.post("https://legacy.hackerexperience.com/ajax.php", data=dict({"username":u, "func":"check-user"})).text
  67.     if r == 'true':
  68.         name = u+addz
  69.         return name
  70.     else:
  71.         return getRandomUsername()
  72.  
  73.  
  74.    
  75. def link():
  76.     f = open("links.txt","r")
  77.     read = f.readlines(num)
  78.     print(read)
  79.     global num
  80.     num += 1
  81.     return s.get(read)
  82.    
  83. def certificate1():
  84.     try:
  85.         link()
  86.         print("link ==== :"+link)
  87.         s.get(link)
  88.         print("Starting on Cert 1...")
  89.         url = 'https://legacy.hackerexperience.com/university?opt=certification&learn=1&page=3'
  90.         html = s.get(url)
  91.         html = html.text
  92.         soup = BeautifulSoup(html, 'html.parser')
  93.         href = soup.find('a', {'class': 'btn btn-success'})['href']
  94.         completeCert = 'https://legacy.hackerexperience.com/'+href
  95.         cert = s.get(completeCert)
  96.         print("Cert 1 Complete!")
  97.     except:
  98.         print("ERROR with script... restarting")
  99.         certificate1()
  100.  
  101. def certificate2():
  102.     print("Starting on Cert2...")
  103.     certUrl = 'https://legacy.hackerexperience.com/university?opt=certification&learn=2&page=3'
  104.     url = 'https://legacy.hackerexperience.com/university'
  105.     payload = {
  106.         'act':'buy',
  107.         'id':2
  108.     }
  109.     s.post(url,payload)
  110.     html = s.get(certUrl)
  111.     html = html.text
  112.    
  113.     soup = BeautifulSoup(html, 'html.parser')
  114.     href = soup.find('a', {'class': 'btn btn-success'}).get('href')
  115.     completeCert = 'https://legacy.hackerexperience.com/'+href
  116.     cert = s.get(completeCert)
  117.     print("Cert 2 Completed!")
  118.    
  119. def bankAccount():
  120.     bankURL = 'https://legacy.hackerexperience.com/finances'
  121.     html = s.get(bankURL)
  122.     html = html.text
  123.     soup = BeautifulSoup(html, 'html.parser')
  124.     bank = soup.find('span', {'class': 'green'}).next_sibling
  125.     bank = bank.split(' at #')[1]
  126.     bank = bank.split('\n')
  127.     bankAcc = bank[0]
  128.     return bankAcc
  129.    
  130. def sellBTC():
  131.     global loop
  132.     bankAcc = bankAccount()
  133.     bitcoinURL = 'https://legacy.hackerexperience.com/internet?ip=99.232.28.232'
  134.     html = s.get(bitcoinURL)
  135.     html = html.text
  136.     soup = BeautifulSoup(html, 'html.parser')
  137.     price = soup.find('span', {'class': 'green'})
  138.     price = price.text
  139.     price = price.split('$')
  140.     price = price[1]
  141.     amountOfBtc = (200000 / int(price)) + 2
  142.     amountOfBtc = round(amountOfBtc)
  143.     url = 'https://legacy.hackerexperience.com/internet?ip=99.232.28.232'
  144.     html = s.get(url)
  145.     html = html.text
  146.     soup = BeautifulSoup(html, 'html.parser')
  147.     bitcoins = soup.find('div', {'style': 'overflow: hidden;'})
  148.     bitcoins = bitcoins.text
  149.     bitcoins = bitcoins.split("Bitcoins: ")
  150.     bitcoins = bitcoins[1].split(" BTC")
  151.     if(float(bitcoins[0]) < 400):
  152.         print(" LOW ON BTC!!!! STAP!!!!")
  153.         loop = False
  154.     else:
  155.         print("=========================")
  156.         print("BTC Balance:",bitcoins[0])
  157.         print("=========================")
  158.  
  159.     bitcoinSellURL = 'https://legacy.hackerexperience.com/bitcoin.php'
  160.     payload = {
  161.         'func':'btcSell',
  162.         'amount':amountOfBtc,
  163.         'acc':bankAcc
  164.     }
  165.     s.post(bitcoinSellURL,payload)
  166.     print("Sold BTC")
  167.  
  168.  
  169. def buyInternet():
  170.     bankAcc = bankAccount()
  171.     hardwareURL = 'https://legacy.hackerexperience.com/hardware'
  172.     payload = {
  173.         'acc':bankAcc,
  174.         'act':'net',
  175.         'part-id':10,
  176.         'price':100000
  177.     }
  178.     s.post(hardwareURL, payload)
  179.     print("Bought Internet")
  180.    
  181.  
  182.  
  183. def clanCreate():
  184.     bankAcc = bankAccount()
  185.     url = 'https://legacy.hackerexperience.com/clan?action=create'
  186.     clanTag = randomGenerator(3)
  187.     clanName = getRandomUsername()
  188.     payload = {
  189.         'acc':bankAcc,
  190.         'ctag':clanTag,
  191.         'cname':clanName,
  192.         'act':'create'
  193.     }
  194.     response = s.post(url,payload)
  195.     html = response.text
  196.     soup = BeautifulSoup(html, 'html.parser')
  197.     find_error = soup.find_all('<div class="alert alert-error">')
  198.     if len(find_error) > 0:
  199.         print("Clan name/tag already in use")
  200.         return clanCreate()
  201.     else:
  202.         print("Clan creation successful")
  203.    
  204.  
  205. def fetchIP():
  206.     try:
  207.         clanUrl = 'https://legacy.hackerexperience.com/clan'
  208.         html = s.get(clanUrl)
  209.         html = html.text
  210.         soup = BeautifulSoup(html, 'html.parser')
  211.         test = soup.find_all('li')
  212.         ipSplit = test[22].a["href"]
  213.         ip = ipSplit.replace('internet?ip=', '')
  214.         return ip
  215.     except:
  216.         print("Clan failed to create... re-creating new one")
  217.         clanCreate()
  218.         fetchIP()
  219.  
  220. def selfIP():
  221.     homeUrl = 'https://legacy.hackerexperience.com/index'
  222.     html = s.get(homeUrl)
  223.     html = html.text
  224.     soup = BeautifulSoup(html, 'html.parser')
  225.     test = soup.find_all('script')
  226.     calc = test[0].text
  227.     selfIP = calc.replace("var indexdata={ip:'", "")
  228.     selfIP = selfIP.split("',")
  229.     print(selfIP)
  230.     with open("accIP.txt", "a") as ip:
  231.         prep = str(selfIP[0])+"\n"
  232.         ip.writelines(prep)
  233.  
  234. def clanServer():
  235.     selfIP()
  236.     clanIP = fetchIP()
  237.     url = 'https://legacy.hackerexperience.com/internet?ip='+str(clanIP)
  238.     s.get(url)
  239.     url = 'https://legacy.hackerexperience.com/internet?action=login&user=clan&pass=clan'
  240.     s.get(url)
  241.     url = 'https://legacy.hackerexperience.com/internet?view=clan&action=internet'
  242.     acc = bankAccount()
  243.     payload = {
  244.         'acc':acc,
  245.         'act':'net',
  246.         'part-id':'10',
  247.         'price':100000,
  248.         'clan':1
  249.     }
  250.     s.post(url,payload)
  251.     print("Clan internet bought.")
  252.  
  253. def clearClanLog():
  254.     url = 'https://legacy.hackerexperience.com/logEdit'
  255.     payload = {
  256.         'id':0,
  257.         'log':''
  258.     }
  259.     s.post(url,payload)
  260.     print("Clan log successfuly cleared")
  261.  
  262. def clanIP():
  263.     clanUrl = 'https://legacy.hackerexperience.com/clan'
  264.     html = s.get(clanUrl)
  265.     html = html.text
  266.     soup = BeautifulSoup(html, 'html.parser')
  267.     test = soup.find_all('li')
  268.     ipSplit = test[22].a["href"]
  269.     ip = ipSplit.replace('internet?ip=', '')
  270.     with open("clanIP.txt", "a") as file:
  271.         prep = str(ip)+"\n"
  272.         file.writelines(prep)
  273.  
  274. while loop == True:
  275.  
  276.     link()
  277.     certificate1()
  278.     certificate2()
  279.     btcLogin()
  280.     sellBTC()
  281.     buyInternet()
  282.     clanCreate()
  283.     clanServer()
  284.     clanIP()
  285.     clearClanLog()
  286.     logClear()
  287.     print("Email in use!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement