diff options
author | ngharo <ngharo@gmail.com> | 2018-06-29 23:37:52 -0500 |
---|---|---|
committer | ngharo <ngharo@gmail.com> | 2018-06-29 23:37:52 -0500 |
commit | cd1072f2aa51157112a9d210f7144cec5a762171 (patch) | |
tree | 3bbe3d7ce3c8da0739e01bbef2aff8adb5929c41 /main.py | |
parent | 49c83f0c693890f1e2df33919606362890bf726d (diff) | |
download | ansibots-cd1072f2aa51157112a9d210f7144cec5a762171.tar.xz ansibots-cd1072f2aa51157112a9d210f7144cec5a762171.zip |
WIPrewrite
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/main.py b/main.py deleted file mode 100644 index 2b8a902..0000000 --- a/main.py +++ /dev/null @@ -1,41 +0,0 @@ -import sys -import math -import collections -import zokket -from bot import Bot - -botname_prefix = 'audzx' -queue = collections.deque() -rate = 5.0 # messages -per = 8.0 # seconds -max_workers = 6 -channel = '#test123aszz' - -if len(sys.argv) == 2: - channel = sys.argv[1] - -if channel[0] != '#': - channel = '#' + channel - -linecount = 0 -for line in sys.stdin: - queue.append(line.strip()) - linecount += 1 - -workers = int(math.ceil(linecount / rate)) -if workers > max_workers: - workers = max_workers - -if workers == 0: - sys.exit(1) - -print 'starting {} worker threads'.format(workers) -threads = [] -for i in range(workers): - botname = botname_prefix + chr(97 + i) - threads.append(Bot(channel, threads, queue, botname, rate, per)) - -for bot in threads: - bot.start() - -zokket.DefaultRunloop.run() |