Skip to content

Commit b767b53

Browse files
committed
Added US/CA, fixed lot of bugs, updated Readme
1 parent 0d32821 commit b767b53

File tree

3 files changed

+104
-39
lines changed

3 files changed

+104
-39
lines changed

CommandL/encrypt.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,21 @@ def decr(value):
5858
except UnicodeDecodeError:
5959
print('Password is probably incorrect')
6060
exit(1)
61+
62+
def update(pd):
63+
old = []
64+
config = ConfigParser()
65+
config.read('config.cnf')
66+
if config.items(config.sections()[0])[-1][0] == 'cardtype':
67+
newconf = ConfigParser()
68+
newconf.add_section('SupremeBotConfig')
69+
old = config.items(config.sections()[0])
70+
for x in pd:
71+
for y in old:
72+
if y[0] in x.lower():
73+
pd[x] = y[1]
74+
newconf.set(config.sections()[0], x, y[1])
75+
76+
cfgfile = open('config.cnf', 'w')
77+
newconf.write(cfgfile)
78+
cfgfile.close()

CommandL/main.py

Lines changed: 85 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@
3030

3131
LOGFILE = True
3232

33-
pDescr = {'Country': '(UK, DE, FR, ...)', 'CardMonth': '(01, 02, ..., 12)', 'Name': '(first and last name)'}
33+
EUpDescr = {'Country': '(UK, DE, FR, ...)', 'CardMonth': '(01, 02, ..., 12)', 'Name': '(first and last name)', 'CardType': '(or enter "Paypal")'}
34+
USpDescr = {'Country': '(USA or CANADA)', 'CardMonth': '(01, 02, ..., 12)', 'Name': '(first and last name)', 'Addr3': '(State abbreviation: AL, AK, AS, ...)'}
3435

3536
paydetails = OrderedDict(
36-
[('Name', ''), ('Email', ''), ('Phone', ''), ('Addr1', ''), ('Addr2', ''),
37-
('Addr3', ''),
38-
('City', ''), ('Post/zip code', ''), ('Country', ''), ('Cardno', ''),
39-
('CardCVV', ''),
40-
('CardMonth', ''), ('CardYear', ''), ('CardType', '')])
37+
[('Name', ''), ('Email', ''), ('Phone', ''), ('Addr1', ''), ('Addr2', ''), ('Addr3', ''),
38+
('City', ''), ('Post/zip code', ''), ('Country', ''), ('CardType', ''), ('Cardno', ''),
39+
('CardCVV', ''), ('CardMonth', ''), ('CardYear', '')])
4140

4241
categoryList = ['jackets', 'shirts', 'tops_sweaters', 'sweatshirts', 'pants', 'hats', 'bags',
4342
'accessories', 'shoes', 'skate']
@@ -73,7 +72,6 @@ def writeLog(txt):
7372

7473

7574
def selectSize():
76-
global sizeC
7775
sizeC = 0
7876
sizes = ["Small", "Medium", "Large", "XLarge"]
7977
print("Select Size (Alternatively simply enter 'D' for the first available size)")
@@ -86,7 +84,7 @@ def selectSize():
8684
if sizeInput in sizes:
8785
return sizeInput
8886
elif sizeInput == "D":
89-
sizeC = 1
87+
return sizeInput
9088
else:
9189
print("Please enter one of the listed sizes exactly")
9290
print(sizeInput)
@@ -100,17 +98,13 @@ def selectSize():
10098
if 'US ' in sizeInput and ' / UK ' in sizeInput:
10199
return sizeInput
102100
elif sizeInput == "D":
103-
sizeC = 1
101+
return sizeInput
104102
else:
105103
print("Please enter a correctly formated size")
106104
return selectSize()
107105

108106
else:
109107
sizeInput = input("Select size: ").title()
110-
if sizeInput == "D":
111-
sizeC = 1
112-
elif sizeInput != "D":
113-
sizeC = 2
114108
return sizeInput
115109

116110

@@ -138,10 +132,22 @@ def check_exists_by_xpath(xpath, driver):
138132

139133

140134
def returnTime():
141-
timeS = "Please enter the hour of the drop (e.g. if you're in the UK enter '11' for 11.00am) "
135+
timeEU = "Please enter the hour of the drop (e.g. if you're in the UK enter '11' for 11.00am) "
136+
timeUS = "Please enter the hour of the drop "
137+
if reg == 'EU':
138+
timeS = timeEU
139+
elif reg == 'US':
140+
timeS = timeUS
142141

