rename flood.max_time -> flood.duration

This commit is contained in:
Your Name
2021-04-26 03:32:05 +02:00
parent be1c6fbb4e
commit 3ab7d9c04d
2 changed files with 3 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ class Config(ComboParser):
self.add_item(section, 'message', str, None, 'message', False)
self.add_item(section, 'threads', int, 1, '# of threads', False)
self.add_item(section, 'once', int, 0, 'quit as soon as possible (default: 0)', False)
self.add_item(section, 'max_time', int, 90, 'maximum time to run (default: 90 secs)', False)
self.add_item(section, 'duration', int, 90, 'maximum time to run (default: 90 secs)', False)
self.add_item(section, 'use_ssl', int, 2, 'Use ssl? (0: false, 1: true, 2: random) - default: 2', False)
self.add_item(section, 'cycle', int, 0, 'cycle flood', False)
self.add_item(section, 'change_nick', int, 0, 'Change nick between messages (useful when flooding privates) - default: 0', False)

View File

@@ -58,8 +58,8 @@ def flood(sock):
ticks = time.time()
sent_ping = False
while True:
if config.flood.max_time > 0:
if (time.time() - ticks) > config.flood.max_time: break
if config.flood.duration > 0:
if (time.time() - ticks) > config.flood.duration: break
recv = sock.recvline()
print(recv.strip())
if not len(recv): break