« first day (160 days earlier)      last day (2915 days later) » 

1:16 AM
@epictck HI
@epicTCK wassup
YAS
it didnt break
 
 
18 hours later…
7:34 PM
ohai
 
hey
ok lemme set it up
ug
im missing a semicolon somewhere ...
 
code?
 
How to get help on this bot?
 
@epicTCK pls post teh codez
 
getting it rn
all the tabs messed up
or spaces..
but here it is:
 
7:38 PM
TABS FTW
 
tabs are now spaces. fixed.
but stilll missing semicolon
 
found it
not a semicolon
function getXKCD(number){

var link = "http://dynamic.xkcd.com/api-0/jsonp/comic/"+
number+"?callback=gotcha";
var script = document.createElement("script");
script.src = link;
var head *=* document.getElementsByTagName("head")[0];
head.appendChild(script);
return;
}
The asteriks.
 
You need the = sign.
 
ninja'd
 
7:43 PM
ninj'aed
ninja ninj'aed
And you didn't define start.
 
Nope, I ninja'd by getting there first :)
 
@epicTCK
@zyabin101 yeah, but i ninj'aed your ninja and called it.
 
right thanks
 
WHAT
 
start() should be startBot().
 
7:44 PM
NOT XKCD
xkcd
**
 
yes yes
 
ok it started ping it and say xkcd with a number
 
WHY DO YOU HARDLINK TO XKCD?????????????????
IT FRIGGING ONEBOXES
 
?
 
7:46 PM
function getXKCD(number){

  var link = "https://xkcd.com/" + String(number);
  console.log(link)
  var script = document.createElement("script");
  script.src = link;
  var head = document.getElementsByTagName("head")[0];
  head.appendChild(script);
  return;
}
try that.
 
no, im getting json
 
because i want to autopost an xkcd picture
just try it its running
 
xkcd 1
 
no ping me
 
7:47 PM
@epicTCK xkcd 1
 
@epicTCK xkcd 1
 
hmmm
 
Damn, ninja'd.
 
@epicTCK XKCD 1
 
7:48 PM
oh got it
you had the lowercase one checking for XKCD, not xkcd.
 
YAS
yeah im fixing just a sec
 
DUDE
Stahp with the global variable scope awfulness
that is painful to read
 
?
i only have like 3 globals...
 
Tooo many.
Return variable, don't reassign them in functions.
 
return where?
i always do except on the asynch callback
you are either banging your head because you were 100% wrong or because i have know idea what I am talking about
which one is it
honestly you can tell me I have no clue (Because I probobly don't have a clue)
 
7:53 PM
When you make the call to the server thingy
Don't assign a variable and return nothing.
Return the information and assign it outside the function like x=foo().
@easterlyirk xkcd 1
 
you mean the gotcha(data) function
 
and the whole server request is stupid.
No offense, but why do that???
 
how?
 
Why do that? It is just extra complications.
 
b/c I want to get XKCD from an api.... and thats how you do it.
 
7:56 PM
Why from the api though?
 
b/c how else?
derp
 
Watch the gif that i post in ~ 2 min.
 
b/c with the api I can get title text, transcript, and alt text
otherwise i only get a picture
 
The onebox auto does all that btw.
@epicTCK hover over the above image.
 
eventually i will make it get xkcd by keyword
 
7:57 PM
 
the onebox doesnt get title or transcript
 
Watch that.
It auto-oneboxes with everythinig.
SE does that already.
>.<
This code works:
function chat(msg) {
	document.getElementById('input').value = msg.replace(/<\/?i>/g, "*").replace(/<\/?b>/g, "**");
	document.getElementById("sayit-button").click();
}

function getMessage(number) {
	var messages = document.getElementsByClassName("content");
	var message = messages[messages.length - number].innerHTML;
	return message;
}

function loop() {
	var message = getMessage(1);
	var messageL = message.toLowerCase();
	do {
		if (message === getMessage(2) || !messageL.includes("@easterlyirk")) {
 
but doesnt return title
 
Why do you need the text itself?
You just want it on the message, correct?
 
why not?
 
8:00 PM
Just answer it.
 
because the title adds to the comic
 
Run the bot now, @EasterlyIrk. I want to try it.
 
No.
@zyabin101 gimme a mo
@epicTCK Do you want the title.
Please bear with me.
 
why not?
 
NIOOOOOASDJIUCQBW
YES OR NO
fine
try typing https://xkcd.com/1 and sending that message.
 
8:01 PM
your way is like ~5 lines less. Im not golfing this thing. Yes, ur way is simpler.
 
It auto-oneboxes with the title text and everything.
 
@EasterlyIrk xkcd 1
 
not running
 
hmmm
 
3 mins ago, by Easterly Irk
user image
watch the gif
it posts the image with the title text!!!!
roll over it.
wait what?
That was not the bot, that was me.
 
8:04 PM
whatever. my way is future-proof and doesn't rely on the onebox. it works though....
 
The SE api does exactly what you are doing.
 
ill make a vote in TNB on which way is best because IDK
 
So you don't need to.
 
ok anyway lets test it @zyabin101
just ping me with and then say xkcd <number>
 
@epicTCK xkcd 1
 
8:09 PM
try now
srry
@zyabin101
 
@epicTCK xkcd 1
 
\o/
 
try something other than one....
like 1600
 
@epicTCK xkcd 1600
 
8:10 PM
guess not
hmm
k try now
 
xkcd 160
@epicTCK xkcd 1600
 
YAS
 
that took a while.
 
try again itll probobly be faster. Max 6 seconds though depending on the JSON/ onebox response time
its on a 6 second loop. Ill shorten that though
@epicTCK xkcd 234
@epicTCK xkcd 42
@epicTCK xkcd hello
@epicTCK xkcd cheese
@epicTCK xkcd glsadkjsdklfj''sdafkl
hmm
@epicTCK xkcd 5
@epicTCK xkcd 7
@epicTCK xkcd 1618
hmm
@epicTCK xkcd 165
 
8:44 PM
@epicTCK 15314
 
9:24 PM
wut?
 

« first day (160 days earlier)      last day (2915 days later) »