Changes + logging.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m17s

This commit is contained in:
retoor 2024-12-16 19:43:47 +01:00
parent 2f7231b8d9
commit df6e3ac99d

View File

@ -6,6 +6,8 @@ from concurrent.futures import ThreadPoolExecutor as Executor
from ragnar import log from ragnar import log
from ragnar.bot import Bot from ragnar.bot import Bot
import pathlib
def parse_args(): def parse_args():
parser = argparse.ArgumentParser(description="Process username and password.") parser = argparse.ArgumentParser(description="Process username and password.")
@ -18,7 +20,6 @@ def parse_args():
def bot_task(username, password): def bot_task(username, password):
log.info(f"Created new bot runniner. Username: {username}") log.info(f"Created new bot runniner. Username: {username}")
time.sleep(random.randint(1, 20))
while True: while True:
time.sleep(random.randint(1, 120)) time.sleep(random.randint(1, 120))
@ -29,6 +30,10 @@ def bot_task(username, password):
bot.fight() bot.fight()
except Exception as ex: except Exception as ex:
print(ex) print(ex)
with pathlib.Path("errors.log").open("a+") as f:
f.write(str(ex))
f.write("\n")
break
def main(): def main():
@ -36,9 +41,9 @@ def main():
usernames = [ usernames = [
# "no-spam1", # "no-spam1",
# "no-spam2", # "no-spam2",
# "no-spam3", #"no-spam3",
# "no-spam4", #"no-spam4",
# "no-spam", #"no-spam",
"no-spam2353", "no-spam2353",
"no-spam2351", "no-spam2351",
"no-spam2350", "no-spam2350",
@ -48,7 +53,6 @@ def main():
"JaredRuiz", "JaredRuiz",
"LoriMcgee", "LoriMcgee",
"AmandaFloyd", "AmandaFloyd",
"tcpip",
"tcpudp", "tcpudp",
"JoseRodriguez", "JoseRodriguez",
"CaseyHernandez", "CaseyHernandez",