Commit Graph

422 Commits

Author SHA1 Message Date
Brian S. Stephan 88e470183b Dispatch: support multiple targets for a key 2013-05-03 16:01:45 -05:00
Brian S. Stephan f09a41bce0 Dispatch: better (aka correct) db_init section 2013-05-03 15:59:49 -05:00
Brian S. Stephan ccbea5ecdb Twitter: re-enable timeline polling and display
this was commented out for no reason, it can be disabled simply by
unsetting output_channel
2013-05-03 10:58:24 -05:00
Brian S. Stephan 7322ebde8f Markov: make some attempt to avoid name: chains
there are a lot of these, so it's a hard problem to solve entirely, but
this will avoided some cases at least
2013-02-15 10:24:45 -06:00
Brian S. Stephan 6a12763c81 Dice: only match !dice/!ctech at start of line 2013-02-11 14:06:15 -06:00
Brian S. Stephan 9b7cbadce6 rename Module.new_sendmsg() -> Module.sendmsg()
remove the deprecated method as well, of course
2013-02-09 15:11:38 -06:00
Brian S. Stephan c7d78ba6fc removing Radio, it was never good, barely worked
might revisit this in the future and just use an mpd module
2013-02-09 15:07:46 -06:00
Brian S. Stephan 1415f740fb remove usages of Module.sendmsg()
we're switching to an idiom where the bot is only on one connection, so
we don't need to care about connection tracking. new_sendmsg accordingly
doesn't take a connection argument. now i can remove the old sendmsg

caught in the wake, a bunch of connections being passed here and there
can be removed, changing some module method signatures and such. there
might be more to remove still
2013-02-09 15:05:44 -06:00
Brian S. Stephan 5314dadc07 Markov: massive rewrite of the chainer
a bunch of logic is moved around, some queries are improved, max_size
does what it's actually supposed to do. all in all this is a much
clearer chainer, even if the actual results are more or less the same.

it's probably a bit faster in most cases but slower in situations when
all the seed words have been consumed and it needs to do
__start1,__start2 chains (since there's so many of them, it's rather
slow). otherwise, it tries to use seed words in sentences, combining
multiple sentences when possible. there's a lot more in the periphery,
but that's the general idea
2013-02-09 14:44:45 -06:00
Brian S. Stephan 5d90c98fb2 Markov: actually use the working backwards results
thinko, there were code paths where the working backwards results were
discarded. don't discard them.
2013-02-08 02:13:15 -06:00
Brian S. Stephan 0b6d5e3f44 Markov: always update hit_word
whether or not we went backwards and forwards, or just forwards, this
cycle of the loop, end the iteration by calling the end of the sentence
our hit word. if it was our seed word, this will trigger a new seed
selection
2013-02-08 02:11:29 -06:00
Brian S. Stephan e7bed15ee8 Markov: _retrieve_random_v_for_k1_and_k2_with_pref
get one random v for a k1,k2 via SQL. prefer a word to show up in the
results, though there's no guarantee it will. this simplifies the
general looking forward case, and could possibly even work ok on the new
sentence stuff, though i haven't tried to update that portion of the
code yet
2013-02-08 02:07:57 -06:00
Brian S. Stephan db221a3c06 Markov: keep start2 from leaking out of backfill
only add the reverse-search result to list of words if it isn't __start2
(and if it is __start2, just carry on, giving the code one last chance
to find something else)
2013-02-08 02:02:44 -06:00
Brian S. Stephan 5a55227cf9 Markov: _retrieve_random_k2_for_value
rather than getting all k2s for a value from the database, then walking
the list and picking one at random, pick one for a value at random via
a query

