Commit Graph

788 Commits

Author SHA1 Message Date
Brian S. Stephan 8a7660380b Twitter: persist the authentication tokens and reuse them on init 2012-07-14 09:29:12 -05:00
Brian S. Stephan 2650824dbd Markov: correct the documentation on min_size/max_size in _generate_line 2012-07-14 09:22:37 -05:00
Brian S. Stephan 0b51eb88a8 DrBotIRC: better printing of exceptions 2012-07-14 09:16:59 -05:00
Brian S. Stephan 2dd27dde4b Twitter: more cleanup, clarify the auth stuff a bit 2012-07-14 08:41:40 -05:00
Brian S. Stephan 82765c7404 Twitter: some code cleanups, use self.twit.VerifyCredentials rather than an authed variable 2012-07-14 08:17:21 -05:00
Brian S. Stephan d50b0867e8 DrBotIRC: bring reply() back to the base server, for use in alias 2012-07-10 17:18:35 -05:00
Brian S. Stephan 395d436008 Seen: punctuation nitpicking, and provide response when user was not seen 2012-07-10 17:15:52 -05:00
Brian S. Stephan d94d7f0c88 Markov: register ._generate_line as markov_generate_line 2012-04-05 21:24:41 -05:00
Brian S. Stephan 2e1bc8d5e0 Dice: expose do_roll as XML-RPC method "dice_roll" 2012-03-30 17:54:42 -05:00
Brian S. Stephan 60b7a33f7b Dice: apply the irc formatting outside of the !roll handler 2012-03-30 17:54:06 -05:00
Brian S. Stephan f5b367406b Dice: break out the !roll handler 2012-03-30 17:26:51 -05:00
Brian S. Stephan 1aa7a542f2 DrBotIRC: only register a function if there's an xmlrpc server loaded 2012-03-30 17:25:46 -05:00
Brian S. Stephan 731aec8c0c DrBotIRC, Facts: clean up some method header doc since it shows up in XML-RPC 2012-03-30 11:14:31 -05:00
Brian S. Stephan 4253c83694 Facts: expose _get_fact as an XML-RPC method 2012-03-30 10:19:16 -05:00
Brian S. Stephan 71688f2389 Facts: refactoring; move the database querying into its own method (for reuse) 2012-03-30 10:18:40 -05:00
Brian S. Stephan e16d698d0e DrBotIRC: add method to register a function to the XML-RPC server
this appears to be safe to do while the other thread is doing serve_forever()
2012-03-30 10:17:13 -05:00
Brian S. Stephan 05a3bd0af7 move XML-RPC support into DrBotIRC so everything can eventually use it 2012-03-30 09:43:30 -05:00
Brian S. Stephan 91faebf33a XmlRpcServer: expose functionality via XML-RPC
this could be fun. provide an XML-RPC web service that allows for
remote access into the bot. in addition to some obvious stuff, this
includes a method that lets you execute any arbitrary module's arbitrary
method (so be careful) and retrieve the results.

as a side effect this has made it apparent that i need to clean up
some of my modules so that functionality and irc responses are decoupled.
2012-03-30 00:44:25 -05:00
Brian S. Stephan 25d0f2f5c3 connect to sqlite with isolation_level=None as an attempt to avoid (invalid) database is locked errors 2012-03-29 20:09:50 -05:00
Brian S. Stephan 07744a0f66 indicate recursion better by adding _recursing to Event
for simplicity's sake, this was added to the extlib/irclib rather
than subclassing. because i'm lazy. anyway, check that flag instead
of doing the event._target = None hack, since that hack was breaking
Markov.

for an unrelated reason (what to learn and not learn), update Markov

also remove an unused method that was getting in my way while coding this
2012-03-29 20:07:32 -05:00
Brian S. Stephan 7d41564d02 Markov: allow for auto-context insertion
this should result in no chains having a null context --- if no pre-existing
context is created, one is created for the channel/nick and used. this makes,
for example, arbitrary queries "private" to that nick (again unless that has
been overridden). shouldn't affect much of anything, but adding this made
the context-less learning code obsolete, which is fine since it was never used
anyway
2012-03-19 00:12:29 -05:00
Brian S. Stephan ce93480e9b Dice: allow !roll/!ctech strings anywhere, not just at the start of the line 2012-03-19 00:11:56 -05:00
Brian S. Stephan 341066a0ba DrBotIRC: when doing ignore checks, lowercase the input nick, since that's what the config module does 2012-03-07 22:48:30 -06:00
Brian S. Stephan d042c273c9 web: fix link paths 2012-03-07 22:47:49 -06:00
Brian S. Stephan 5c2c3882f3 Module: remove connection timeout setting from db connect 2012-03-07 22:47:10 -06:00
Brian S. Stephan ac14c2a8e8 Acro: use an actual variable :| 2012-03-02 20:10:39 -06:00
Brian S. Stephan b08059df78 Acro: tuning the sleep times, added self.seconds_to_submit_step as another tunable 2012-03-02 20:05:47 -06:00
Brian S. Stephan 7e5d51f460 Acro: play a game commonly known as acromania.
the bot will generate acronyms of 3-8 characters in length. it's your
job to find the "best" phrase fitting the acronym. work in progress,
but this is still playable
2012-03-02 19:13:03 -06:00
Brian S. Stephan ef9b80d86f DrBotIRC: add support for ignoring all events from a nick
rudimentary for the moment. pop something like this in your config:

