Mess and Lart are back
This commit is contained in:
61
Lart/__init__.py
Normal file
61
Lart/__init__.py
Normal file
@ -0,0 +1,61 @@
|
||||
###
|
||||
# Copyright (c) 2005, Daniel DiPaolo
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the author of this software nor the name of
|
||||
# contributors to this software may be used to endorse or promote products
|
||||
# derived from this software without specific prior written consent.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###
|
||||
|
||||
"""
|
||||
This plugin keeps a database of larts, and larts with it.
|
||||
"""
|
||||
|
||||
import supybot
|
||||
import supybot.world as world
|
||||
|
||||
# Use this for the version of this plugin. You may wish to put a CVS keyword
|
||||
# in here if you're keeping the plugin in CVS or some similar system.
|
||||
__version__ = "%%VERSION%%"
|
||||
|
||||
# XXX Replace this with an appropriate author or supybot.Author instance.
|
||||
__author__ = supybot.authors.strike
|
||||
|
||||
# This is a dictionary mapping supybot.Author instances to lists of
|
||||
# contributions.
|
||||
__contributors__ = {}
|
||||
|
||||
import config
|
||||
import plugin
|
||||
reload(plugin) # In case we're being reloaded.
|
||||
# Add more reloads here if you add third-party modules and want them to be
|
||||
# reloaded when this plugin is reloaded. Don't forget to import them as well!
|
||||
|
||||
if world.testing:
|
||||
import test
|
||||
|
||||
Class = plugin.Class
|
||||
configure = config.configure
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
54
Lart/config.py
Normal file
54
Lart/config.py
Normal file
@ -0,0 +1,54 @@
|
||||
###
|
||||
# Copyright (c) 2005, Daniel DiPaolo
|
||||
# 2006, Dennis Kaarsemaker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the author of this software nor the name of
|
||||
# contributors to this software may be used to endorse or promote products
|
||||
# derived from this software without specific prior written consent.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
# a bool that specifies whether the user identified himself as an advanced
|
||||
# user or not. You should effect your configuration by manipulating the
|
||||
# registry as appropriate.
|
||||
from supybot.questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Lart', True)
|
||||
|
||||
|
||||
Lart = conf.registerPlugin('Lart')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(Lart, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
conf.registerChannelValue(Lart, 'showIds',
|
||||
registry.Boolean(False, """Determines whether the bot will show the ids of
|
||||
a lart when the lart is given."""))
|
||||
conf.registerChannelValue(Lart, 'enabled',
|
||||
registry.Boolean(False, """Mesa want lart!"""))
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
101
Lart/plugin.py
Normal file
101
Lart/plugin.py
Normal file
@ -0,0 +1,101 @@
|
||||
###
|
||||
# Copyright (c) 2005, Daniel DiPaolo
|
||||
# (c) 2006, Dennis Kaarsemaker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the author of this software nor the name of
|
||||
# contributors to this software may be used to endorse or promote products
|
||||
# derived from this software without specific prior written consent.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###
|
||||
|
||||
import re
|
||||
|
||||
from supybot.commands import *
|
||||
import supybot.plugins as plugins
|
||||
import supybot.ircutils as ircutils
|
||||
import random
|
||||
|
||||
class Lart(plugins.ChannelIdDatabasePlugin):
|
||||
_meRe = re.compile(r'\bme\b', re.I)
|
||||
_myRe = re.compile(r'\bmy\b', re.I)
|
||||
def _replaceFirstPerson(self, s, nick):
|
||||
s = self._meRe.sub(nick, s)
|
||||
s = self._myRe.sub('%s\'s' % nick, s)
|
||||
return s
|
||||
|
||||
def addValidator(self, irc, text):
|
||||
if '$who' not in text:
|
||||
irc.error('Larts must contain $who.', Raise=True)
|
||||
|
||||
def lart(self, irc, msg, args, channel, id, text):
|
||||
"""[<channel>] [<id>] <who|what> [for <reason>]
|
||||
|
||||
Uses the Luser Attitude Readjustment Tool on <who|what> (for <reason>,
|
||||
if given). If <id> is given, uses that specific lart. <channel> is
|
||||
only necessary if the message isn't sent in the channel itself.
|
||||
"""
|
||||
if not self.registryValue('enabled', msg.args[0]):
|
||||
return
|
||||
if ' for ' in text:
|
||||
(target, reason) = map(str.strip, text.split(' for ', 1))
|
||||
else:
|
||||
(target, reason) = (text, '')
|
||||
print target
|
||||
if id is not None:
|
||||
try:
|
||||
lart = self.db.get(channel, id)
|
||||
except KeyError:
|
||||
irc.error(format('There is no lart with id #%i.', id))
|
||||
return
|
||||
else:
|
||||
lart = self.db.random(channel)
|
||||
if not lart:
|
||||
irc.error(format('There are no larts in my database '
|
||||
'for %s.', channel))
|
||||
return
|
||||
text = self._replaceFirstPerson(lart.text, msg.nick)
|
||||
if ircutils.strEqual(target, irc.nick) or \
|
||||
'ubotu' in ircutils.stripFormatting(target).lower() or \
|
||||
'seveas' in ircutils.stripFormatting(target).lower() or \
|
||||
((not msg.prefix.endswith('seveas')) and random.uniform(0,100) < 25):
|
||||
target = msg.nick
|
||||
reason = ''
|
||||
else:
|
||||
target = self._replaceFirstPerson(target, msg.nick)
|
||||
reason = self._replaceFirstPerson(reason, msg.nick)
|
||||
if target.endswith('.'):
|
||||
target = target.rstrip('.')
|
||||
text = text.replace('$who', target)
|
||||
text = text.replace('$chan', msg.args[0])
|
||||
if reason:
|
||||
text += ' for ' + reason
|
||||
if self.registryValue('showIds', channel):
|
||||
text += format(' (#%i)', lart.id)
|
||||
irc.reply(text, action=True)
|
||||
lart = wrap(lart, ['channeldb', optional('id'), 'text'])
|
||||
pity = lart
|
||||
slander = lart
|
||||
|
||||
Class = Lart
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
41
Lart/test.py
Normal file
41
Lart/test.py
Normal file
@ -0,0 +1,41 @@
|
||||
###
|
||||
# Copyright (c) 2005, Daniel DiPaolo
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions, and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the author of this software nor the name of
|
||||
# contributors to this software may be used to endorse or promote products
|
||||
# derived from this software without specific prior written consent.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###
|
||||
|
||||
from supybot.test import *
|
||||
|
||||
class LartTestCase(PluginTestCase):
|
||||
plugins = ('Lart',)
|
||||
|
||||
def testAdd(self):
|
||||
self.assertError('lart add foo') # needs $who
|
||||
|
||||
def testPraise(self):
|
||||
self.assertError('lart foo') # no praises!
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
50
Mess/42.txt
Normal file
50
Mess/42.txt
Normal file
@ -0,0 +1,50 @@
|
||||
I demand that I am Vroomfondel
|
||||
Time is an illusion, lunchtime doubly so
|
||||
Oh no, not again!
|
||||
Beware of the Leopard
|
||||
In, as you say, the mud
|
||||
The mere though hasn't even begun to speculate about the merest possibility of crossing my mind
|
||||
Did I do anything wrong today or has the world always been like this and I've been too wrapped up in myself to notice
|
||||
This must be Thursday, I never could get the hang of Thursdays
|
||||
Drink up, the world's about to end
|
||||
That is really amazing. That really is truly amazing. That is so amazingly amazing I think I'd like to steal it
|
||||
If I asked you where the hell we were, eould I regret it?
|
||||
Ah, this is obviously some strange usage of the word safe that I wasn't previously aware of
|
||||
Here is what to do if you want to get a lift from a Vogon: forget it
|
||||
The best way to get a drink out of a Vogon is to stick your finger down his throat
|
||||
Don't panic!
|
||||
This is your captain speaking, so stop whatever you're doing and pay attention
|
||||
If you're very lucky, I might read you some of my poetry first
|
||||
What's so unpleasant about being drunk?
|
||||
Oh dear, says god, I hadn't thought of that. And prompty vanishes in a puff of logic
|
||||
Either die in the vacuum of space, or tell me how good you thought my poem was
|
||||
Resistance is useless!
|
||||
Take the prisoners to number tree airlock and throw them out
|
||||
Da da da dum!
|
||||
Space is big. Really big. You won't believe how vastly hugely mind-boggingly big it is
|
||||
Bright idea of mine, to find a passing spaceship and get rescued by it
|
||||
Don't knock it, it worked
|
||||
Two to the power of one hundred thousand to one against and falling
|
||||
My legs are drifting off into the sunset
|
||||
The point is that I am now a perfectly safe penguin
|
||||
We have normality, I repeat, we have normality. Anything you still can't cope with is therefore your own problem
|
||||
Okay, so ten out of ten for style, but minus several millions for good thinking, yeah?
|
||||
I think you ought to know, I'm feeling very depressed
|
||||
Life, don't talk to me about life
|
||||
Please do not press this button again
|
||||
To everyone else out there, the secret is to bang the rocks together guys
|
||||
If there's anything more important than my ego around, I want it caught and shot now
|
||||
Did you realize that most people's lives are governed by telephone numbers?
|
||||
Hey doll, is this guy boring you? Why don't you talk to me instead? I'm from a different planet
|
||||
I'll sue the council for every penny it's got!
|
||||
Please enjoy your walk through this door
|
||||
Glad to be of service
|
||||
In these enlightened days, of course, no one believes a word of it
|
||||
I can even work out your personality problems to ten decimal places if it will help
|
||||
Is there any tea on this spaceship?
|
||||
Hey, this is terrific! Someone down there is trying to kill us
|
||||
so, let's call it my stomach
|
||||
But what are you supposed to do with a manically depressed robot?
|
||||
My white mice have escaped!
|
||||
I can see this relationship is something we're all going to have to work at
|
||||
Meanwhile, the poor Babel fish, by effectively removing all barriers to communication between different races and cultures, has caused more and bloodier wars than anything else in the history of creation.
|
2
Mess/README.txt
Normal file
2
Mess/README.txt
Normal file
@ -0,0 +1,2 @@
|
||||
This is a random mess plugin that hardcodes many paths at the top of the plugin
|
||||
code. You'll generally want to be careful with it or simply not use it.
|
34
Mess/__init__.py
Normal file
34
Mess/__init__.py
Normal file
@ -0,0 +1,34 @@
|
||||
###
|
||||
# Copyright (c) 2006-2007 Dennis Kaarsemaker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
###
|
||||
"""
|
||||
Random mess plugin
|
||||
"""
|
||||
|
||||
import supybot
|
||||
import supybot.world as world
|
||||
|
||||
__version__ = "0.5"
|
||||
__author__ = supybot.Author('Dennis Kaarsemaker','Seveas','dennis@kaarsemaker.net')
|
||||
__contributors__ = {}
|
||||
__url__ = 'https://bots.ubuntulinux.nl'
|
||||
|
||||
import config
|
||||
reload(config)
|
||||
import plugin
|
||||
reload(plugin)
|
||||
|
||||
if world.testing:
|
||||
import test
|
||||
Class = plugin.Class
|
||||
configure = config.configure
|
26
Mess/ball.txt
Normal file
26
Mess/ball.txt
Normal file
@ -0,0 +1,26 @@
|
||||
Yes
|
||||
No
|
||||
Most likely
|
||||
Definitely not
|
||||
Ask again later
|
||||
Maybe
|
||||
Could be
|
||||
Only when it rains
|
||||
Let's hope not
|
||||
I don't think so
|
||||
Are you kidding me?
|
||||
Of course
|
||||
When pigs fly
|
||||
No way
|
||||
Definitely
|
||||
Of course
|
||||
Hell no!
|
||||
Hell yeah!
|
||||
Keep on dreaming
|
||||
The stars say so
|
||||
I have no doubts about it
|
||||
Forty-Two!
|
||||
Your guess is as good as mine
|
||||
Maybe
|
||||
That seems to be right
|
||||
That seems to be wrong
|
453
Mess/bofh.txt
Normal file
453
Mess/bofh.txt
Normal file
@ -0,0 +1,453 @@
|
||||
clock speed
|
||||
solar flares
|
||||
electromagnetic radiation from satellite debris
|
||||
static from nylon underwear
|
||||
static from plastic slide rules
|
||||
global warming
|
||||
poor power conditioning
|
||||
static buildup
|
||||
doppler effect
|
||||
hardware stress fractures
|
||||
magnetic interference from money/credit cards
|
||||
dry joints on cable plug
|
||||
we're waiting for the phone company to fix that line
|
||||
sounds like a Windows problem, try calling Microsoft support
|
||||
temporary routing anomaly
|
||||
somebody was calculating pi on the server
|
||||
fat electrons in the lines
|
||||
excess surge protection
|
||||
floating point processor overflow
|
||||
divide-by-zero error
|
||||
POSIX compliance problem
|
||||
monitor resolution too high
|
||||
improperly oriented keyboard
|
||||
network packets travelling uphill (use a carrier pigeon)
|
||||
Decreasing electron flux
|
||||
first Saturday after first full moon in Winter
|
||||
radiosity depletion
|
||||
CPU radiator broken
|
||||
It works the way the Wang did, what's the problem
|
||||
positron router malfunction
|
||||
cellular telephone interference
|
||||
tectonic stress
|
||||
piezo-electric interference
|
||||
(l)user error
|
||||
working as designed
|
||||
dynamic software linking table corrupted
|
||||
heavy gravity fluctuation, move computer to floor rapidly
|
||||
secretary plugged hairdryer into UPS
|
||||
terrorist activities
|
||||
not enough memory, go get system upgrade
|
||||
interrupt configuration error
|
||||
spaghetti cable cause packet failure
|
||||
boss forgot system password
|
||||
bank holiday - system operating credits not recharged
|
||||
virus attack, luser responsible
|
||||
waste water tank overflowed onto computer
|
||||
Complete Transient Lockout
|
||||
bad ether in the cables
|
||||
Bogon emissions
|
||||
Change in Earth's rotational speed
|
||||
Cosmic ray particles crashed through the hard disk platter
|
||||
Smell from unhygienic janitorial staff wrecked the tape heads
|
||||
Little hamster in running wheel had coronary; waiting for replacement to be Fedexed from Wyoming
|
||||
Evil dogs hypnotised the night shift
|
||||
Plumber mistook routing panel for decorative wall fixture
|
||||
Electricians made popcorn in the power supply
|
||||
Groundskeepers stole the root password
|
||||
high pressure system failure
|
||||
failed trials, system needs redesigned
|
||||
system has been recalled
|
||||
not approved by the FCC
|
||||
need to wrap system in aluminum foil to fix problem
|
||||
not properly grounded, please bury computer
|
||||
CPU needs recalibration
|
||||
system needs to be rebooted
|
||||
bit bucket overflow
|
||||
descramble code needed from software company
|
||||
only available on a need to know basis
|
||||
knot in cables caused data stream to become twisted and kinked
|
||||
nesting roaches shorted out the ether cable
|
||||
The file system is full of it
|
||||
Satan did it
|
||||
Daemons did it
|
||||
You're out of memory
|
||||
There isn't any problem
|
||||
Unoptimized hard drive
|
||||
Typo in the code
|
||||
Yes, yes, it's called a design limitation
|
||||
Look, buddy: Windows 3.1 IS A General Protection Fault.
|
||||
That's a great computer you have there; have you considered how it would work as a BSD machine?
|
||||
Please excuse me, I have to circuit an AC line through my head to get this database working.
|
||||
Yeah, yo mama dresses you funny and you need a mouse to delete files.
|
||||
Support staff hung over, send aspirin and come back LATER.
|
||||
Someone is standing on the ethernet cable, causing a kink in the cable
|
||||
Windows 95 undocumented "feature"
|
||||
Runt packets
|
||||
Password is too complex to decrypt
|
||||
Boss' kid fucked up the machine
|
||||
Electromagnetic energy loss
|
||||
Budget cuts
|
||||
Mouse chewed through power cable
|
||||
Stale file handle (next time use Tupperware(tm)!)
|
||||
Feature not yet implemented
|
||||
Internet outage
|
||||
Pentium FDIV bug
|
||||
Vendor no longer supports the product
|
||||
Small animal kamikaze attack on power supplies
|
||||
The vendor put the bug there.
|
||||
SIMM crosstalk.
|
||||
IRQ dropout
|
||||
Collapsed Backbone
|
||||
Power company testing new voltage spike (creation) equipment
|
||||
operators on strike due to broken coffee machine
|
||||
backup tape overwritten with copy of system manager's favorite CD
|
||||
UPS interrupted the server's power
|
||||
The electrician didn't know what the yellow cable was so he yanked the ethernet out.
|
||||
The keyboard isn't plugged in
|
||||
The air conditioning water supply pipe ruptured over the machine room
|
||||
The electricity substation in the car park blew up.
|
||||
The rolling stones concert down the road caused a brown out
|
||||
The salesman drove over the CPU board.
|
||||
The monitor is plugged into the serial port
|
||||
Root nameservers are out of sync
|
||||
electro-magnetic pulses from French above ground nuke testing.
|
||||
your keyboard's space bar is generating spurious keycodes.
|
||||
the real ttys became pseudo ttys and vice-versa.
|
||||
the printer thinks its a router.
|
||||
the router thinks its a printer.
|
||||
evil hackers from Serbia.
|
||||
we just switched to FDDI.
|
||||
halon system went off and killed the operators.
|
||||
because Bill Gates is a Jehovah's witness and so nothing can work on St. Swithin's day.
|
||||
user to computer ratio too high.
|
||||
user to computer ration too low.
|
||||
we just switched to Sprint.
|
||||
it has Intel Inside
|
||||
Sticky bits on disk.
|
||||
Power Company having EMP problems with their reactor
|
||||
The ring needs another token
|
||||
new management
|
||||
telnet: Unable to connect to remote host: Connection refused
|
||||
SCSI Chain overterminated
|
||||
It's not plugged in.
|
||||
because of network lag due to too many people playing deathmatch
|
||||
You put the disk in upside down.
|
||||
Daemons loose in system.
|
||||
User was distributing pornography on server; system seized by FBI.
|
||||
BNC (brain not connected)
|
||||
UBNC (user brain not connected)
|
||||
LBNC (luser brain not connected)
|
||||
disks spinning backwards - toggle the hemisphere jumper.
|
||||
new guy cross-connected phone lines with ac power bus.
|
||||
had to use hammer to free stuck disk drive heads.
|
||||
Too few computrons available.
|
||||
Flat tire on station wagon with tapes.
|
||||
Communications satellite used by the military for star wars.
|
||||
Party-bug in the Aloha protocol.
|
||||
Insert coin for new game
|
||||
Dew on the telephone lines.
|
||||
Arcserve crashed the server again.
|
||||
Someone needed the powerstrip, so they pulled the switch plug.
|
||||
My pony-tail hit the on/off switch on the power strip.
|
||||
Big to little endian conversion error
|
||||
You can tune a file system, but you can't tune a fish
|
||||
Dumb terminal
|
||||
Zombie processes haunting the computer
|
||||
Incorrect time synchronization
|
||||
Defunct processes
|
||||
Stubborn processes
|
||||
non-redundant fan failure
|
||||
monitor VLF leakage
|
||||
bugs in the RAID
|
||||
no "any" key on keyboard
|
||||
root rot
|
||||
Backbone Scoliosis
|
||||
/pub/lunch
|
||||
excessive collisions & not enough packet ambulances
|
||||
le0: no carrier: transceiver cable problem?
|
||||
broadcast packets on wrong frequency
|
||||
popper unable to process jumbo kernel
|
||||
NOTICE: alloc: /dev/null: filesystem full
|
||||
pseudo-user on a pseudo-terminal
|
||||
Recursive traversal of loopback mount points
|
||||
Backbone adjustment
|
||||
OS swapped to disk
|
||||
vapors from evaporating sticky-note adhesives
|
||||
sticktion
|
||||
short leg on process table
|
||||
multicasts on broken packets
|
||||
ether leak
|
||||
Atilla the Hub
|
||||
endothermal recalibration
|
||||
filesystem not big enough for Jumbo Kernel Patch
|
||||
loop found in loop in redundant loopback
|
||||
system consumed all the paper for paging
|
||||
permission denied
|
||||
Reformatting Page. Wait...
|
||||
Either the disk or the processor is on fire.
|
||||
SCSI's too wide.
|
||||
Proprietary Information.
|
||||
Just type 'mv * /dev/null'.
|
||||
runaway cat on system.
|
||||
Did you pay the new Support Fee?
|
||||
We only support a 1200 bps connection.
|
||||
We only support a 28000 bps connection.
|
||||
Me no internet, only janitor, me just wax floors.
|
||||
I'm sorry a pentium won't do, you need an SGI to connect with us.
|
||||
Post-it Note Sludge leaked into the monitor.
|
||||
the curls in your keyboard cord are losing electricity.
|
||||
The monitor needs another box of pixels.
|
||||
RPC_PMAP_FAILURE
|
||||
kernel panic: write-only-memory (/dev/wom0) capacity exceeded.
|
||||
Write-only-memory subsystem too slow for this machine. Contact your local dealer.
|
||||
Just pick up the phone and give modem connect sounds. "Well you said we should get more lines so we don't have voice lines."
|
||||
Quantum dynamics are affecting the transistors
|
||||
Police are examining all internet packets in the search for a narco-net-trafficker
|
||||
We are currently trying a new concept of using a live mouse. Unfortunately, one has yet to survive being hooked up to the computer.....please bear with us.
|
||||
Your mail is being routed through Germany ... and they're censoring us.
|
||||
Only people with names beginning with 'A' are getting mail this week (a la Microsoft)
|
||||
We didn't pay the Internet bill and it's been cut off.
|
||||
Lightning strikes.
|
||||
Of course it doesn't work. We've performed a software upgrade.
|
||||
Change your language to Finnish.
|
||||
Fluorescent lights are generating negative ions. If turning them off doesn't work, take them out and put tin foil on the ends.
|
||||
High nuclear activity in your area.
|
||||
What office are you in? Oh, that one. Did you know that your building was built over the universities first nuclear research site? And wow, aren't you the lucky one, your office is right over where the core is buried!
|
||||
The MGs ran out of gas.
|
||||
The UPS doesn't have a battery backup.
|
||||
Recursivity. Call back if it happens again.
|
||||
Someone thought The Big Red Button was a light switch.
|
||||
The mainframe needs to rest. It's getting old, you know.
|
||||
I'm not sure. Try calling the Internet's head office -- it's in the book.
|
||||
The lines are all busy (busied out, that is -- why let them in to begin with?).
|
||||
Jan 9 16:41:27 huber su: 'su root' succeeded for .... on /dev/pts/1
|
||||
It's those computer people in London. They keep stuffing things up.
|
||||
A star wars satellite accidently blew up the WAN.
|
||||
Fatal error right in front of screen
|
||||
That function is not currently supported, but Bill Gates assures us it will be featured in the next upgrade.
|
||||
wrong polarity of neutron flow
|
||||
Lusers learning curve appears to be fractal
|
||||
We had to turn off that service to comply with the CDA Bill.
|
||||
Ionization from the air-conditioning
|
||||
TCP/IP UDP alarm threshold is set too low.
|
||||
Someone is broadcasting pygmy packets and the router doesn't know how to deal with them.
|
||||
The new frame relay network hasn't bedded down the software loop transmitter yet.
|
||||
Fanout dropping voltage too much, try cutting some of those little traces
|
||||
Plate voltage too low on demodulator tube
|
||||
You did wha... oh _dear_....
|
||||
CPU needs bearings repacked
|
||||
Too many little pins on CPU confusing it, bend back and forth until 10-20% are neatly removed. Do _not_ leave metal bits visible!
|
||||
_Rosin_ core solder? But...
|
||||
Software uses US measurements, but the OS is in metric...
|
||||
The computer fleetly, mouse and all.
|
||||
Your cat tried to eat the mouse.
|
||||
The Borg tried to assimilate your system. Resistance is futile.
|
||||
It must have been the lightning storm we had yesterday
|
||||
Due to Federal Budget problems we have been forced to cut back on the number of users able to access the system at one time
|
||||
Too much radiation coming from the soil.
|
||||
Unfortunately we have run out of bits/bytes/whatever. Don't worry, the next supply will be coming next week.
|
||||
Program load too heavy for processor to lift.
|
||||
Processes running slowly due to weak power supply
|
||||
Our ISP is having frame relay problems
|
||||
We've run out of licenses
|
||||
Interference from lunar radiation
|
||||
Standing room only on the bus.
|
||||
You need to install an RTFM interface.
|
||||
That would be because the software doesn't work.
|
||||
That's easy to fix, but I can't be bothered.
|
||||
Someone's tie is caught in the printer, and if anything else gets printed, he'll be in it too.
|
||||
We're upgrading /dev/null
|
||||
The Usenet news is out of date
|
||||
Our POP server was kidnapped by a weasel.
|
||||
It's stuck in the Web.
|
||||
Your modem doesn't speak English.
|
||||
The mouse escaped.
|
||||
All of the packets are empty.
|
||||
The UPS is on strike.
|
||||
Neutrino overload on the nameserver
|
||||
Melting hard drives
|
||||
Someone has messed up the kernel pointers
|
||||
The kernel license has expired
|
||||
Netscape has crashed
|
||||
The cord jumped over and hit the power switch.
|
||||
It was OK before you touched it.
|
||||
Bit rot
|
||||
U.S. Postal Service
|
||||
Your Flux Capacitor has gone bad.
|
||||
The Dilithium Crystals need to be rotated.
|
||||
The static electricity routing is acting up...
|
||||
Traceroute says that there is a routing problem in the backbone. It's not our problem.
|
||||
The co-locator cannot verify the frame-relay gateway to the ISDN server.
|
||||
High altitude condensation from U.S.A.F prototype aircraft has contaminated the primary subnet mask. Turn off your computer for 9 days to avoid damaging it.
|
||||
Lawn mower blade in your fan need sharpening
|
||||
Electrons on a bender
|
||||
Telecommunications is upgrading.
|
||||
Telecommunications is downgrading.
|
||||
Telecommunications is downshifting.
|
||||
Hard drive sleeping. Let it wake up on it's own...
|
||||
Interference between the keyboard and the chair.
|
||||
The CPU has shifted, and become decentralized.
|
||||
Due to the CDA, we no longer have a root account.
|
||||
We ran out of dial tone and we're and waiting for the phone company to deliver another bottle.
|
||||
You must've hit the wrong any key.
|
||||
PCMCIA slave driver
|
||||
The Token fell out of the ring. Call us when you find it.
|
||||
The hardware bus needs a new token.
|
||||
Too many interrupts
|
||||
Not enough interrupts
|
||||
The data on your hard drive is out of balance.
|
||||
Digital Manipulator exceeding velocity parameters
|
||||
appears to be a Slow/Narrow SCSI-0 Interface problem
|
||||
microelectronic Riemannian curved-space fault in write-only file system
|
||||
fractal radiation jamming the backbone
|
||||
routing problems on the neural net
|
||||
IRQ-problems with the Un-Interruptible-Power-Supply
|
||||
CPU-angle has to be adjusted because of vibrations coming from the nearby road
|
||||
emissions from GSM-phones
|
||||
CD-ROM server needs recalibration
|
||||
firewall needs cooling
|
||||
asynchronous inode failure
|
||||
transient bus protocol violation
|
||||
incompatible bit-registration operators
|
||||
your process is not ISO 9000 compliant
|
||||
You need to upgrade your VESA local bus to a MasterCard local bus.
|
||||
The recent proliferation of Nuclear Testing
|
||||
Elves on strike. (Why do they call EMAG Elf Magic)
|
||||
Internet exceeded Luser level, please wait until a luser logs off before attempting to log back on.
|
||||
Your EMAIL is now being delivered by the USPS.
|
||||
Your computer hasn't been returning all the bits it gets from the Internet.
|
||||
You've been infected by the Telescoping Hubble virus.
|
||||
Scheduled global CPU outage
|
||||
Your Pentium has a heating problem - try cooling it with ice cold water.(Do not turn of your computer, you do not want to cool down the Pentium Chip while he isn't working, do you?)
|
||||
Your processor has processed too many instructions. Turn it off immediately, do not type any commands!!
|
||||
Your packets were eaten by the terminator
|
||||
Your processor does not develop enough heat.
|
||||
We need a licensed electrician to replace the light bulbs in the computer room.
|
||||
The POP server is out of Coke
|
||||
Fiber optics caused gas main leak
|
||||
Server depressed, needs Prozac
|
||||
quantum decoherence
|
||||
those damn raccoons!
|
||||
suboptimal routing experience
|
||||
A plumber is needed, the network drain is clogged
|
||||
50% of the manual is in .pdf readme files
|
||||
the AA battery in the wallclock sends magnetic interference
|
||||
the xy axis in the trackball is coordinated with the summer solstice
|
||||
the butane lighter causes the pincushioning
|
||||
old inkjet cartridges emanate barium-based fumes
|
||||
manager in the cable duct
|
||||
Well fix that in the next (upgrade, update, patch release, service pack).
|
||||
HTTPD Error 666 : BOFH was here
|
||||
HTTPD Error 4004 : very old Intel cpu - insufficient processing power
|
||||
The ATM board has run out of 10 pound notes. We are having a whip round to refill it, care to contribute ?
|
||||
Network failure - call NBC
|
||||
Having to manually track the satellite.
|
||||
Your/our computer(s) had suffered a memory leak, and we are waiting for them to be topped up.
|
||||
The rubber band broke
|
||||
We're on Token Ring, and it looks like the token got loose.
|
||||
Stray Alpha Particles from memory packaging caused Hard Memory Error on Server.
|
||||
paradigm shift...without a clutch
|
||||
PEBKAC (Problem Exists Between Keyboard And Chair)
|
||||
The cables are not the same length.
|
||||
Second-system effect.
|
||||
Chewing gum on /dev/sd3c
|
||||
Boredom in the Kernel.
|
||||
the daemons! the daemons! the terrible daemons!
|
||||
I'd love to help you -- it's just that the Boss won't let me near the computer.
|
||||
struck by the Good Times virus
|
||||
YOU HAVE AN I/O ERROR -> Incompetent Operator error
|
||||
Your parity check is overdrawn and you're out of cache.
|
||||
Communist revolutionaries taking over the server room and demanding all the computers in the building or they shoot the sysadmin. Poor misguided fools.
|
||||
Plasma conduit breach
|
||||
Out of cards on drive D:
|
||||
Sand fleas eating the Internet cables
|
||||
parallel processors running perpendicular today
|
||||
ATM cell has no roaming feature turned on, notebooks can't connect
|
||||
Webmasters kidnapped by evil cult.
|
||||
Failure to adjust for daylight savings time.
|
||||
Virus transmitted from computer to sysadmins.
|
||||
Virus due to computers having unsafe sex.
|
||||
Incorrectly configured static routes on the corerouters.
|
||||
Forced to support NT servers; sysadmins quit.
|
||||
Suspicious pointer corrupted virtual machine
|
||||
It's the InterNIC's fault.
|
||||
Root name servers corrupted.
|
||||
Budget cuts forced us to sell all the power cords for the servers.
|
||||
Someone hooked the twisted pair wires into the answering machine.
|
||||
Operators killed by year 2000 bug bite.
|
||||
We've picked COBOL as the language of choice.
|
||||
Operators killed when huge stack of backup tapes fell over.
|
||||
Robotic tape changer mistook operator's tie for a backup tape.
|
||||
Someone was smoking in the computer room and set off the halon systems.
|
||||
Your processor has taken a ride to Heaven's Gate on the UFO behind Hale-Bopp's comet.
|
||||
it's an ID-10-T error
|
||||
Dyslexics retyping hosts file on servers
|
||||
The Internet is being scanned for viruses.
|
||||
Your computer's union contract is set to expire at midnight.
|
||||
Bad user karma.
|
||||
/dev/clue was linked to /dev/null
|
||||
Increased sunspot activity.
|
||||
We already sent around a notice about that.
|
||||
It's union rules. There's nothing we can do about it. Sorry.
|
||||
Interference from the Van Allen Belt.
|
||||
Jupiter is aligned with Mars.
|
||||
Redundant ACLs.
|
||||
Mail server hit by UniSpammer.
|
||||
T-1's congested due to porn traffic to the news server.
|
||||
Data for intranet got routed through the extranet and landed on the internet.
|
||||
We are a 100% Microsoft Shop.
|
||||
We are Microsoft. What you are experiencing is not a problem; it is an undocumented feature.
|
||||
Sales staff sold a product we don't offer.
|
||||
Secretary sent chain letter to all 5000 employees.
|
||||
Sysadmin didn't hear pager go off due to loud music from bar-room speakers.
|
||||
Sysadmin accidentally destroyed pager with a large hammer.
|
||||
Sysadmins unavailable because they are in a meeting talking about why they are unavailable so much.
|
||||
Bad cafeteria food landed all the sysadmins in the hospital.
|
||||
Route flapping at the NAP.
|
||||
Computers under water due to SYN flooding.
|
||||
The vulcan-death-grip ping has been applied.
|
||||
Electrical conduits in machine room are melting.
|
||||
Traffic jam on the Information Superhighway.
|
||||
Radial Telemetry Infiltration
|
||||
Cow-tippers tipped a cow onto the server.
|
||||
tachyon emissions overloading the system
|
||||
Maintenance window broken
|
||||
We're out of slots on the server
|
||||
Computer room being moved. Our systems are down for the weekend.
|
||||
Sysadmins busy fighting SPAM.
|
||||
Repeated reboots of the system failed to solve problem
|
||||
Feature was not beta tested
|
||||
Domain controller not responding
|
||||
Someone else stole your IP address, call the Internet detectives!
|
||||
It's not RFC-822 compliant.
|
||||
operation failed because: there is no message for this error (#1014)
|
||||
stop bit received
|
||||
internet is needed to catch the etherbunny
|
||||
network down, IP packets delivered via UPS
|
||||
Firmware update in the coffee machine
|
||||
Temporal anomaly
|
||||
Mouse has out-of-cheese-error
|
||||
Borg implants are failing
|
||||
Borg nanites have infested the server
|
||||
error: one bad user found in front of screen
|
||||
Please state the nature of the technical emergency
|
||||
Internet shut down due to maintenance
|
||||
Daemon escaped from pentagram
|
||||
crop circles in the corn shell
|
||||
sticky bit has come loose
|
||||
Hot Java has gone cold
|
||||
Cache miss - please take better aim next time
|
||||
Hash table has woodworm
|
||||
Trojan horse ran out of hay
|
||||
Zombie processes detected, machine is haunted.
|
||||
overflow error in /dev/null
|
||||
Browser's cookie is corrupted -- someone's been nibbling on it.
|
||||
Mailer-daemon is busy burning your message in hell.
|
||||
According to Microsoft, it's by design
|
||||
vi needs to be upgraded to vii
|
||||
greenpeace free'd the mallocs
|
||||
Terrorists crashed an airplane into the server room, have to remove /bin/laden. (rm -rf /bin/laden)
|
||||
astropneumatic oscillations in the water-cooling
|
||||
Somebody ran the operating system through a spelling checker.
|
||||
Spider infestation in warm case parts
|
30
Mess/config.py
Normal file
30
Mess/config.py
Normal file
@ -0,0 +1,30 @@
|
||||
###
|
||||
# Copyright (c) 2006-2007 Dennis Kaarsemaker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
###
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
|
||||
def configure(advanced):
|
||||
from supybot.questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Mess', True)
|
||||
|
||||
Mess = conf.registerPlugin('Mess')
|
||||
conf.registerChannelValue(conf.supybot.plugins.Mess, 'enabled',
|
||||
registry.Boolean(False,"""Enable the non-offensive mess that ubugtu can spit out in the
|
||||
channel"""))
|
||||
conf.registerChannelValue(conf.supybot.plugins.Mess, 'offensive',
|
||||
registry.Boolean(False,"""Enable all possibly offensive mess that the bot can spit out in the
|
||||
channel"""))
|
||||
conf.registerChannelValue(conf.supybot.plugins.Mess, 'delay',
|
||||
registry.Integer(10,""" Minimum number of seconds between mess """))
|
50
Mess/ferengi.txt
Normal file
50
Mess/ferengi.txt
Normal file
@ -0,0 +1,50 @@
|
||||
1: Once you have their money, you never give it back.
|
||||
3: Never spend more for an acquisition than you have to.
|
||||
6: Never let family stand in the way of opportunity.
|
||||
7: Always keep your ears open.
|
||||
9: Opportunity plus instinct equals profit.
|
||||
10: Greed is eternal.
|
||||
16: A deal is a deal.
|
||||
17: A contract is a contract is a contract – but only between Ferengi.
|
||||
18: A Ferengi without profit is no Ferengi at all.
|
||||
21: Never place friendship before profit.
|
||||
22: Wise men can hear profit in the wind.
|
||||
23: Nothing is more important than your health. Except for money.
|
||||
31: Never make fun of a Ferengi's mother.
|
||||
33: It never hurts to suck up to the boss.
|
||||
34: War is good for business.
|
||||
35: Peace is good for business.
|
||||
47: Don't trust a man wearing a better suit than your own.
|
||||
48: The bigger the smile, the sharper the knife.
|
||||
57: Good customers are as rare as latinum — treasure them.
|
||||
59: Free advice is seldom cheap.
|
||||
62: The riskier the road, the greater the profit.
|
||||
74: Knowledge equals profit.
|
||||
75: Home is where the heart is but the stars are made of latinum.
|
||||
76: Every once in a while, declare peace. It confuses the hell out of your enemies.
|
||||
94: Females and finances don't mix.
|
||||
95: Expand or die.
|
||||
98: Every man has his price.
|
||||
102: Nature decays, but latinum lasts forever.
|
||||
103: Sleep can interfere with opportunity.
|
||||
109: Dignity and an empty sack is worth the sack.
|
||||
111: Treat people in your debt like family - exploit them.
|
||||
112: Never have sex with the boss' sister.
|
||||
119: Buy, sell, or get out of the way.*
|
||||
125: You can't make a deal if you're dead.
|
||||
139: Wives serve; brothers inherit.
|
||||
141: Only fools pay retail.
|
||||
168: Whisper your way to success.
|
||||
190: Hear all, trust nothing.
|
||||
194: It's always good business to know about new customers before they walk in your door.
|
||||
203: New customers are like razor-toothed gree worms: they can be succulent but sometimes they can bite back.
|
||||
208: Sometimes the only thing more dangerous than a question is an answer.
|
||||
211: Employees are the rungs on the ladder of success - don't hesitate to step on them.
|
||||
214: Never begin a business negotiation on an empty stomach.
|
||||
217: You can't free a fish from water.
|
||||
229: Latinum lasts longer than lust.
|
||||
239: Never be afraid to mis-label a product.
|
||||
242: More is good, all is better.
|
||||
263: Never allow doubt to tarnish your lust for Latinum.
|
||||
285: No good deed ever goes unpunished.
|
||||
: When no rule applies . . . make one up
|
236
Mess/plugin.py
Normal file
236
Mess/plugin.py
Normal file
@ -0,0 +1,236 @@
|
||||
###
|
||||
# Copyright (c) 2006-2007 Dennis Kaarsemaker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
###
|
||||
|
||||
import supybot.utils as utils
|
||||
from supybot.commands import *
|
||||
import supybot.plugins as plugins
|
||||
import supybot.ircutils as ircutils
|
||||
import supybot.callbacks as callbacks
|
||||
import random, re, time, commands, urllib2
|
||||
import supybot.ircmsgs as ircmsgs
|
||||
import supybot.conf as conf
|
||||
import threading
|
||||
|
||||
mess = {
|
||||
't': ('Mr. T facts', 'http://4q.cc/?pid=fact&person=mrt', r'<div id="factbox">\s*(?P<fact>.*?)\s*</div>', False),
|
||||
'chuck': ('Chuck Norris facts', 'http://4q.cc/?pid=fact&person=chuck', r'<div id="factbox">\s*(?P<fact>.*?)\s*</div>', False),
|
||||
'vin': ('Vin Diesel facts', 'http://4q.cc/?pid=fact&person=vin', r'<div id="factbox">\s*(?P<fact>.*?)\s*</div>', False),
|
||||
'bauer': ('Jack Bauer facts', 'http://www.notrly.com/jackbauer/', r'<p class="fact">(?P<fact>.*?)</p>', False),
|
||||
'bruce': ('Bruce Schneier facts', 'http://geekz.co.uk/schneierfacts/', r'p class="fact">(?P<fact>.*?)</p', False),
|
||||
'esr': ('Eric S. Raymond facts', 'http://geekz.co.uk/esrfacts/', r'p class="fact">(?P<fact>.*?)</p', False),
|
||||
'mcgyver': ('McGyver facts', 'http://www.macgyver.co.za/', r'wishtable">\s*(?P<fact>.*?)<div', False),
|
||||
'macgyver': ('McGyver facts', 'http://www.macgyver.co.za/', r'wishtable">\s*(?P<fact>.*?)<div', False),
|
||||
'hamster': ('Hamster quotes', 'http://hamsterrepublic.com/dyn/bobsez', r'<font.*?<b>(?P<fact>.*?)</font>', False),
|
||||
#'yourmom': ('', 'http://pfa.php1h.com', r'<p>(?P<fact>.*?)</p>', True),
|
||||
'bush': ('Bush quotes', 'http://www.dubyaspeak.com/random.phtml', r'(?P<fact><font.*</font>)', True),
|
||||
#'southpark': ('', 'http://www.southparkquotes.com/random.php?num=1', r'<p>(?P<fact>.*)</p>', True),
|
||||
'mjg': ('Matthew Garrett facts', 'http://www.angryfacts.com', r'</p><h1>(?P<fact>.*?)</h1>', False),
|
||||
'mjg59': ('Matthew Garrett facts', 'http://www.angryfacts.com', r'</p><h1>(?P<fact>.*?)</h1>', False),
|
||||
'vmjg': ('Virtual Matthew Garrett', 'http://www.rjek.com/vmjg59.cgi', r'<body>(?P<fact>.*?)<p>', True),
|
||||
'vmjg59': ('Virtual Matthew Garrett', 'http://www.rjek.com/vmjg59.cgi', r'<body>(?P<fact>.*?)<p>', True),
|
||||
'shakespeare': ('Shakespeare quotes', 'http://www.pangloss.com/seidel/Shaker/', r'<font.*?>(?P<fact>.*?)</font>', False),
|
||||
'lugradio': ('Lugradio facts', 'http://planet.lugradio.org/facts/', r'<h2>\s*(?P<fact>.*?)</h2>', False),
|
||||
'bofh': ('BOFH excuses', '/home/dennis/ubotu/plugins/Mess/bofh.txt', 'BOFH Excuse #%d: ', False),
|
||||
'42': ('HHGTTG quotes', '/home/dennis/ubotu/plugins/Mess/42.txt', '', False),
|
||||
'magic8ball': ('The magic 8ball', '/home/dennis/ubotu/plugins/Mess/ball.txt', '', False),
|
||||
'ferengi': ('Ferengi rules of acquisition', '/home/dennis/ubotu/plugins/Mess/ferengi.txt', 'Ferengi rule of acquisition ', False)
|
||||
}
|
||||
data = {}
|
||||
for m in mess.keys():
|
||||
if mess[m][1].startswith('http'):
|
||||
mess[m] = (mess[m][0], mess[m][1],re.compile(mess[m][2], re.I|re.DOTALL), mess[m][3])
|
||||
else:
|
||||
fd = open(mess[m][1])
|
||||
data[mess[m][1]] = [x.strip() for x in fd.readlines()]
|
||||
fd.close()
|
||||
|
||||
badwords = ['sex','masturbate','fuck','rape','dick','pussy','prostitute','hooker',
|
||||
'orgasm','sperm','cunt','penis','shit','piss','urin','bitch','semen','cock',
|
||||
'retard', 'cancer', 'hiv', 'aids']
|
||||
tagre = re.compile(r'<.*?>')
|
||||
def filter(txt,off):
|
||||
_txt = txt.lower()
|
||||
if not off:
|
||||
for b in badwords:
|
||||
if b in _txt:
|
||||
return None
|
||||
txt = txt.replace('<br />','').replace('\n','').replace('\r','')
|
||||
txt = txt.replace('<i>','/').replace('</i>','/').replace('<b>','*').replace('</b>','*')
|
||||
txt = txt.replace('"','"').replace('<','<').replace('>','>')
|
||||
txt = tagre.sub('',txt)
|
||||
return txt
|
||||
|
||||
times = {}
|
||||
|
||||
def ok(func):
|
||||
def newfunc(*args, **kwargs):
|
||||
global time
|
||||
plugin = args[0]
|
||||
channel = args[2].args[0]
|
||||
if not channel.startswith('#'):
|
||||
delay = 5
|
||||
else:
|
||||
if not plugin.registryValue('enabled', channel):
|
||||
return
|
||||
delay = plugin.registryValue('delay', channel)
|
||||
if channel not in times.keys():
|
||||
times[channel] = time.time()
|
||||
elif times[channel] < time.time() - delay:
|
||||
times[channel] = time.time()
|
||||
else:
|
||||
return
|
||||
i=0
|
||||
func(*args, **kwargs)
|
||||
newfunc.__doc__ = func.__doc__
|
||||
return newfunc
|
||||
|
||||
class Mess(callbacks.PluginRegexp):
|
||||
"""Random Mess plugin"""
|
||||
threaded = True
|
||||
regexps = ['hugme']
|
||||
hugs = ["hugs %s","gives %s a big hug","gives %s a sloppy wet kiss",
|
||||
"huggles %s","squeezes %s","humps %s"]
|
||||
|
||||
|
||||
def isCommandMethod(self, name):
|
||||
if not callbacks.PluginRegexp.isCommandMethod(self, name):
|
||||
if name in mess:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def listCommands(self):
|
||||
commands = callbacks.PluginRegexp.listCommands(self)
|
||||
commands.remove('messcb')
|
||||
commands.extend(mess.keys())
|
||||
commands.sort()
|
||||
return commands
|
||||
|
||||
def getCommandMethod(self, command):
|
||||
try:
|
||||
return callbacks.PluginRegexp.getCommandMethod(self, command)
|
||||
except AttributeError:
|
||||
return self.messcb
|
||||
|
||||
def getCommandHelp(self, command):
|
||||
try:
|
||||
return callbacks.PluginRegexp.getCommandMethod(self, command)
|
||||
except AttributeError:
|
||||
return mess[command[0]][0]
|
||||
|
||||
def _callCommand(self, command, irc, msg, *args, **kwargs):
|
||||
method = self.getCommandMethod(command)
|
||||
if command[0] in mess:
|
||||
msg.tag('messcmd', command[0])
|
||||
try:
|
||||
method(irc, msg, *args, **kwargs)
|
||||
except Exception, e:
|
||||
self.log.exception('Uncaught exception in %s.', command)
|
||||
if conf.supybot.reply.error.detailed():
|
||||
irc.error(utils.exnToString(e))
|
||||
else:
|
||||
irc.replyError()
|
||||
|
||||
@ok
|
||||
def messcb(self, irc, msg, args, text):
|
||||
"""General mess"""
|
||||
t = threading.Thread(target=self.messthread, args=(irc, msg, args, text))
|
||||
t.start()
|
||||
|
||||
def messthread(self, irc, msg, args, text):
|
||||
global data
|
||||
cmd = msg.tagged('messcmd')
|
||||
try:
|
||||
(doc, loc, tx, off) = mess[cmd]
|
||||
except:
|
||||
cmd = cmd[1:]
|
||||
(doc, loc, tx, off) = mess[cmd]
|
||||
if off and not self.registryValue('offensive', msg.args[0]):
|
||||
return
|
||||
if loc.startswith('http'):
|
||||
i = 0
|
||||
while i < 5:
|
||||
inp = utils.web.getUrl(loc)
|
||||
fact = tx.search(inp).group('fact')
|
||||
fact = filter(fact,off)
|
||||
if fact:
|
||||
irc.reply(fact)
|
||||
return
|
||||
i += 1
|
||||
else:
|
||||
i = random.randint(0,len(data[loc])-1)
|
||||
if '%d' in tx:
|
||||
tx = tx % i
|
||||
irc.reply(tx + data[loc][i])
|
||||
messcb = wrap(messcb, [additional('text')])
|
||||
|
||||
# WARNING: depends on an alteration in supybot/callbacks.py - don't do
|
||||
# str(s) if s is unicode!
|
||||
@ok
|
||||
def dice(self, irc, msg, args, count):
|
||||
if not count: count = 1
|
||||
elif count > 5: count = 5
|
||||
elif count < 1: count = 1
|
||||
t = u' '.join([x.__call__([u"\u2680",u"\u2681",u"\u2682",u"\u2683",u"\u2684",u"\u2685"]) for x in [random.choice]*count])
|
||||
irc.reply(t)
|
||||
dice = wrap(dice, [additional('int')])
|
||||
|
||||
@ok
|
||||
def hugme(self, irc, msg, match):
|
||||
r""".*hug.*ubotu"""
|
||||
irc.queueMsg(ircmsgs.action(msg.args[0], self.hugs[random.randint(0,len(self.hugs)-1)] % msg.nick))
|
||||
|
||||
@ok
|
||||
def fortune(self, irc, msg, args):
|
||||
""" Display a fortune cookie """
|
||||
f = commands.getoutput('/usr/games/fortune -s')
|
||||
f.replace('\t',' ')
|
||||
f = f.split('\n')
|
||||
for l in f:
|
||||
if l:
|
||||
irc.reply(l)
|
||||
fortune = wrap(fortune)
|
||||
|
||||
@ok
|
||||
def ofortune(self, irc, msg, args):
|
||||
""" Display a possibly offensive fortune cookie """
|
||||
if not self.registryValue('offensive', msg.args[0]):
|
||||
return
|
||||
f = commands.getoutput('/usr/games/fortune -so')
|
||||
f.replace('\t',' ')
|
||||
f = f.split('\n')
|
||||
for l in f:
|
||||
if l:
|
||||
irc.reply(l)
|
||||
ofortune = wrap(ofortune)
|
||||
|
||||
@ok
|
||||
def futurama(self, irc, msg, args):
|
||||
""" Display a futurama quote """
|
||||
u = urllib2.urlopen('http://slashdot.org')
|
||||
h = [x for x in u.headers.headers if x.startswith('X') and not x.startswith('X-Powered-By')][0]
|
||||
irc.reply(h[2:-2].replace(' ',' "',1) + '"')
|
||||
futurama = wrap(futurama)
|
||||
|
||||
@ok
|
||||
def pony(self, irc, msg, args, text):
|
||||
""" NO! """
|
||||
if not text:
|
||||
text = 'you'
|
||||
irc.reply("No %s can't have a pony, %s!" % (text, msg.nick))
|
||||
pony = wrap(pony, [additional('text')])
|
||||
|
||||
Class = Mess
|
18
Mess/test.py
Normal file
18
Mess/test.py
Normal file
@ -0,0 +1,18 @@
|
||||
###
|
||||
# Copyright (c) 2006-2007 Dennis Kaarsemaker
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
###
|
||||
|
||||
from supybot.test import *
|
||||
|
||||
class MessTestCase(PluginTestCase):
|
||||
plugins = ('Mess',)
|
Reference in New Issue
Block a user