this simplifies the code, and is (usually) faster than the old way,
which has been removed. it would be even faster if it weren't for that
context_id stuff, but so it goes
2013-02-08 01:15:32 -06:00
Brian S. Stephan b5be0501de Merge branch 'master' of ayu.incorporeal.org:dr.botzo 2013-02-08 00:21:38 -06:00
Brian S. Stephan 232eeccbcb Markov: let backwards chainer go randomly longer
the code, in a kind of trial state, would very quickly stop trying to
work backwards. (part of this was for performance reasons, i believe.)
since that seems to have proven stable, let's mess with it --- the
backwards chainer can now go backwards a random distance, rather than
just what almost always turned out to be 2
2013-02-08 00:21:08 -06:00
Brian S. Stephan 60ac4d25bd Markov: some minor formatting/pylint cleanups 2013-02-07 23:51:41 -06:00
Brian S. Stephan 89847a6e58 IrcAdmin: sleep a configured time before autojoin
this is to let any sort of autosend commands apply before joining
channels. for example, i have my bot set to turn on its hostserv cloak,
which was sometimes happening after channel joins, making its hostname
appear different in various channels. this solves that

as a total aside, this module is becoming really poorly named, i should
probably do something about that
2013-01-13 11:45:01 -06:00
Brian S. Stephan 475fa73bf3 Dispatch: encode('utf-8') XML-RPC input 2013-01-12 10:10:32 -06:00
Brian S. Stephan 947e82b78f Dispatch: send messages to channels via XML-RPC
keep a collection of key-channel pairs that, when receiving an XML-RPC
dispatch message with a key and message, sends the message to the
associated channel. this allows for various notification bus style stuff

this is the barebones version, there's no IRC admin interaction yet, so
all key-channel pairs need to be managed by direct database access. it
is possible i won't bother changing this. there are also some
not-so-clever assumptions, like that the bot is already in the channel
it is trying to speak in
2013-01-04 10:17:07 -06:00
Brian S. Stephan f7f40fc070 Pi: comment cleanups 2012-12-21 11:24:16 -06:00
Brian S. Stephan fe2358462a Countdown: remove unused import re 2012-12-20 18:06:09 -06:00
Brian S. Stephan ecf295314d Echo: fix comment, groups is a tuple, not a list 2012-12-20 14:29:52 -06:00
Brian S. Stephan d0900452bc Countdown: total rewrite. regex handlers, mysql
this is a pretty decent example of how to do new modules now, i think,
and of decent size while showing most of what one would want to do
2012-12-20 14:27:43 -06:00
Brian S. Stephan 08d08d537e Echo: wrap echo() for the XML-RPC server
this serves as a good example of how to reuse code for the XML-RPC
interface. we wrap it for convenience, so that all that needs to be
supplied to the web service method is the message to echo. of course,
other modules can wrap things how they feel the need to, even adding
authentication, i guess, if they wanted

