IRC Bots

From J Wiki
< Community‎ | IRC
Jump to navigation Jump to search


existing bots

If you want to know how the existing irc bots work, see Community/IRC.

purpose

This page discusses implementations, developments, bugs, ideas, of IRC bots for #jsoftware

ideas

  • Logging. Would be nice to have a bot log #jsoftware to a webpage, maybe a wiki page. With proper formatting of J expressions and output.
  • Would be nice to put a WWW to IRC interface somewhere on jsoftware.com, perhaps even in a special page on the wiki. That way people could test out IRC pain-free.
  • RecentChanges watcher; subscribes to RecentChanges and notifies #jsoftware (user, page and comment, on non-trivial changes)
  • JForum watcher; Subscribes to the Forums and notifies #jsoftware (user and truncated subject line)

extensions

  • Nopaste. J bots should submit results to nopaste and return the URL, if the output is over a certain size limit. Title of the paste should be the J code that created it.
  • Paste multimedia. plot i. 10 [ load 'plot' should put the plot up on a website, like nopaste, and return the URL.
  • Context:
 <NotJack_> I think that it would be nice to have named contexts.  The names would be provided by an extra parameter, provided by the addressing scheme.  Two special contexts are provided:  commons and private.  commons is named " " and is shared by everyone.  private is named "" and is individual to each user (equivalent to the named context "nick" for that nick).
[2007-05-01 16:03:36 -0500 GMT] <oktopus> ] 'abc' ,(14 15{a.),'def'
[2007-05-01 16:03:37 -0500 GMT] <evalj> oktopus: abc  def
[2007-05-01 16:03:44 -0500 GMT] <NotJack_> the addressing scheme provides a mechanism to name the context.
[2007-05-01 16:04:10 -0500 GMT] <NotJack_> a single colon after the bot's name does what it does now: creates, uses, and destroys an ephemeral context.
[2007-05-01 16:04:58 -0500 GMT] <NotJack_> otherwise, if the bot's name is suffixed with a colon followed by non-whitespace followed by a colon, you get the context named by the string between the colons.
[2007-05-01 16:05:04 -0500 GMT] <oktopus> ] 'abc' ,(23 25{a.),'def'
[2007-05-01 16:05:04 -0500 GMT] <evalj> oktopus: abcâ ´â  def
[2007-05-01 16:05:09 -0500 GMT] <NotJack_> only one "whitespace" context is provided: " ".
[2007-05-01 16:05:26 -0500 GMT] <NotJack_> and it's equivalent to any amount of whitespace.
[2007-05-01 16:05:28 -0500 GMT] <NotJack_> thus:
[2007-05-01 16:05:37 -0500 GMT] <NotJack_> bot:  i. 5 NB. As now, ephemeral context.
[2007-05-01 16:05:48 -0500 GMT] <oktopus> ] 'abc' ,(28 29 30 31{a.),'def'
[2007-05-01 16:05:49 -0500 GMT] <evalj> oktopus: abc    def
[2007-05-01 16:05:50 -0500 GMT] <NotJack_> bot: :  A =: i. 5  NB.  common context
[2007-05-01 16:06:10 -0500 GMT] <NotJack_> bot::  NotJack =: i.5  NB.  My personal context
[2007-05-01 16:06:37 -0500 GMT] <NotJack_> Hmm, maybe  :: should be the common context
[2007-05-01 16:06:42 -0500 GMT] <NotJack_> and  :.:  should be my personal context
[2007-05-01 16:07:00 -0500 GMT] <NotJack_> and whitespace is strictly prohibited in context names.
[2007-05-01 16:07:26 -0500 GMT] <NotJack_> and perhaps contexts should be called "channels"
[2007-05-01 16:07:34 -0500 GMT] <metaperl> back from 45th and Madison is homogenous little King of Prussia, PA -- New York knocked my socks off with the racial variety! I was exciting... I think New Yorkers intentionally make lots of noise. They dont feel comfortable with peace and quiet :)
[2007-05-01 16:07:45 -0500 GMT] <b_jonas> you mean, there should be interpreter contexts shared between users and ones private to a user?
[2007-05-01 16:07:53 -0500 GMT] <NotJack_> yes
[2007-05-01 16:07:57 -0500 GMT] <b_jonas> that would make sense
[2007-05-01 16:08:00 -0500 GMT] <NotJack_> one interpreter per channel name
[2007-05-01 16:08:11 -0500 GMT] <NotJack_> a privmsg automatically starts a private channel
[2007-05-01 16:08:14 -0500 GMT] <b_jonas> but if I implement that in my bot, I'll decide on the specific context
[2007-05-01 16:08:18 -0500 GMT] <b_jonas> (sorry)
[2007-05-01 16:08:23 -0500 GMT] <NotJack_> no channel name == emphemeral context
[2007-05-01 16:08:25 -0500 GMT] <b_jonas> and the limitations
[2007-05-01 16:08:33 -0500 GMT] <NotJack_> empty channel name = common context
[2007-05-01 16:08:47 -0500 GMT] <b_jonas> I'm POWER-HUNGRY
[2007-05-01 16:08:47 -0500 GMT] <NotJack_> nickname or .  or privmsgg == private (to that nick) context
[2007-05-01 16:09:03 -0500 GMT] <NotJack_> any other channel: new context with that name
[2007-05-01 16:09:33 -0500 GMT] <NotJack_> and bot:channel:  with nothing following should terminate the context
[2007-05-01 16:09:49 -0500 GMT] <NotJack_> I'm just laying out ideas here.
[2007-05-01 16:09:56 -0500 GMT] <NotJack_> I could grok enough ruby quickly to modify ijx to do it.
[2007-05-01 16:10:05 -0500 GMT] <NotJack_> if you do it in a way that doesn't satisfy me.
[2007-05-01 16:10:06 -0500 GMT] <NotJack_> so no worries
[2007-05-01 16:10:40 -0500 GMT] <oktopus> ijx: ] (3 : ' <"2 m{h,"2[12 6 21$,>(<'''')((r=0)#i.#r)}<"1[3":,.r[h=.'' Su Mo Tu We Th Fr Sa'',:"1~_3(_12&{.)\h=.''JanFebMarAprMayJunJulAugSepOctNovDec''[m=.m,(0=#m=.<:}.y)#i.12[r=.,(-7|b+0,+/\}:r)|."0 1 r(]&:>:*"1>/)i.42[r=.28+3,(~:/0=4 100 400|a),10$5$3 2[b=.a+-/<.4 100 400%~<:a=.((j<100)*(-100&|){.6!:0'''')+j=.{.y ') 2007 4 5
[2007-05-01 16:10:41 -0500 GMT] <ijx> oktopus: +---------------------+---------------------+
[2007-05-01 16:10:41 -0500 GMT] <ijx> oktopus: |         Apr         |         May         |
[2007-05-01 16:10:41 -0500 GMT] <ijx> oktopus: | Su Mo Tu We Th Fr Sa| Su Mo Tu We Th Fr Sa|
[2007-05-01 16:10:41 -0500 GMT] <ijx> oktopus: |  1  2  3  4  5  6  7|        1  2  3  4  5|
[2007-05-01 16:10:41 -0500 GMT] <ijx> oktopus: |  8  9 10 11 12 13 14|  6  7  8  9 10 11 12|
[2007-05-01 16:10:42 -0500 GMT] <ijx> oktopus: ...
[2007-05-01 16:10:46 -0500 GMT] <b_jonas> sure
[2007-05-01 16:10:57 -0500 GMT] <NotJack_> I guess someone who isn't NICK should get |security violation if he tricks  bot:NICK:foo
[2007-05-01 16:11:23 -0500 GMT] <b_jonas> oh no, I don't make fake error messages that are exactly the same as j errors
[2007-05-01 16:11:26 -0500 GMT] <b_jonas> just similar ones
[2007-05-01 16:11:34 -0500 GMT] <NotJack_> if all the persons using a channel /part, the context dies with them
[2007-05-01 16:11:37 -0500 GMT] <b_jonas> bar header, and concise style
[2007-05-01 16:11:49 -0500 GMT] <NotJack_> specifically, private channels die when their respective users disconnect
[2007-05-01 16:12:08 -0500 GMT] <NotJack_> that's good.
[2007-05-01 16:12:15 -0500 GMT] <NotJack_> better than the "fake an err" style.
[2007-05-01 16:12:29 -0500 GMT] <b_jonas> you've already seen |timeout and |abortN for various values of N
[2007-05-01 16:12:34 -0500 GMT] <NotJack_> yep.
[2007-05-01 16:15:22 -0500 GMT] <NotJack_> better than "context" or "channel" (which could be confused with a "IRC channel"):  "session"
[2007-05-01 16:15:27 -0500 GMT] <NotJack_> because they ARE j sessions.
[2007-05-01 16:15:45 -0500 GMT] <NotJack_> ijx: 'good boy!'
[2007-05-01 16:15:51 -0500 GMT] <ijx> NotJack_: good boy!
[2007-05-01 16:16:30 -0500 GMT] <NotJack_> hmm .. you'd have to prevent session-spawning abuse.
[2007-05-01 16:16:53 -0500 GMT] <NotJack_> maybe the only permitted sessions should be common, private, and at most N others existing at the same time.
[2007-05-01 16:17:20 -0500 GMT] <NotJack_> and ephemeral of course.