forked from OlympicCode/vHackXTBot-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.py
More file actions
54 lines (44 loc) · 1.65 KB
/
Copy pathupdate.py
File metadata and controls
54 lines (44 loc) · 1.65 KB
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
from classes import API
from utils import Utils
class Update:
def getTasks(self):
ut = Utils()
temp = ut.requestString("user::::pass::::uhash", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "userHash_not_needed", "vh_tasks.php")
return temp
def getTaskAmount(self):
ut = Utils()
temp = self.getTasks()
return len(temp.split("taskid")) - 1
def getTaskIDs(self):
temp = self.getTasks()
tasks = temp.split('"taskid":"')[1:]
n = []
for i1 in tasks:
n.append(i1.split('"')[0])
return n
def startTask(self,type):
ut = Utils()
temp = ut.requestString("user::::pass::::uhash::::utype", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "userHash_not_needed" + "::::" + type, "vh_addUpdate.php")
if "result" in temp:
return temp.split('result":"')[1].split('"')[0]
return "2"
def finishTask(self, taskID):
ut = Utils()
temp = ut.requestString("user::::pass::::uhash::::taskid", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "userHash_not_needed" + "::::" + taskID, "vh_finishTask.php")
if "4" in temp:
return True
else:
return False
def finishAll(self):
ut = Utils()
temp = ut.requestString("user::::pass::::uhash", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "userHash_not_needed", "vh_finishAll.php")
if "0" in temp:
return True
else:
return False
def useBooster(self):
ut = Utils()
temp = ut.requestString("user::::pass::::uhash::::boost", self.api.getUsername() + "::::" + self.api.getPassword() + "::::" + "userHash_not_needed" + "::::" + "1", "vh_tasks.php")
return temp
def __init__(self,api):
self.api = api