Artificial Intelligence

By uneek on Apr 21, 2009

Artificial intelligence bot written by Chessnut on another forum. I thought it should be shared here, it is a fun little script. Looks like he is a member here, but hasn't posted in a few years, so if you don't want this posted please let me know.

You can change $chan to $nick if you want it to PM that person, instead of the channel.

Also, I set the timer to 7 seconds as a personal preference, you can remove it if you want.

Just talk and it will respond to you. Will also keep your place in the conversation if you get disconnected or stop talking for a while.

Have fun!

Link to original script, posted in 2006.

http://forum.swiftirc.net/viewtopic.php?f=34&t=11545&hilit=artificial+intelligence
on *:text:*:*:{
  var %t $ticks
  sockopen alice. $+ %t www.pandorabots.com 80
  sockmark alice. $+ %t $mid($md5($address($chan,2)),16) $chan $regsubex($1-,/([^\w])/Sg,$+(%,$base($asc(\1),10,16,2)))
}

on *:sockopen:alice.*:{
  tokenize 32 $sock($sockname).mark
  var %u $+(&botcust2=,$1&input=,$3)
  sockwrite -n $sockname POST /pandora/talk?botid=f5d922d97e345aa1&skin=custom_input HTTP/1.1
  sockwrite -n $sockname Host: www.pandorabots.com
  sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
  sockwrite -n $sockname Content-Length: $len(%u .)
  sockwrite -n $sockname $crlf %u
}

on *:sockread:alice.*:{
  if (!$sockerr) {
    var %s
    $event %s
    if $regex(%s,^.*<em>(.*?)<\/em><\/b>$) {
      timer 1 7 msg $gettok($sock($sockname).mark,2,32) $regml(1)
      sockclose $sockname
    }
  }
}

Comments

Sign in to comment.
bone282   -  Apr 24, 2009

The site seems to time out a lot, its not the bot doing it is it? Maybe its the timer?
It's the site.

 Respond  
uneek   -  Apr 22, 2009

Haha yea me too! I believe it took the creator of the Alice bot 3 years to write the original code for it!

 Respond  
Aucun50   -  Apr 22, 2009

I like the idea although scripting this without using a socket would be something to see.

 Respond  
PATX   -  Apr 22, 2009

Kriby: ah ok thats what i though.

/me goes to chnage above comment.

dma  -  Aug 19, 2016

TYPEO^

Sign in to comment

Prelude   -  Apr 22, 2009

:)

 Respond  
Jonesy44   -  Apr 22, 2009

No sarcasm, just a warning :)

 Respond  
Prelude   -  Apr 22, 2009

ROFL here we go again, ppl apparently can not read. (well i cant spell so, we all have our flaws)

I'd keep quiet about the fact this isn't yours. For some ridiculous reason, it's not allowed here.

God i hope that was sarcasm If not you clearly miss the point and It should be fairly obvious by now, on that note maybe hawkee should add a ''YOU Aught TO KNOW'' section and just allow ppl to post super cool leet code and full scripts they WANT to post here but can't cause its rippin'ETC. That way no one has to worry about rating and flames and shíít.

 Respond  
uneek   -  Apr 21, 2009

Eh I don't know. I was told I could post it here, if it is against the rules then it should be deleted. I thought it was a cool little script that someone might enjoy :D

 Respond  
guest598594   -  Apr 21, 2009
 Respond  
Kirby   -  Apr 21, 2009

PATX said:

reason: do not really get it... are you supposed to just talk to the bot and it will
The bot auto-responds to whatever you say in the channel, since it's a varied text event (hence the on :text::*:{).
In which case, if you have a relatively active channel, the bot will lag, which is not good.

 Respond  
PATX   -  Apr 21, 2009

rating: 5 (average)
reason: ok... now that i see what the point of this is. i can say that it is pretty cool. nice use of sockets. but as kirby said in a crouded channel it would flood/lag. good script other than that. :)

 Respond  
PATX   -  Apr 21, 2009

jonest44: as slacker said:

"Your snippet will be deleted if you break any of the following rules:

Snippet needs to be tested and functional.
Introduction must describe what the snippet does and how it is used.
At least 25% of the code must be written by you.
If you used somebody else's snippet you must include a URL to the original.
You may not post an updated snippet separately, you need to edit your first post."

so yeah it is. he he included a url to the original post.

 Respond  
Jonesy44   -  Apr 21, 2009

I'd keep quiet about the fact this isn't yours. For some ridiculous reason, it's not allowed here.

 Respond  
uneek   -  Apr 21, 2009

Cool uneek :) I have a script like this that also uses pandorabots.com. Good job getting it to work. It took me weeks, way back when, to get mine to work.

Oh yea Lawnmower? Did you post it on swiftirc or here? I tried to edit it to get it to worth with the Irene ai bot, because she seemed a bit more vulgar :P But I couldn't figure it out, as I am still very novice when it comes to sockets and getting the right html information copied over.

Also, I put the original link in, as I see it is part of the rules.

 Respond  
Jonesy44   -  Apr 21, 2009

If you have the time to write an entire AI hash file, go for it. But i think the time delay from a socket is acceptable as it makes it more "realistic"

 Respond  
Kirby   -  Apr 21, 2009

In my opinion, sockets are not the best way to produce AI in bots. =/
Hashes + regex would probably be the best.

 Respond  
slacker   -  Apr 21, 2009

Your snippet will be deleted if you break any of the following rules:

Snippet needs to be tested and functional.
Introduction must describe what the snippet does and how it is used.
At least 25% of the code must be written by you.
If you used somebody else's snippet you must include a URL to the original.
You may not post an updated snippet separately, you need to edit your first post.

 Respond  
xero_art   -  Apr 21, 2009

there a way to reset the conversation?

 Respond  
FordLawnmower   -  Apr 21, 2009

Cool uneek :) I have a script like this that also uses pandorabots.com. Good job getting it to work. It took me weeks, way back when, to get mine to work.

 Respond  
uneek   -  Apr 21, 2009

The site seems to time out a lot, its not the bot doing it is it? Maybe its the timer?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.