Skip to content
This repository was archived by the owner on Apr 7, 2019. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def startFunctionUpdate(self):


# get applications and update this
# check number of running tasks before the start of the for loop
# this value is stored in the variable update and should be incremented with every successfull update.
# This will reduce the number of requests sent to the server which will lower chances of botting detection.
getTask = self.ut.requestString("tasks.php", accesstoken=self.Configuration["accessToken"])
if 'updateCount' in getTask.keys():
update = getTask['updateCount']

for applications in self.store["apps"]:
getTask = self.ut.requestString("tasks.php",
accesstoken=self.Configuration["accessToken"])
try:
update = len(getTask["updates"])
except KeyError:
update = 0

if update < 10:
Appid = int(applications["appid"])
for list_update in self.Configuration["update"]:
Expand All @@ -37,8 +37,10 @@ def startFunctionUpdate(self):
accesstoken=self.Configuration["accessToken"],
appcode=application_update,
action="100")
self.ut.viewsPrint("showMsgUpdate", "[{}] - Update for your {} +1".format(os.path.basename(__file__), list_update))
time.sleep(0.5)
if result['result'] == '0':
self.ut.viewsPrint("showMsgUpdate", "[{}] - Update for your {} +1".format(os.path.basename(__file__), list_update))
update = update + 1
time.sleep(0.5)
else:
self.ut.viewsPrint("showMsgUpdate", "[{}] - you have not money to upgrade {}".format(os.path.basename(__file__), list_update))
time.sleep(0.5)
Expand Down