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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
#!/usr/bin/env python3
import requests
import re
from time import sleep
from datetime import datetime, timezone, timedelta
from os import fork
from threading import Timer
post_cooloff = 7
rs = requests.session()
rp = rs.post('https://recolor.me/login?json', data = {
'action':'login',
'account_name':'testingaccount1',
'account_password':'1234',
'account_cookie':'1'})
if not rp.json()['account_id']:
print("wrong login info!")
exit(1)
rp = rs.get('https://recolor.me/')
key_pos = rp.text.find("site.my_key = \'") + len("site.my_key = ")
#key = rp.text[key_pos:key_pos+32]
key = re.search("site.my_key = \'(.*)\';", rp.text).groups()[0]
# automaticly generated from qs_to_list.py
levels = [[['1'], ['1'], ['1'], ['032']],
[['2'], ['0'], ['1'], ['30103']],
[['3'], ['1'], ['0'], ['12301210']],
[['4'], ['0'], ['0'], ['012123']],
[['5'], ['1'], ['0'], ['030321']],
[['6'], ['0'], ['1'], ['01032103']],
[['7'], ['0'], ['0'], ['103212']],
[['8'], ['0'], ['1'], ['12123010']],
[['9'], ['0'], ['0'], ['0123']],
[['10'], ['1'], ['0'], ['0']],
[['11'], ['0'], ['1'], ['20321010']],
[['12'], ['1'], ['1'], ['303230101']],
[['13'], ['0'], ['0'], ['012123012321212103']],
[['14'], ['1'], ['0'], ['2130']],
[['15'], ['0'], ['0'], ['030110310']],
[['16'], ['1'], ['0'], ['03212301230320123032']],
[['17'], ['1'], ['0'], ['2222011112321']],
[['18'], ['0'], ['0'], ['210103010323232']],
[['19'], ['1'], ['1'], ['32123032121302103032101']],
[['65'], ['1'], ['0'], ['2103230123']],
[['66'], ['1'], ['0'], ['230301230301']],
[['67'], ['0'], ['1'], ['3012301121231203012121203012123']],
[['68'], ['0'], ['0'], ['032103012']],
[['69'], ['0'], ['1'], ['30321032123232132103203210321232321210']],
[['70'], ['1'], ['1'], ['3012321032103012032103212']],
[['71'], ['0'], ['0'], ['030323030101013232103010123']],
[['72'], ['1'], ['1'], ['23212321321032313012123010132321231023032123030']],
[['73'], ['1'], ['0'], ['3030']]]
def beat_games():
sleep(7)
rs.post('https://recolor.me/topic/1557621', data={
'key':key,
'page':'topic',
'action':'reply',
'topic_id':'1557621',
'reply_message':"Completing levels...",
'box_color':'#0000ff',
'post_color':'#0',
'post_style':'0'
})
for level in levels:
sleep(7);
rs.post('https://recolor.me/slide', data = {
'page':'slide',
'action':'complete',
'level':level[0],
'hflip':level[1],
'vflip':level[2],
'solution':level[3],
'key':key})
sleep(7)
rs.post('https://recolor.me/topic/1557621', data={
'key':key,
'page':'topic',
'action':'reply',
'topic_id':'1557621',
'reply_message':"Levels completed!",
'box_color':'#0000ff',
'post_color':'#0',
'post_style':'0'})
def acheive_limit():
uncaped = True
check_space = 20
on_post = check_space
while uncaped:
sleep(7)
on_post += 1
if on_post > check_space:
on_post = 0
rp = rs.get('https://recolor.me/account')
bits = re.search("site.my_bits = (\d*);", rp.text).groups()[0]
bit_limit = re.search("site.limit_bits = (\d*);", rp.text).groups()[0]
daily_limit = re.search("site.daily_limit = (\d*);", rp.text).groups()[0]
limit_percentage = int((int(daily_limit) / int(bit_limit)) * 100)
print("total bits: {}\nbit cap: {}/{}\t\t{}%".format(bits, daily_limit, bit_limit, limit_percentage))
if daily_limit == bit_limit:
uncaped = False
rs.post('https://recolor.me/topic/1557621', data={
'key':key,
'page':'topic',
'action':'reply',
'topic_id':'1557621',
'reply_message':"Done for today!\nSleeping until 06:01 UTC.",
'box_color':'#0000ff',
'post_color':'#0',
'post_style':'0'
})
rs.post('https://recolor.me/topic/1557621', data={
'key':key,
'page':'topic',
'action':'reply',
'topic_id':'1557621',
'reply_message':"Daily quota: {}/{}\t{}%\nLast checked {} messages ago\nNext check is {} messages from now".format(daily_limit, bit_limit, limit_percentage, on_post, check_space - on_post),
'box_color':'#0000ff',
'post_color':'#0',
'post_style':'0'
})
rs.post('https://recolor.me/topic/1557621', data={
'key':key,
'page':'topic',
'action':'reply',
'topic_id':'1557621',
'reply_message':"Server is rebooting, or service has restarted.\nThe time is {} UTC.\nExistence started {} seconds ago.".format(datetime.now(timezone.utc), int(datetime.now().timestamp())),
'box_color':'#0000ff',
'post_color':'#0',
'post_style':'0'
})
def bot_routine():
print("starting games routine...")
beat_games()
print("games are completed, staring post routine...")
acheive_limit()
bot_routine()
while True:
current_time = datetime.now(timezone.utc)
desired_time = current_time.replace(day=current_time.day, hour=6, minute=1, second=0, microsecond=0) + timedelta(days=1)
print("starting next run at {}".format(str(desired_time)))
cap_thread = Timer((desired_time - current_time).total_seconds()+1, bot_routine)
cap_thread.start()
cap_thread.join()
# level structure:
# 0: str hflip
# 1: str vflip
# 2: str steps
#rp = rs.post('https://recolor.me/', data = {
# 'page':'slide',
# 'action':'complete',
# 'level':'7',
# 'hflip':'1',
# 'vflip':'0',
# 'solution':'301232',
# 'key':key
# })
|