summaryrefslogtreecommitdiff
path: root/megahal_bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'megahal_bot.py')
-rw-r--r--megahal_bot.py68
1 files changed, 26 insertions, 42 deletions
diff --git a/megahal_bot.py b/megahal_bot.py
index 0db602a..adc6429 100644
--- a/megahal_bot.py
+++ b/megahal_bot.py
@@ -44,7 +44,7 @@ class MegahalBot(OmegleChat):
self.disconnect()
else:
self.logger.info("Idle count %s/8" % self.idlecount)
- self.respond("are you there?") #restart the conv.
+ self.respond("hey?") #restart the conv.
def on_message(self,message):
print self.c("%s%s [MSG] %s: %s" %(
@@ -57,7 +57,10 @@ class MegahalBot(OmegleChat):
try:
self.typing()
except Exception,e:
- print e
+ try:
+ self.disconnect()
+ except:
+ self.disconnect_event.set()
return
time.sleep(random.randint(1,3))
self.respond(message,prepend="\033[1A\033[2K\033[%sD"%(len(typestr))) #move up 1; delete line; move left %s
@@ -75,53 +78,34 @@ class MegahalBot(OmegleChat):
if __name__ == "__main__":
mh_python.initbrain()
- conn = pyPgSQL.PgSQL.connect("")
+ conn = pyPgSQL.PgSQL.connect(database="omegle")
cur = conn.cursor()
+ #normal
# sql = """SELECT message FROM omegle_messages
-#WHERE LENGTH(message) < 15
-# OR CAST(RANDOM()*10 AS integer) < 6;""" #reduziert kurze sachen
-# sql = """SELECT message FROM omegle_messages"""
+ # WHERE LENGTH(message) < 35
+ # AND NOT ( message ILIKE '%www.%'
+ # OR message ILIKE '%http%'
+ # OR message ILIKE '%@%.%')
+ # ;
+# """
- #hmm
+ #Offensive
sql = """SELECT message FROM omegle_messages
- WHERE LENGTH(message) < 35
- AND NOT ( message ILIKE '%www.%'
- OR message ILIKE '%http%'
- OR message ILIKE '%@%.%')
+ WHERE ( message ILIKE '%sex%'
+ OR message ILIKE '%boob%'
+ OR message ILIKE '%horny %'
+ OR message ILIKE '%pussy %'
+ OR message ILIKE '%ass %'
+ OR message ILIKE '%naked%'
+ OR message ILIKE '%fuck%'
+ OR LENGTH(message) < 7 AND CAST(RANDOM()*10 as integer)=1)
+ AND LENGTH(message) < 35
+ AND NOT ( message ILIKE '%www.%'
+ OR message ILIKE '%http%'
+ OR message ILIKE '%@%.%')
;
"""
-# #Offensive
-# sql = """SELECT message FROM omegle_messages
-# WHERE ( message ILIKE '%sex%'
-# OR message ILIKE '%boob%'
-# OR message ILIKE '%horny %'
-# OR message ILIKE '%pussy %'
-# OR message ILIKE '%ass %'
-# OR message ILIKE '%naked%'
-# OR message ILIKE '%fuck%'
-# OR LENGTH(message) < 7 AND CAST(RANDOM()*10 as integer)=1)
-# AND LENGTH(message) < 35
-# AND NOT ( message ILIKE '%www.%'
-# OR message ILIKE '%http%'
-# OR message ILIKE '%@%.%')
-# ;
-# """
-
-# sql = """
-#SELECT message
-# FROM omegle_messages
-# WHERE from_ident IN (
-# SELECT from_ident
-# FROM omegle_messages
-# WHERE ( message ILIKE '%sex%'
-# OR message ILIKE '%cam%'
-# OR message ILIKE '%boobs%'
-# OR message ILIKE '%horny%'
-# OR message ILIKE '%pussy%'
-# OR message ILIKE '%ass%')
-# AND NOT ( message ILIKE '%www%'
-# OR message ILIKE '%http%'));"""
cur.execute(sql)
messages = cur.fetchall()
c=0