Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. import requests, re, threading, ctypes, json, time, datetime, os, random
  2.  
  3. settings = json.load(open("settings.json", 'r'))
  4. rn = datetime.datetime.now()
  5.  
  6. print("{} | Settings loaded successfully ".format(str(rn.strftime("%H:%M:%S"))))
  7. session = requests.session()
  8. session.cookies[".ROBLOSECURITY"] = settings["cookie"]
  9.  
  10. rbx = session.get("https://www.roblox.com/mobileapi/userinfo")
  11. if rbx.status_code == 200:
  12. print("{} | vSnipe v1.0.0 starting with".format(str(rn.strftime("%H:%M:%S"))), rbx.json()["RobuxBalance"], "Robux")
  13. else:
  14. raise ValueError("Invalid cookie.")
  15. robux = rbx.json()["RobuxBalance"]
  16.  
  17. crsf_token = ""
  18. buys = 0
  19.  
  20.  
  21. def crsf24():
  22. global crsf_token
  23. while True:
  24. crsf_token = re.search(r"<script>Roblox.XsrfToken.setToken\('(.*?)'\);</script>", session.get('https://www.roblox.com/games/?SortFilter=default&TimeFilter=0').text).group(1)
  25. time.sleep(5)
  26. attempts = 0
  27.  
  28. settings["ids"] = settings["ids"]*15
  29.  
  30. def _cthread(id1):
  31. global attempts
  32. global buys
  33. global robux
  34. asset = id1
  35. avg_price = int(round(requests.get(f"https://www.roblox.com/asset/{asset}/sales-data").json()["data"]["AveragePrice"] / 2, 0))
  36. pid = session.get(f"http://api.roblox.com/marketplace/productInfo?assetId={asset}").json()["ProductId"]
  37. while True:
  38. try:
  39. req = session.get(f"https://www.roblox.com/asset/resellers?productId={pid}&startIndex=0&maxRows=3")
  40. attempts += 1
  41. if req.status_code == 429:
  42. time.sleep(5)
  43. continue
  44.  
  45. for i in req.json()["data"]["Resellers"]:
  46. if i["Price"] <= avg_price and i["Price"] <= robux:
  47. print(f"{rn.strftime('%H:%M:%S')} | Attempting to buy.")
  48. a = session.post(f'https://www.roblox.com/api/item.ashx?rqtype=purchase&productID={pid}&expectedCurrency=1&expectedPrice={i["Price"]}&expectedSellerID={i["SellerId"]}&userAssetID={i["UserAssetId"]}', headers={"X-CSRF-TOKEN": crsf_token})
  49. print(a.text)
  50. if session.get("https://www.roblox.com/mobileapi/userinfo").json()["RobuxBalance"] != robux:
  51. buys += 1
  52. robux -= int(i["Price"])
  53. except requests.urllib3.exceptions.ConnectTimeoutError as E:
  54. pass
  55. ctypes.windll.kernel32.SetConsoleTitleW(f"vSnipe v1.0.0 | Tries: {attempts} | Snipes: {buys} | Robux left: {robux}")
  56. for _ in range(len(settings["ids"])):
  57. aid = settings["ids"].pop()
  58. print("hi!")
  59. threading.Thread(target=_cthread, args=[aid]).start()
  60.  
  61. for e in range(1):
  62. threading.Thread(target=crsf24).start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement