-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
92 lines (81 loc) · 3.42 KB
/
main.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
# ______ ______ _____ ___
# / __/ /____ ___ ___ _ / ___(_) _/ /_ / _ \___ ________ ___ ____
# _\ \/ __/ -_) _ `/ ' \ / (_ / / _/ __/ / ___/ _ `/ __(_-</ -_) __/
# /___/\__/\__/\_,_/_/_/_/ \___/_/_/ \__/ /_/ \_,_/_/ /___/\__/_/
#
# Created by: github.com/PalmaLuv
# Stay tuned for further app updates
# License : MPL-2.0
# from method.method import SteamGift
import configparser
import client as clientLog
# from PyInstaller import (Token, Error, JsonPrint, prompt)
config = configparser.ConfigParser()
# Storing parameters.
class valProject:
def __init__(self):
self._valLogs = False
self._cookie = ""
@property
def valLogs(self):
return self._valLogs
@valLogs.setter
def valLogs(self, value):
self._valLogs = value
@property
def cookie(self):
return self._cookie
@cookie.setter
def cookie(self, value):
self._cookie = value
thisConfig = valProject()
# Creation and processing of previously created parameters or, if not created, their creation
def workingWithConfig():
config.read('config.ini')
if not config['DEFAULT'].get('cookie'):
thisConfig.cookie = clientLog.askCookie()
else:
thisConfig.cookie = config['DEFAULT'].get('cookie')
if not config['DEFAULT'].get('log_info'):
thisConfig.valLogs = clientLog.askLog()
else:
thisConfig.valLogs = bool(config['DEFAULT'].get('log_info'))
if not config['DEFAULT'].get('cookie') or not config['DEFAULT'].get('log_info'):
clientLog.askReadConfig(thisConfig.cookie, thisConfig.valLogs)
# Editing the script settings *.ini file
def editConfig():
while(True):
editCfg = startCfg = clientLog.ask('list', 'config_edit', 'Choice of Action :', choices= [
'Cookie', 'log info', 'exit'
])['config_edit']
if editCfg == 'Cookie' :
thisConfig.cookie = clientLog.askCookie()
clientLog.askReadConfig(thisConfig.cookie, thisConfig.valLogs)
elif editCfg == 'log info' :
thisConfig.valLogs = clientLog.askLog()
clientLog.askReadConfig(thisConfig.cookie, thisConfig.valLogs)
elif editCfg == 'exit' :
break
# Program launch function
def run():
from method.method import SteamGift as steamGif
for index in range(4):
clientLog.log(clientLog.array_logo[index], "green")
clientLog.log("\nEnjoy using our product!", "white")
clientLog.log("Created by: github.com/PalmaLuv | palmaluv.live\nStay tuner for further app updates","red")
workingWithConfig()
while(True):
startCfg = clientLog.ask('list', 'config_start', 'Choice of Action :', choices= [
'Start', 'Edit'
])['config_start']
if startCfg == 'Start': break
elif startCfg == 'Edit' : editConfig()
pinnedGames = clientLog.ask('confirm', 'pinned', 'Should the bot enter pinned games?')['pinned']
giftTYPE = clientLog.ask('list', 'gift_type', 'Select type:', choices= [
'All', 'WishList', 'Recommended', 'Copies', 'DLC', 'New'
])['gift_type']
minPoin = clientLog.ask('input', 'min_points', 'What is the minimum number of points to remain?')['min_points']
clientLog.createdLogs(thisConfig.valLogs)
steamGif(thisConfig.cookie, giftTYPE, pinnedGames, minPoin).start()
if __name__ == '__main__':
run()