mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
using actual pseudo-random instead of just the time
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import sys, os, re, time, urllib, pickle
|
import sys, os, re, time, urllib, pickle, random
|
||||||
|
|
||||||
BUFSIZ = 8192
|
BUFSIZ = 8192
|
||||||
delay = 0.100 # seconds
|
delay = 0.100 # seconds
|
||||||
@@ -116,7 +116,7 @@ def extract_url(data):
|
|||||||
char = """,._-+=\|/*`~"'"""
|
char = """,._-+=\|/*`~"'"""
|
||||||
message = 'No text but %s, 1-bit ASCII art preview: [%c] %s' %(
|
message = 'No text but %s, 1-bit ASCII art preview: [%c] %s' %(
|
||||||
e(title),
|
e(title),
|
||||||
char[int(time.time() % len(char))],
|
random.choice(char),
|
||||||
e(r)
|
e(r)
|
||||||
)
|
)
|
||||||
elif 2 == status:
|
elif 2 == status:
|
||||||
@@ -182,7 +182,7 @@ def parse_commands(data):
|
|||||||
logger('info', 'sent statistics')
|
logger('info', 'sent statistics')
|
||||||
elif 'ping' in data:
|
elif 'ping' in data:
|
||||||
if ratelimit_exceeded(): return False
|
if ratelimit_exceeded(): return False
|
||||||
if (0 == (int(time.time()) & 3)): # 1:4
|
if (0 == random.randint(0, 3)): # 1:4
|
||||||
chat_write(reply_user + ''': peng (You're dead now.)''')
|
chat_write(reply_user + ''': peng (You're dead now.)''')
|
||||||
logger('info', 'sent pong (variant)')
|
logger('info', 'sent pong (variant)')
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user