[Ignore]
nick_to_ignore = 1
2012-03-01 22:00:42 -06:00
Brian S. Stephan 26bc8bec34 Markov: rebuild the tables, use the context stuff in a better fashion this time
the module will drop your old tables if you have them, so if there's data there,
be sure to back them up and figure out some migration strategy (probably annoying
and probably having to script it).

the big change is that each line is associated to a context now, and channels
are also associated to contexts. this should allow for a better partitioning
of multiple brains, and changing which channels point to which brain.

also caught in the wake is some additional logging verbosity, and a change to
no longer lower() everything learned.

the script to dump a file into the database has also been updated with the above
changes
2012-02-28 23:23:14 -06:00
Brian S. Stephan 79ddce0bcb Babelfish: already a smattering of bugfixes and cleanups 2012-01-23 22:05:25 -06:00
Brian S. Stephan c018bb9634 Babelfish: since google translate's API has been discontinued, let's use babelfish 2012-01-23 21:44:52 -06:00
Brian S. Stephan c0e2de11f7 Twitter: tweet output tweaks
prefer @username printing over Full Name. previous output was inconsistent
2012-01-18 13:00:08 -06:00
Brian S. Stephan a608f509ca TextTransform: al bhed translator 2011-10-21 17:17:37 -05:00
Brian S. Stephan ef66c855f3 Achievements: new dumb feature, add irc achievements
stats on users are tracked, and achievements are defined by writing
sql queries against those stats. silly fun
2011-10-21 17:01:49 -05:00
Brian S. Stephan 8c1ffc54ba Markov: drop the max id stuff, get a bunch of chains and pick one randomly. cooler this way. 2011-10-21 17:01:09 -05:00
Brian S. Stephan e3ef3f48dc Markov: add support for temporarily disabling chatter by supplying a negative chance 2011-10-21 16:59:57 -05:00
Brian S. Stephan 78f7614987 Module: it's come to this. bump the default sqlite connection timeout to 60 sec 2011-10-18 00:48:46 -05:00
Brian S. Stephan b82dd382ee DrBotIRC: swallow the rare exception that trickles up this far 2011-10-18 00:48:11 -05:00
Brian S. Stephan d4f7941b7b TODO: logging module 2011-10-18 00:41:15 -05:00
Brian S. Stephan cda1d43606 Markov: index on (v, context) and other enhancements for the last commit
reduce some infinite loop possibilities, and add an index with the old <= id trick
to speed up the searching for backwards chains
2011-10-16 21:13:27 -05:00
Brian S. Stephan 42962bc48d Markov: add support for starting in the middle of a chain and working backwards
this only makes sense if we have a target word set, which we usually do.
start with the target word and go backwords, finding k2s that lead to it
(and that lead to that k2, and so on) until we get to the start-of-chain
value, when we know we're done working backwards. then resume the normal
appending logic

probably needs some work, probably a bit slow on huge databases. analysis
pending, but this appears to work
2011-10-16 20:19:51 -05:00
Brian S. Stephan ad93ea28ec Dice: fix display of multi-run rolls (e.g. 6#d20) 2011-10-14 14:22:56 -05:00
Brian S. Stephan 86e6cd3db0 Dice: change the output format so it's a bit more readable 2011-10-13 21:08:09 -05:00
kad 93761df5ed Allow spaces after ; for separated rolls 2011-10-13 20:30:59 -05:00
Brian S. Stephan 50fbbbfedd Markov.py: tweaking the shut up check, this has been pretty good for a while 2011-09-20 01:20:27 -05:00
Brian S. Stephan 70e1ee017f make drbotzo_modules.module a primary key so that we can use INSERT OR REPLACE INTO
WARNING! if you have an existing drbotzo_modules, you MUST RECREATE IT
WITH THE PRIMARY KEY. things will be wonky without it.

easiest way is to (by hand) create drbotzo_modules_temp as shown in the code,
INSERT INTO drbotzo_modules_temp SELECT * FROM drbotzo_modules, DROP the old
table, and ALTER TABLE RENAME TO the new one.

again, if you don't do this, newer modules will do all sorts of crazy
things, namely trying to create tables that already exist (because they have
multiple, differing values in drbotzo_modules)
2011-07-26 18:32:06 -05:00
Brian S. Stephan 9ecd66f94a Module: upsert drbotzo_modules 2011-07-06 21:51:30 -05:00
Brian S. Stephan 4566d1734e change the default sqlite timeout to 30 seconds
this should make the bot wait longer for table locks, assuming i
read the docs right
2011-07-01 18:42:49 -05:00
Brian S. Stephan a51f0cb54c Markov: refer to the actual target from a chatter target when shutting up 2011-07-01 18:42:04 -05:00