Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Fix autolevelling
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Nauman Raza committed Jan 12, 2022
1 parent f9e8e69 commit e016a15
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def spam():
while True:
num = f'{random.randint(1, 10000000000000000)}'
bot.sendMessage(channel_id, f'{num}')
time.sleep(1.5)
time.sleep(2)

def start_spam():
new_process = multiprocessing.Process(target=spam)
Expand Down Expand Up @@ -80,19 +80,19 @@ def on_message(resp):
if 'pokémon has appeared!' in embed_title:
time.sleep(2)
bot.sendMessage(channel_id, 'p!h')
if 'is now level' in embed_content:
elif 'is now level' in embed_content:
stop(spam_process)
split = embed_content.split(' ')
level = int(split[6].replace('!', ''))
if level != 100:
level = split[5].replace('!', '')
if int(level) != 100:
pass
else:
bot.sendMessage(channel_id, f"p!s {to_level}")
ptr = 1
with open('data/level.txt', 'w') as f:
for line in lines:
if ptr != 1:
f.write(line)
ptr += 1
with open('data/level.txt', 'r') as fin:
data = fin.read().splitlines(True)
with open('data/level.txt', 'w') as fout:
fout.writelines(data[1:])
spam_process = start_spam()
else:
content = m['content']
if 'The pokémon is ' in content:
Expand Down

0 comments on commit e016a15

Please sign in to comment.