コード例 #1
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_hug( plugin, connection, channel, source_nick, victim ):
	howtos = ["umarmt", "knuddelt", "streichelt", "hätschelt"]
	howto = random.choice( howtos )
	success = True
	if same_nick( source_nick, victim ):
		txt = "sieht, dass %(source_nick)s sich selbst ganz doll lieb hat."
		success = False
	elif not victim:
		txt = "%(howto)s %(source_nick)s"
	elif not is_on_channel( plugin, connection, channel, victim ):
		txt = "stellt fest, dass das nich möglich ist, weil %(victim)s nicht hier ist."
		success = False
	else:
		txt = "sieht: %(source_nick)s %(howto)s %(victim)s"
	# no success :)
	if success and random.randint(0,10)>7 and victim:
		fails = [ \
			"%(source_nick)s stolpert beim Versuch %(victim)s zu umarmen. %(source_nick)ss Lippen berühren die Füße ... %(source_nick)s KÜSST förmlich %(victim)ss Füße!",
			"%(source_nick)s schaut zu %(victim)s, öffnet die Arme und läuft... ins Leere. Vielleicht brauchst du eine neue Brille?",
			"%(source_nick)s eilt mit geöffneten Armen zu %(victim)s, stößt sich den Kopf am Kronleuchter *boing* ... und träumt nun süß von %(victim)s.",
			"%(source_nick)s %(howto)s %(victim)s, öffnet die Augen und sieht:  Es ist %(victim)ss Papa!",
			"%(source_nick)s %(howto)s %(victim)s, öffnet die Augen und sieht:  Es ist %(victim)ss Mama!",
			"%(source_nick)s %(howto)s %(victim)s, öffnet die Augen und sieht:  Es ist %(victim)ss Schatz!",
			"%(source_nick)s %(howto)s %(victim)s, doch HALT: Was ist das in meinem Nacken?  %(source_nick)s öffnet die Augen und erkennt:  Es ist ein VAMPIR! *Schock*",
			"%(source_nick)s %(howto)s %(victim)s, doch HALT: Was ist das in meinem Nacken?  %(source_nick)s öffnet die Augen und erkennt:  Es ist ein BORG! *assimiliert werd*",
		]
		txt = "sieht: "+random.choice(fails)
		success = False
	if success:
		if random.randint(0,10)>7:
			txt += " "+random.choice( ["herzlich", "zärtlich", "leidenschaftlich"] )
		txt += "."
	connection.action( channel, txt % locals() )
コード例 #2
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_applause( plugin, connection, channel, source_nick, victim ):
	if is_on_channel( plugin, connection, channel, victim ):
		txt = "sieht: %(source_nick)s applaudiert %(victim)s."
	else:
		txt = "sieht: Das Publikum flippt förmlich aus."
	if random.randint(0,10)>6:
		txt += "  Stehende Ovationen! :D"
	connection.action( channel, txt % locals() )
コード例 #3
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_amok( plugin, connection, channel, source_nick, victim ):
	if victim:
		if is_on_channel( plugin, connection, channel, victim ):
			txt = "kettet %(victim)s wie verlangt nongalant an die Heizungsrohe."
		else:
			txt = "sieht: %(source_nick)s kommt beim anketten etwas durcheinander und kettet sich selbst an die Heizung..."
	else:
		txt = "kettet %(source_nick)s an die Heizung."
	connection.action( channel, txt % locals() )
コード例 #4
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_hartei( plugin, connection, channel, source_nick, victim ):
	global HARTEI_LINES
	if not HARTEI_LINES:
		HARTEI_LINES = load_lines_from_file( "harteier.txt" )
	if victim:
		if same_nick( victim, connection.get_nickname() ) \
				and random.randint(0,10)>4:
			txt = "grinst blöd und hält dich fürn glatten"
		elif is_on_channel( plugin, connection, channel, victim ):
			txt = "sieht: %(source_nick)s nennt %(victim)s nen"
		else:
			txt = "sieht: %(source_nick)s hats richtig derbe versemmlt, ist wohl ein"
	else:
		txt = "betitelt %(source_nick)s als"
	synonym = random.choice( HARTEI_LINES )
	txt = txt % locals()+" "+synonym
	connection.action( channel, txt )
コード例 #5
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_blush( plugin, connection, channel, source_nick, victim ):
	what = [ \
		"%(source_nick)s errötet.",
		"%(source_nick)s guckt verschämt.",
		"%(source_nick)s wird rot wie ne Tomate.",
		"%(source_nick)s ist total süss, wenn verschämt!",
		"%(source_nick)s wird rot. Ein sehr kräftiges bis kaminrotes Rot-Rot.",
	]
	if same_nick( victim, connection.get_nickname() ):
		txt = random.choice( what )
		source_nick = ""
	elif victim and not same_nick( victim, source_nick ) \
			and is_on_channel( plugin, connection, channel, victim ):
		txt = "sieht: %(source_nick)s bringt %(victim)s zum erröten."
	else:
		txt = "sieht: "+random.choice( what )
	connection.action( channel, txt % locals() )
