This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROXYLESS-Main_Sender.py
164 lines (131 loc) · 5.07 KB
/
PROXYLESS-Main_Sender.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import requests, time, json, threading
import dateutil.parser as dp
from itertools import cycle
__ownerId = 93937677
cookie = 'YOUR ACCOUNT COOKIE HERE'
ownersUrl = 'https://inventory.roblox.com/v2/assets/' # %d/owners?limit=10
sendTradeUrl = 'https://trades.roblox.com/v1/trades/send'
canTrade = 'https://trades.roblox.com/v1/users/' # %d/can-trade-with
AlreadyTradingWith = {}
with open('indexed.txt', 'r') as file:
f = file.read().replace('\n', '')
file.close()
indexedUsers = json.loads(f)
with open('whitelist.txt', 'r') as filew:
w = filew.read().replace('\n', '')
filew.close()
whitelist = json.loads(w)
def recentlyOnline(USERID):
userlastonline = requests.get(url='https://api.roblox.com/users/' + str(USERID) + '/onlinestatus/')
if 'errors' in userlastonline:
print('Delaying for 7 seconds due to rate limitation')
time.sleep(7)
return recentlyOnline(USERID)
userlastonline = userlastonline.json()
lastonline = userlastonline['LastOnline']
parsed_time = dp.parse(lastonline)
time_in_seconds = parsed_time.timestamp()
final_time = time.time()-time_in_seconds
return final_time/345600 <= 1
def CanUserTrade(USERID):
r = requests.get(canTrade + str(USERID) + '/can-trade-with', headers={'cookie': f'.ROBLOSECURITY={cookie}' + ';'}).json()
if 'errors' in r:
print('Delaying for 7 seconds due to rate limitation')
time.sleep(7)
return CanUserTrade(USERID)
if r['canTrade'] == True:
return True
return False
OfferItem1 = input('Item UAID #1 you are offering > ')
OfferItem2 = input('Item UAID #2 you are offering (optional) > ')
OfferItem3 = input('Item UAID #3 you are offering (optional) > ')
OfferItem4 = input('Item UAID #4 you are offering (optional) > ')
Requesting1 = input('Item ID #1 you are requesting > ')
itemId = Requesting1
ItemsSending = []
ItemsSending.insert(1, int(OfferItem1))
if OfferItem2.isnumeric():
ItemsSending.insert(1, int(OfferItem2))
if OfferItem3.isnumeric():
ItemsSending.insert(1, int(OfferItem3))
if OfferItem4.isnumeric():
ItemsSending.insert(1, int(OfferItem4))
SendToWhitelist = input('Send to whitelist? (yes/no) > ')
if SendToWhitelist.lower() in ['true', 't', 'y', 'ye', 'yes', 'yeah', 'yup']:
SendToWhitelist = True
else:
SendToWhitelist = False
XCSRF_Token = None
def loadXCSRF_Token():
auth_response = requests.post('https://auth.roblox.com/v1/logout', headers={'cookie': f'.ROBLOSECURITY={cookie}' + ';'})
if 'x-csrf-token' in auth_response.headers:
global XCSRF_Token
XCSRF_Token = auth_response.headers['x-csrf-token']
else:
print('exit')
exit()
def sendTrade(userId, request):
print('Sending trade to', userId)
data = json.dumps({
"offers": [
{
"userId": __ownerId,
"userAssetIds": ItemsSending,
"robux": 22
},
{
"userId": userId,
"userAssetIds": [
request
],
#"robux": 0
}
]
}, separators=(',', ':'))
loadXCSRF_Token()
requests.post("https://trades.roblox.com/v1/trades/send", data=data, headers={'cookie': f'.ROBLOSECURITY={cookie}', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': XCSRF_Token})
index = 0
owners = requests.get(ownersUrl + str(itemId) + '/owners?limit=100', headers={'cookie': f'.ROBLOSECURITY={cookie}' + ';'}).json()
while True:
print('\n', index, '\n')
for x in owners['data']:
index += 1
#try:
if not x['owner']:
continue
ownerId = str(x['owner']['id'])
if ownerId in AlreadyTradingWith:
print('Already trading with', ownerId)
continue
if ownerId in indexedUsers:
print('Passed', ownerId)
continue
if not ownerId in whitelist:
if not recentlyOnline(x['owner']['id']):
indexedUsers[x['owner']['id']] = True
continue
if not CanUserTrade(x['owner']['id']):
indexedUsers[x['owner']['id']] = True
continue
else:
if not SendToWhitelist:
continue
print(ownerId, 'whitelisted')
AlreadyTradingWith[ownerId] = True
f = open('indexed.txt', 'w')
f.write(json.dumps(indexedUsers, separators=(',', ':')))
f.close()
whitelist[x['owner']['id']] = True
f = open('whitelist.txt', 'w')
f.write(json.dumps(whitelist, separators=(',', ':')))
f.close()
def TRADE():
sendTrade(x['owner']['id'], x['id'])
TRADE()
#threading.Thread(target=TRADE, args=()).start()
#except:
#print('DUMPED')
if owners['nextPageCursor']:
owners = requests.get(ownersUrl + str(itemId) + '/owners?cursor=' + owners['nextPageCursor'] + '&limit=100', headers={'cookie': f'.ROBLOSECURITY={cookie}' + ';'}).json()
else:
break