-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresell.py
113 lines (104 loc) · 4.67 KB
/
resell.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import json, os
import requests, time, json, random, colorama
from colorama import Fore, Back, Style
from colorama import init
init()
with open("config.json") as jsonfile:
config = json.load(jsonfile)
rate = config["smallmaxrate"]
srate = config["smallsellrate"]
resell = config["auto-resell"]
tokens = config["token"]
vbuy = config["valuemaxrate"]
vsell = config["valuesellrate"]
smallurl = "https://api.rbxflip.com/roblox/items/smalls"
itemsurl = "https://api.rbxflip.com/roblox/items"
loginurl = "https://api.rbxflip.com/auth/login"
posturl = "https://api.rbxflip.com/roblox/shop/list"
customrates = {}
with open('customrates.json', 'r') as openfile:
customrates = json.load(openfile)
def sellall():
useCRate = False
if (resell == True):
while True:
try:
tokens = config["token"]
for token in tokens:
print(Fore.CYAN + "ATTEMPTING TO PUT ALL ON SALE")
s = requests.session()
s.headers["authorization"] = token
getsmalls = s.get(smallurl)
getsmalls = getsmalls.json()
smalls = []
itemstosell = []
bigitems = []
items = []
for x in range(len(getsmalls) - 1):
smalls.append(getsmalls[x]["userAssetId"])
getitems = s.get(itemsurl).json()
for item in getitems:
if (item["asset"]["rap"] > 1000):
try:
if (item["asset"]["isProjected"] == False
and item["asset"]["value"] < 25000):
print(Fore.CYAN, "Passed vibe check0")
items.append(item["userAssetId"])
except:
items.append(item["userAssetId"])
x = 0
print(items)
print(smalls)
for item in items:
issmall = False
for small in smalls:
if small == item:
issmall = True
if issmall == False:
itemstosell.append(item)
x += 1
datas = []
i = 0
items = s.get("https://api.rbxflip.com/roblox/items")
items = items.json()
for x in itemstosell:
if i == 5:
break
for item in items:
if (item["userAssetId"] == x):
with open('danny.json', 'r') as openfile:
danny = json.load(openfile)
aid = str(item["asset"]["assetId"])
if (useCRate == True):
try:
crate = customrates[aid]
datas.append({
"userAssetId": x,
"rate": crate[1]
})
print("Custom valued item added")
continue
except:
print(
"Item does not have custom value")
if (danny[aid]["value"] != None):
datas.append({
"userAssetId": x,
"rate": vsell
})
else:
datas.append({
"userAssetId": x,
"rate": srate
})
i += 1
print(Fore.CYAN + str(datas))
selling = s.post(posturl, json=datas)
print(Fore.CYAN + selling.text)
if selling.status_code == 201:
print(Fore.GREEN +
"SUCCESSFULLY LISTED INVENTORY ITEM(S)")
time.sleep(75)
except Exception as e:
print(Fore.RED, e)
sellall()