143142
isTime = input(timeS)
144-
dropTime = int(isTime)
143+
if len(isTime) < 0:
144+
print('Invalid input')
145+
sys.exit(1)
146+
try:
147+
dropTime = int(isTime)
148+
except:
149+
print('Invalid input')
150+
sys.exit(1)
145151
text = "Drop selected for "
146152
text += isTime
147153
text += ":00"
@@ -157,12 +163,12 @@ def returnTime():
157163

158164

159165
def sendKeys(value, field, driver):
160-
if len(value) <= 1:
166+
if len(value) < 1:
161167
return None
162168
try:
163169
driver.execute_script("arguments[0].value = '" + value + "';", field)
164170
except WebDriverException:
165-
pass
171+
print(field.get_attribute('Name'))
166172

167173

168174
def selectText(value, obj, attr=False):
@@ -230,8 +236,11 @@ def searchItem(item):
230236
time.sleep(0.5+random())
231237

232238
try:
233-
if sizeC != 1:
234-
size = Select(driver.find_element_by_id("size"))
239+
if item['selectedSize'] != 'D':
240+
if reg == 'EU':
241+
size = Select(driver.find_element_by_id("size"))
242+
elif reg == 'US':
243+
size = Select(driver.find_element_by_id("s"))
235244
op = size.options
236245
found = False
237246
for x in op:
@@ -270,7 +279,7 @@ def openChrome():
270279

271280

272281
def cart():
273-
cart = check_exists_by_xpath("""//*[@id="cart"]/a[2]""", driver)
282+
cart = driver.find_elements_by_class_name('checkout')[0]
274283
cart.click()
275284

276285
name = check_exists_by_xpath("""//*[@id="order_billing_name"]""", driver)
@@ -288,39 +297,50 @@ def cart():
288297
add2 = check_exists_by_xpath("""//*[@id="oba3"]""", driver)
289298
sendKeys(paydetails['Addr2'], add2, driver)
290299

291-
add3 = check_exists_by_xpath("""//*[@id="order_billing_address_3"]""", driver)
292-
sendKeys(paydetails['Addr3'], add3, driver)
300+
country = Select(driver.find_element_by_name("order[billing_country]"))
301+
selectText(paydetails['Country'], country, True)
302+
303+
if reg == 'EU':
304+
add3 = check_exists_by_xpath("""//*[@id="order_billing_address_3"]""", driver)
305+
sendKeys(paydetails['Addr3'], add3, driver)
306+
elif reg == 'US':
307+
state = Select(driver.find_element_by_name("order[billing_state]"))
308+
selectText(paydetails['Addr3'], state, True)
293309

294310
city = check_exists_by_xpath("""//*[@id="order_billing_city"]""", driver)
295311
sendKeys(paydetails['City'], city, driver)
296312

297313
postcode = check_exists_by_xpath("""//*[@id="order_billing_zip"]""", driver)
298314
sendKeys(paydetails['Post/zip code'], postcode, driver)
299315

300-
country = Select(driver.find_element_by_name("order[billing_country]"))
301-
selectText(paydetails['Country'], country, True)
316+
if reg == 'EU':
317+
cardType = Select(driver.find_element_by_id("credit_card_type"))
318+
selectText(paydetails['CardType'].lower(), cardType, True)
302319

303-
if paydetails['CardType'] != 1:
304-
cardno = check_exists_by_xpath("""//*[@id="cnb"]""", driver)
320+
if paydetails['CardType'].lower() != 'paypal':
321+
if reg == 'EU':
322+
cardno = check_exists_by_xpath("""//*[@id="cnb"]""", driver)
323+
elif reg == 'US':
324+
cardno = check_exists_by_xpath("""//*[@id="nnaerb"]""", driver)
305325
sendKeys(paydetails['Cardno'], cardno, driver)
306326

307-
cvv = check_exists_by_xpath("""//*[@id="vval"]""", driver)
327+
if reg == 'EU':
328+
cvv = check_exists_by_xpath("""//*[@id="vval"]""", driver)
329+
elif reg == 'US':
330+
cvv = check_exists_by_xpath("""//*[@id="orcer"]""", driver)
308331
sendKeys(paydetails['CardCVV'], cvv, driver)
309332

310-
cardType = Select(driver.find_element_by_id("credit_card_type"))
311-
selectText(paydetails['CardType'], cardType)
312-
313333
expiraryDate1 = Select(driver.find_element_by_name("credit_card[month]"))
314-
selectText(paydetails['CardMonth'], expiraryDate1)
334+
selectText(paydetails['CardMonth'], expiraryDate1, True)
315335