note that it doesn't unregister the XML-RPC method. for starters, i
didn't add an unregister to DrBotIRC, so it can't, and secondly, it
looks like reregistering overwrites the old one. this hasn't been
extensively tested but that's what i'm seeing
2012-12-20 10:36:53 -06:00
Brian S. Stephan f09bc06634 Echo: rewrite to do regex handlers
this is the first implementer of the new regex handler code, by all
accounts it's working fine, hopefully the underlying code in DrBotIRC
won't need to change as i go forward, but it might
2012-12-20 10:20:33 -06:00
Brian S. Stephan 891b2bcab8 remove all of the help stuff
sorry, mikeb. it never really caught on and seemed kind of janky. i
intend to have something that uses docstrings in the future, with the
helping baked into Module or maybe even DrBotIRC
2012-12-19 21:12:49 -06:00
Brian S. Stephan 8d6d66333b Module: don't pass DrBotServerConnection to init
another "this is unnecessary" change, obviously impacting all the
modules that override __init__ as well as the base class. again, they
can use the DrBotIRC instance for anything, which is (with one
exception) only for add/remove_global_handler, which i'm planning on
working my way off of anyway
2012-12-19 21:06:53 -06:00
Brian S. Stephan 3e76f75bba Module: remove reply(), use DrBotIRC's
obviously this means all of the modules changed to accomodate. this is
one of many steps to reduce the number of times we pass connections and
servers and other such info around, when it's mostly unnecessary because
modules have a reference to DrBotIRC
2012-12-19 20:51:35 -06:00
Brian S. Stephan 9fd8eeb504 remove GoogleTranslate
the API is no longer free. not that i've made Babelfish be at all
reliable yet, but let's prune the tree a bit while we're doing this kind
of thing
2012-12-19 00:00:20 -06:00
Brian S. Stephan 8a5e6b9130 IrcAdmin: note limitation with automsg and vhosts
i feel as if i should fix this eventually, but it's pretty low on the
priority list, to be honest
2012-12-18 20:56:30 -06:00
Brian S. Stephan b51b8b521d IrcAdmin: option for sending privmsgs on connect
nickserv/hostserv stuff are the obvious uses for this. i guess you could
have some sort of "hi i connected" type thing to the admin if you wanted
2012-12-18 20:15:32 -06:00
Brian S. Stephan f54e209c2f Pi: "unit circle" in the output message 2012-12-18 20:12:26 -06:00
Brian S. Stephan 7627af5d5b Radio: get mpd status and such
very rough, just committing because what few things it does do work
2012-11-07 18:15:56 -06:00
Brian S. Stephan fdc7a3d9a9 gross TODO: fix this later 2012-11-07 18:14:59 -06:00
Brian S. Stephan 9ec74d0e35 Markov: off by one while counting up to min_size 2012-10-05 17:09:04 -05:00
Brian S. Stephan 7b2e3fa9aa Weather: refer to the right object in prev. commit 2012-10-05 10:43:41 -05:00
Brian S. Stephan e69766e71e Weather: do ambiguous results prompt for forecast 2012-10-05 10:42:21 -05:00
Brian S. Stephan 0da81ca31e Weather: more verbose zmw codes in ambig. results
when printing zmw codes because the query was ambiguous, print
city, country rather than just city
2012-10-05 10:30:03 -05:00
Brian S. Stephan 49e83f18de Weather: do wunderground forecasts 2012-10-05 10:23:59 -05:00
Brian S. Stephan 425db7be81 Weather: weather conditions readability fixes
* bold (^B) city name, condition elements
* replace 32F and 32 F with 32°F
2012-10-05 10:22:35 -05:00
Brian S. Stephan 6426df9ece Weather: dump json output in a prettier format 2012-10-05 10:20:34 -05:00
Brian S. Stephan 41c1a46bb2 Weather: give hints when results are ambiguous 2012-09-17 16:47:41 -05:00
Brian S. Stephan 97259eb6b3 Merge branch 'master' of git.incorporeal.org:dr.botzo 2012-09-17 16:27:00 -05:00
Brian S. Stephan 2699396dd8 Weather: rewrite to use weather underground
this is still a work in progress, but the basic support is there
2012-09-17 16:26:29 -05:00
Brian S. Stephan 02729377d8 Markov: more anti-stop bugfixes 2012-09-17 16:23:42 -05:00
Brian S. Stephan bdba8e20f1 Karma: don't swallow potential commands
when matching patterns, !rank item++ would not get replied to
since the karma matcher would hit, increment item, and then return
(with no response). now it hits but lets processing continue.

doing !rank item++ of course still increments item, which is probably
not what you want to have happen, but i'm not sure how i feel about
fixing it yet, since even if it's not what you /want/ it's probably
what you /expect/.
2012-09-13 12:28:03 -05:00
Brian S. Stephan e7a573bce1 Karma: allow multiple karma expressions per line 2012-09-13 12:16:25 -05:00
Brian S. Stephan c064f6ebe1 Markov: check for start2-only lists correctly while working backwards
what i was doing before had practically no chance of working right,
so that's fun
2012-07-30 10:25:13 -05:00
Brian S. Stephan e8e4354358 Markov: many working backwards bugfixes wrapped together 2012-07-29 22:36:11 -05:00