-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
133 lines (100 loc) · 3.59 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
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
# This is a sample Python script.
from scrapy import Request
from scrapy.http.response import Response
from scrapy.spiders import Spider
from scrapy.http import FormRequest
import lxml.etree
import lxml.html
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
class getWolf(Spider):
name = "wolf-bot"
def start_request(self):
return [FormRequest(self.args1,
formdata={'user':'[email protected]', 'pass':'rukidding'}, callback=log_parse)]
def __init__(self, sNewWebsite="https://wolf.live/my+gams"):
self.args1 = sNewWebsite
if __name__ == '__main__':
print("[+] Running getWolf")
response = self.start_request()
print(response)
def log_parse(self, response):
print("test1")
print("[+] Logged visit to %s" % self.args1)
def getWebsiteRequest(self, response):
print("[+] argument type %s" % self.args1)
response = lxml.html.fromstring(self.start_request())
lxml.etree.strip_elements(response, lxml.etree.Comment, "script", "head")
return lxml.html.tostring(response, method="text", encoding=unicode)
class typingGame:
def __init__(self, args1="<--| trashcan | -->"):
self.args1 = args1
def invoke(self):
return print("!print")
def sanitize(self):
sOutput = self.args1
sOutput = sOutput.replace('<', '')
sOutput = sOutput.replace('-', '')
sOutput = sOutput.replace('|', '')
sOutput = sOutput.replace(' ', '')
sOutput = sOutput.replace('>', '')
return sOutput
class matheleticsBot:
def __init__(self, args1="2x4 + 21"):
self.args1 = args1
def orderOfOperations(self):
sOutput = self
sOutput = sOutput.replace('x', '*')
sOutput = sOutput.replace(' ', '')
sOutput = sOutput.replace('"', '')
dOutput = eval(sOutput)
return dOutput
def invoke(self):
return print("!math")
class countDownBot:
def check_sums(array, k): #TODO REDO THIS FUNCTION
potential_solutions = set()
for num in array:
if num in potential_solutions:
return True
potential_solutions.add(k - num)
return False
def __init__(self, args1=[2, 9, 25, 10, 3], args2=309):
self.args1 = args1
self.args2 = args2
class readBackwards:
def __init__(self, args1="racecar"):
self.args1 = args1
def readStringBackwards(self, backWord):
'''backWord is now reversed'''
return backWord[::-1]
def sanitizeString(self, frontWord):
frontWord = frontWord.replace('|', '')
frontWord = frontWord.replace('-', '')
frontWord = frontWord.replace('<', '')
frontWord = frontWord.replace('>', '')
frontWord = frontWord.replace(' ', '')
return frontWord
def runRead(self):
sOutput = readBackwards.sanitizeString(self, readBackwards.readStringBackwards(self, self.args1))
print('output is %s' % sOutput)
return sOutput
if __name__ == "__main__":
# execute only if run as a script
print("[+] Running wordSwitch")
# adding
'''games to run'''
#ReadBackwards
object = readBackwards() # initialize with regular arguments racecar
print(object.runRead())
#getWolf connection helpa
sp=Spider
print(sp.name)
object=getWolf(Spider)
#typing game
object=typingGame()
print(object.sanitize())
#math game
print(matheleticsBot.orderOfOperations("2x2 + 23"))
#wcd
object = countDownBot()