316336
expiraryDate2 = Select(driver.find_element_by_name("credit_card[year]"))
317-
selectText(paydetails['CardYear'], expiraryDate2)
337+
selectText(paydetails['CardYear'], expiraryDate2, True)
318338

319339
tickBox = driver.find_element_by_xpath("""//*[@id="cart-cc"]/fieldset/p/label/div/ins""")
320340
tickBox.click()
321341

322342
complete = check_exists_by_xpath("""//*[@id="pay"]/input""", driver)
323-
complete.click()
343+
#complete.click()
324344
print("Complete the captcha and confirm the order manually. Thanks for using me ;)")
325345
print("If this bot helped you make money/cop a nice item, please consider donating to a charity of your choice")
326346

@@ -347,11 +367,16 @@ def selectCategory():
347367

348368
def getPDetails():
349369
global password
370+
pp = False
350371
for x in paydetails:
351-
if x in pDescr:
372+
if (reg == 'US' and x == 'CardType') or (pp and (x == 'Cardno' or x == 'CardCVV' or x == 'CardMonth' or x == 'CardYear')):
373+
paydetails[x] = 'Not Used'
374+
elif x in pDescr:
352375
paydetails[x] = input('Enter %s %s: ' % (x, pDescr[x]))
353376
else:
354377
paydetails[x] = input('Enter %s: ' % (x))
378+
if reg == 'EU' and paydetails['CardType'].lower() == 'paypal':
379+
pp = True
355380

356381
inp = input('\n\nDo you want to safe your details encrypted for easy future use? [Y]es/[N]o: ')
357382
if inp.upper() == 'YES' or inp.upper() == 'Y':
@@ -389,11 +414,15 @@ def selectItemNum():
389414
def getItemDetails():
390415
global items, selectedCategory
391416
while True:
392-
selectedCategory = selectCategory()
393-
keywords = selectKeywords()
417+
#selectedCategory = selectCategory()
418+
selectedCategory = 'jackets'
419+
#keywords = selectKeywords()
420+
keywords = ['World', 'Famous']
394421

395-
selectedSize = selectSize()
396-
selectedColour = selectColour()
422+
#selectedSize = selectSize()
423+
selectedSize = 'D'
424+
#selectedColour = selectColour()
425+
selectedColour = 'Green'
397426

398427
listOptions(selectedCategory, ','.join(keywords), selectedSize, selectedColour)
399428
answer = input("Are you sure about these settings? [Y]es/[N]o: ").upper()
@@ -403,9 +432,18 @@ def getItemDetails():
403432
items.append({'selectedCategory': selectedCategory, 'keywords': keywords, 'selectedSize': selectedSize, 'selectedColour': selectedColour})
404433

405434

435+
def getRegion():
436+
inp = input('Enter region (EU or US): ')
437+
if inp.upper() == 'EU':
438+
return 'EU'
439+
elif inp.upper() == 'US':
440+
return 'US'
441+
else:
442+
return getRegion()
443+
406444

407445
def main():
408-
global service, capabilities, password, items
446+
global service, capabilities, password, items, reg, pDescr
409447
wsh = comclt.Dispatch("WScript.Shell")
410448
chromePath = readPath()
411449

@@ -421,12 +459,20 @@ def main():
421459
print(
422460
"\nFill out all the details, make sure you get all of them right. If you need help please open 'README.md' or check the reddit post.")
423461

462+
reg = getRegion()
463+
464+
if reg == 'EU':
465+
pDescr = EUpDescr
466+
elif reg == 'US':
467+
pDescr = USpDescr
468+
424469
if not path.isfile(getLoc('config.cnf')):
425470
enc.paydetails = paydetails
426471
enc.initConf()
427472
getPDetails()
428473
else:
429474
inp = input('Do you want to use your stored details? [Y]es/[N]o: ')
475+
enc.update(paydetails)
430476
if inp.upper() == 'YES' or inp.upper() == 'Y':
431477
inp = input('Enter your password: ')
432478
enc.password = inp.encode('ascii')

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The official source code for FESBSC. Development is still in progress.
55
2. Add the GUI back
66
3. Counter new anti-bot counter-measures
77
# Features
8+
- US/CA and EU region supported !!
89
- Save payment information locally encrypted with AES
910
- Purchase multiple items at once, no more than one of each item allowed.
1011
- Strict item selection. This will only buy an item which has a **100%** match to your specified information. This will try to guaranty NO wrong purchases due to timing or similar named items

0 commit comments

Comments
 (0)