コード例 #6
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_weichei( plugin, connection, channel, source_nick, victim ):
	global WEICHEI_LINES
	if not WEICHEI_LINES:
		WEICHEI_LINES = load_lines_from_file( "weicheier.txt" )
	if victim:
		if same_nick( victim, connection.get_nickname() ) \
				and random.randint(0,10)>4:
			txt = "lächelt mild und hält dich fürn"
		elif is_on_channel( plugin, connection, channel, victim ):
			txt = "sieht: %(source_nick)s nennt %(victim)s nen"
		else:
			txt = "sieht: %(source_nick)s hats vergurkt, ist wohl ein"
	else:
		txt = "nennt %(source_nick)s nen"
	synonym = random.choice( WEICHEI_LINES )
	txt = txt % locals()+" "+synonym
	connection.action( channel, txt )
コード例 #7
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_klo( plugin, connection, channel, source_nick, victim ):
	global KLO_LINES
	if not KLO_LINES:
		KLO_LINES = load_lines_from_file( "klo.txt" )
	if victim and victim!=source_nick:
		if same_nick( victim, connection.get_nickname() ):
			txt = "sagt: Ich muss nicht auf's Klo, aber wenn du gehst:"
		elif is_on_channel( plugin, connection, channel, victim ):
			txt = "sieht: %(source_nick)s ruft %(victim)s hinterher:"
		else:
			txt = "fragt sich woher %(source_nick)s weiß, dass %(victim)s auf dem Klo ist."
			connection.action( channel, txt % locals() )
			return
	else:
		txt = "ruft %(source_nick)s hinterher:"
	txt += " "+random.choice( KLO_LINES )
	connection.action( channel, txt % locals() )		
コード例 #8
0
ファイル: fun.py プロジェクト: syslock/sozphobine
def fun_assimilate( plugin, connection, channel, source_nick, victim ):
	if random.randint(0,10)>7:
		connection.privmsg( channel, "Resistance wasn't futile!" )
	else:
		if victim:
			if same_nick( victim, source_nick ):
				txt = "sees: %(source_nick)s, you can't assimilate yourself.  Think about it!"
			if same_nick( victim, connection.get_nickname() ):
				txt = "gets assimilated by %(source_nick)s.  Watch out!"
			elif is_on_channel( plugin, connection, channel, victim ):
				txt = "sees: %(source_nick)s assimilates %(victim)s.  Resistance is futile!"
				if random.randint(0,10)>7:
					txt += "  YES, another cube filled!"
			else:
				txt = "sees: %(source_nick)s tries to assimilate %(victim)s ... not found.  Check your bionic implants."
		else:
			txt ="assimilates %(source_nick)s."
		connection.action( channel, txt % locals() )
コード例 #9
0
ファイル: seen.py プロジェクト: syslock/sozphobine
def seen_seen( plugin, connection, channel, source_nick, nick ):
	if not nick:
		connection.action( channel, "==>  !seen <nick>  |  !setmsg <deine-nachricht>  |  !getmsg <nick>" )
	elif same_nick( source_nick, nick ):
		connection.action( channel, "glaubt, dass %(source_nick)s an Identitätsstörungen leidet und macht sich unauffällig eine Notiz." % locals() )
	elif is_on_channel( plugin, connection, channel, nick ):
		connection.action( channel, "reicht %(source_nick)s eine Brille und zeigt auf die Besucherliste. %(nick)s ist doch da!" % locals() )
	elif random.randint(1,10)==1:
		connection.action( channel, "findet, dass es in Mecklenburg-Vorpommern schöne Seen gibt, weiß aber nicht was %(nick)s davon hält." % locals() )
	else:
		con = get_connection()
		c = con.cursor()
		# Das Statement generiert durch die Subselect-Konstruktion mit max(id)
		# nur den neuesten Eintrag der auf einen Suchausdruck passt:
		c.execute( """select id, time, nick, eventtype, msg
			from seen where id=(
				select max(id) from seen 
				where nick like ? and channel=? and server=?)""",
			(nick.strip().lower().replace('*','%'),channel,connection.server) )
		rows = c.fetchall()
		if rows:
			_id, _time, _nick, _eventtype, _msg = rows[0]
			_time = time.strftime( '%d.%m.%Y %H:%M:%S',time.localtime( _time ) )
			txt = "hat %(_nick)s zuletzt am %(_time)s gesehen, als sie oder er"
			if _eventtype=="join":
				txt += " den Raum betrat"
			elif _eventtype=="part":
				txt += " den Raum verließ"
			elif _eventtype=="nick":
				txt += " den Namen änderte"
			elif _eventtype=="namreply":
				txt += " hier herumstromerte"
			elif _eventtype=="quit":
				txt += " die Verbindung verlor"
			if _msg:
				txt += " (%(_msg)s)"
			txt += "."
			connection.action( channel, txt % locals() )
		else:
			txt = "ich kann mich nicht erinnern, dass %s jemals hier gewesen wäre."
			connection.privmsg( channel, txt % nick )
		c.execute("""DELETE FROM "seen" WHERE "time"<?;""", (time.time() - (3600 * 24 * 30 * 6),))
		con.commit()
		c.close()