« first day (437 days earlier)      last day (4736 days later) » 

01:01
!Zirak /jquery ajax
!Zirak /new
@Purmou undefined
  +---+
  |   |
  |
  |
  |
__+__

----
!Zirak a
  +---+
  |   |
  |   O
  |
  |
__+__
a
----
@Zirak what other commands are there?
01:04
There's die for stopping the bot if it ever goes out of hand, jquery for jquery API links, mdn for mdn links, new for hangman, and learn for learning new commands
The /learn command is tricky, though
!Zirak /learn
@Purmou Unexpected end of input
@Purmou Could not process input. Error: Unexpected end of input
i bet it is
how does it work?
It accepts a JSON object as an argument. That object should have three properties: name, input and output
user986408
this is so cool :D
01:06
name is the name of the command, input is a regular expression matching the input for the command, and output is a text-template
I'll show you an example
GGG
GGG
!Zirak /learn {"name":"noob", "input":".*", "output":"$0 is a noob!"}
i was about to ask
!Zirak /lean @GGG Command noob learned
@Zirak Invalid command lean
GGG
GGG
!Zirak /noob Zirak
!Zirak /noob
01:06
@GGG Zirak is a noob!
@Purmou is a noob!
user986408
lol
!Zirak /noob EVERYBODY
@Purmou EVERYBODY is a noob!
haha
Hey noobs
GGG
GGG
!Zirak /greet @RyanKinal
@GGG Invalid command greet
GGG
GGG
oh what
!Zirak /learn {"name":"skeet","input":".*","output":"$0, Jon Skeet can do that better."}
@GGG It doesn't have memory. @Purmou Command skeet learned
GGG
GGG
01:08
!Zirak /learn {"name":"greet", "input":".*", "output":"Howdy, $0!"}
!Zirak /skeet Zirak
@GGG Command greet learned
@Purmou Zirak, Jon Skeet can do that better.
GGG
GGG
lol
!Zirak /skeet
@GGG , Jon Skeet can do that better.
GGG
GGG
:(
01:08
!Zirak /greet Ryan
@Purmou Howdy, Ryan!
user986408
:D
Cool stuff
what can i use besides $0?
01:09
[object Object]
GGG
GGG
$1
and what else can go into input?
what does $1 do?
GGG
GGG
regex backreference
beckreference?
@God Howdy, @Ryan!
It accepts any regular expression
Just instead of using \w for example, you use ~w
GGG
GGG
01:10
your mission is to get rid of json input
go
Yeah, I know, but my head is about to explode so I'm taking a break
!Zirak /learn {"name":"beck","input":".*","output":"http://m.mediapost.com/publications/10/Bec‌​k-b.jpg"}
@Purmou Command beck learned
!Zirak /beck
01:11
hmm
i want it to post an image
how can i prevent it from pinging?
You can't
hmm
that would have been great
what does $1 return?
It's for the best, really. You could have it do all kinds of nasty things if it didn't have that ping you
It's like what you'd do in String.replace
!Zirak /mdn String.replace
Sorry, just wanted to show off :D
GGG
GGG
!Zirak /learn {"name":"link","input":".*","output":"http://www.google.com/search?btnI=I&q=$0"}
@GGG Command link learned
GGG
GGG
01:14
!Zirak /link lua
GGG
GGG
google
you nerfed ifeel lucky?
oh noes
!Zirak /learn {"name":"w3fools","input":".*","output":"http://w3fools.com"}
No, my fault
@Purmou Command w3fools learned
!Zirak /w3fools
01:15
@GGG The bot interpr@Purmou w3fools.com
0.o
...the bot interpreted the & as an html entity
GGG
GGG
ohh it's the ampersand being escaped
yeah
hmm
why?
it shouldn't
SO chat escaped it
I'll fix that in a sec
GGG
GGG
!Zirak /learn {"name":"link","input":".*","output":"<a href='http://www.google.com/search?btnI=I&q=$0'>$0</a>"}
01:16
@GGG Command link learned
Wait @_@
GGG
GGG
!Zirak /link jquery animate
Go
GGG
GGG
!Zirak /learn {"name":"link","input":".*","output":"<a href='http://www.google.com/search?btnI=I&q=$0'>$0</a>"}
@GGG Command link learned
!Zirak /learn {"name":"lmgtfy","input":".*","output":"http://lmgtfy.com/?q=$0"}
01:17
@Purmou Command lmgtfy learned
GGG
GGG
/link jquery animate
!Zirak /lmgtfy jquery animate
@Purmou lmgtfy.com/?q=jquery animate
GGG
GGG
!Zirak /link jquery animate
hmmmm
01:18
@GGG &lt;a href=&#39;http://www.google.com/search?btnI=I&q=jquery animate&#39;&gt;jquery animate&lt;/a&gt;
GGG
GGG
lol
haha
@Zirak gotta fix up spaces
That's one of the things I'll never allow people to do, @GGG
GGG
GGG
!Zirak /learn {"name":"link","input":".*","output":"http://www.google.com/search?btnI=I&q=$0"}
@GGG Command link learned
@Purmou no u
GGG
GGG
01:18
how does the markdown go for inline links
[]()?
!Zirak /link jquery animate
GGG
GGG
!Zirak /link "jquery animate"
GGG
GGG
booo
!Zirak /learn {"name":"nou","input":".*","output":"NO U"}
01:19
!Zirak /link jquery%20animate
@Purmou Command nou learned
!Zirak /nou
haha
GGG
GGG
!Zirak /link jquery+animate
01:20
now we're talking
can we make it do parameters?
like, have the input be something separated by commas
Whadya mean?
let me think of a case where it could be used, one sec
The input argument is a regular expression
GGG
GGG
01:21
it was:
`!Zirak /learn {"name":"link","input":".*","output":"[$0](http://www.google.com/search?btnI=I&q=$0)"}`
oooooooh
So every valid regular expression is valid
@GGG Unexpected token h
@GGG Could not process input. Error: Unexpected token h
GGG
GGG
check that last one
i assume you want to allow markdown
Maybe
!Zirak /learn {"name":"se","input":"^[a-zA-Z]+$","output:"http://$0.stackexchange.com"}
01:23
@Purmou Unexpected token h
@Purmou Could not process input. Error: Unexpected token h
GGG
GGG
wth
!Zirak /lmgtfy regex+only+letters
GGG
GGG
!Zirak /learn {"name":"noun","input":".*","output":"NO U N"}
@GGG Command noun learned
01:24
!Zirak /learn {"name":"se","input":".*","output:"http://$0.stackexchange.com"}
@Purmou Unexpected token h
@Purmou Could not process input. Error: Unexpected token h
what's the unexpected token?
Forgot a " after output
oh wow
fail
!Zirak /learn {"name":"se","input":"^[a-zA-Z]+$","output":"http://$0.stackexchange.com"}
@Purmou Command se learned
01:25
!Zirak /se askubuntu
only works for betas
!Zirak /se gardening
GGG
GGG
!Zirak /learn {"name":"link","input":".*","output":"$0"}
@GGG Unexpected token h
@GGG Could not process input. Error: Unexpected token h
GGG
GGG
01:26
wtf
!Zirak /learn {"name":"meta","input":".*","output:"http://meta.stackoverflow.com"}
gah damn it
@Purmou Unexpected token h
@Purmou Could not process input. Error: Unexpected token h
Should probably do something to notify about wrong custom-command arguments
!Zirak /learn {"name":"meta","input":".*","output":"http://meta.stackoverflow.com"}
@Purmou Command meta learned
!Zirak /meta
GGG
GGG
what is going on with this markdown one
@GGG That markdown contained unescaped " characters
the chat's interpreting it, obviously
or that
!Zirak /nou
@Purmou NO U
GGG
GGG
ahh
so the markdown is converted to html before it's sent over wire?
01:28
can you make a command that lists all the users in the room?
I can, you can't
yeah i meant you specifically lol
can we make the output Javascript
Why would you want that?
...just to have it? :P
Hell no. That's risky as hell
01:30
i ask because a time output would be cool
I can't let you run js in my browser
GGG
GGG
please?
Write the time and user functions yourself, send them to me
you do know i'll fuck it up right? XD
01:31
Here's the command currently in, learn the API from them: github.com/Titani/SO-ChatBot/blob/master/bot.js#L253
GGG
GGG
!Zirak /nou
@GGG NO U
GGG
GGG
!Zirak /nou Zirak
It's simple. Your function receives the @GGG NO U
well gotta rewrite the function
GGG
GGG
01:31
lol
!Zirak /learn {"name":"nou","input":".*","output:"NO U $0"}
@Purmou Unexpected token N
@Purmou Could not process input. Error: Unexpected token N
...
!Zirak /learn {"name":"nou","input":".*","output":"NO U $0"}
@Purmou Command nou learned
GGG
GGG
you keep copypasting that broken one lol
01:32
i know >.<
!Zirak /nou @Zirak
@Purmou NO U @Zirak
It's simple. The command function receives two arguments: Command arguments given in string form and the username. It should return the response, in string form, that'll be replied to the user.
GGG
GGG
can we name the bot !
so commands can just be !!
!Zirak /learn {"name":"lipsum","input":".*","output":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce a dui ut purus congue aliquet nec vel turpis. Mauris vel magna quis urna aliquet tempus. Aliquam vitae arcu ut velit faucibus varius. Cras sit amet turpis non odio accumsan vestibulum. Suspendisse convallis ultrices mattis. Nullam volutpat adipiscing nunc, hendrerit euismod sem adipiscing sed. Cras sit amet interdum massa. In ullamcorper justo et eros viverra vestibulum. Duis facilisis vehicula lectus et varius. Duis eu nulla ligula. Sed at ligula vel ante tincidunt ultricies
(see full text)
this oughta be funny
GGG
GGG
!! /nou
is it lagging or was there an error? XD
!Zirak /lipsum
01:36
@Purmou Invalid command lipsum
Hint: The time command would look something like function () { return new Date().toString(); }
the time one i'm fine with
the users one not really :P
The current users one is simple DOM traversing
exactly
then converting to a list
can we use <br> in the outputs?
or just line breaks?
A br is a line break
GGG
GGG
!Zirak /learn {"name":"help","input":".*","output":"https://github.com/Titani/SO-ChatBot/blob/master/bot.js"}
01:38
@GGG Command help learned
brilliant
but it should return a command list
GGG
GGG
!Zirak /help
GGG
GGG
!Zirak /learn {"name":"learn","input":".*","output":"oh no i can no longer learn"}
@GGG Command learn already exists
@GGG undefined
GGG
GGG
01:39
damn
GGG
GGG
!Zirak /learn {"name":"learn","input":".*","output":"can i learn?"}
@GGG Command learn already exists
@GGG undefined
GGG
GGG
!Zirak /learn
!Zirak /learn {"name":"unlearn","input":".*","output":"Command $0 has been removed from the list of commands."}
01:40
@GGG Unexpected end of input
@GGG Could not process input. Error: Unexpected end of input
@Purmou Command unlearn learned
!Zirak /unlearn learn
@Purmou Command learn has been removed from the list of commands.
B-)
not that it does anything
XD
how can i get elements whose IDs start with a certain string
@Purmou Give them a class and use getElementsByClassName
i can't modify it ;)
wait
maybe it has a class already
one second
GGG
GGG
01:44
!Zirak /link document.getElementById
GGG
GGG
can we make it accept markdown so the link can have a meaningful title =/
@Purmou document.getElementById('present-users'), I trust you from there
i did that already
If you write the markdown parser, sure
01:46
i'm not completely incompetent :P
GGG
GGG
what does it look like when those come through
html?
The link?
GGG
GGG
the json object
or the broken json object or whatever
Of what?
GGG
GGG
not object, text
01:48
I'm confused
GGG
GGG
if i send something like [ blah ] ( url here)
as in a link
do you not just get the markdown on your end?
Nope, you get the html
GGG
GGG
i don't understand why i cant do something like [ $1 ] ( htp://blah/$1 )
damn
with double quoted attribs
{
content: "as in <a href="http://www.google.com" rel="nofollow">a link</a>"
event_type: 1
id: 4339122
message_id: 2209474
room_id: 17
room_name: "JavaScript"
time_stamp: 1324950549
user_id: 886931
user_name: "GGG"
}
GGG
GGG
can we just convert double to single quotes or something <_<
01:51
Sure
GGG
GGG
@Purmou you got this?
got what?
i'm working on the active users thing
GGG
GGG
aww
it's coming along fantastically
[].map.call( document.getElementById('present-users').getElementsByClassName('user-gravatar32'), function ( img ) { return img.title; })
Here's a list of active users
Each image has a class of user-gravatar32 and the username is stored in the title attribute
Simple enough
01:56
man seriously
i was getting all critical ;.;
woops, sorry
i have a toooooon to learn
The [].map.call part is a bit hackity hack
Rest is simple enough

« first day (437 days earlier)      last day (4736 days later) »