Pandora Bot

By ^WeSt on May 16, 2015

Requested for: Wikked

Contact: http://westor.ucoz.com/contact

Credits to: Wikked


Description:

In order to work you must enable the module (!pandora on) but you must be an channel operator/moderator (@) into the channel,
this module will allow the bot to response on every message that someone say into the channel, also you can set and delay response via (!pandoradelay SECS). it is multi channel support.


Commands (On the channel):

!Pandora ON/OFF = This will enable/disable the module into the channel.

!PandoraDelay SECONDS = This will change the delay bot response per message.


  • Thanks
ON *:TEXT:*:#: { ; by westor
  tokenize 32 $strip($1-)
  if ($1 == !pandora) {
    if ($nick !isop $chan) { .msg $chan ( $+ $nick $+ ): Error, You are not an channel moderator! | return }
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an option! | return }
    if ($2 == ON) {
      if (%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already enabled for this channel! | return }
      else { 
        set %pandora_ [ $+ [ $chan ] ] 1 
        .msg $chan ( $+ $nick $+ ): You have enabled the Pandora Bot for this channel.
      }
    }
    if ($2 == OFF) {
      if (!%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already disabled for this channel! | return }
      else { 
        unset %pandora_ [ $+ [ $chan ] ]
        .msg $chan ( $+ $nick $+ ): You have disabled the Pandora Bot for this channel.
      }
    }
  }
  if ($1 == !pandoradelay) {
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an number! | return }
    if ($2 !isnum) { .msg $chan ( $+ $nick $+ ): Error, Please specify only numbers! | return }
    if ($2 == %pandora_ [ $+ [ $chan ] $+ ] _delay) { .msg $chan ( $+ $nick $+ ): Error, Please use an other number and NOT the same with now! | return }
    set %pandora_ [ $+ [ $chan ] $+ ] _delay $2
    .msg $chan ( $+ $nick $+ ): The Pandora Bot delay has been changed to $2 second(s).
  }
  else {
    if (!%pandora_ [ $+ [ $chan ] ]) { return }
    if (%pandora_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] $+ ] _say == $1-) { return }
    set -eu6 %pandora_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] $+ ] _say $1-
    var %t = $ticks $+ $ctime $+ $rand(1,100000000000)
    sockopen -e alice. $+ %t www.pandorabots.com 443
    sockmark alice. $+ %t $mid($md5($address($chan,2)),16) $chan $nick $regsubex($1-,/([^\w])/Sg,$+(%,$base($asc(\1),10,16,2)))
  }
}

on *:sockopen:alice.*: {
  if ($sockerr) { .msg $gettok($sock($sockname).mark,2,32) ( $+ $gettok($sock($sockname).mark,3,32) $+ ): Error, The Pandora Bot had an connection open problem! | return }
  tokenize 32 $sock($sockname).mark
  var %u = $+(&botcust2=,$2&input=,$4)
  sockwrite -n $sockname POST /pandora/talk?botid=f5d922d97e345aa1&skin=custom_input HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  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) { .msg $gettok($sock($sockname).mark,2,32) ( $+ $gettok($sock($sockname).mark,3,32) $+ ): Error, The Pandora Bot had an connection reading problem! | return }
  var %s
  sockread %s
  if ($regex(%s,^.*<em>(.*?)<\/em><\/b>$)) {
    var %ch = $gettok($sock($sockname).mark,2,32)
    var %nick = $gettok($sock($sockname).mark,3,32)
    var %sec = $iif(%pandora_ [ $+ [ %ch ] $+ ] _delay,$v1,5)
    var %msg = $regml(1)
    var %md5 = $md5(%msg)
    .timer.AI. $+ %ch $+ . $+ %md5 1 %sec .msg %ch  $+ %nick $+ : %msg
    sockclose $sockname
  }
}

ON *:PART:#: { 
  if ($nick == $me) { .timer.AI. $+ $chan $+ .* off }
}

Comments

Sign in to comment.
Charmer   -  Mar 30, 2021

Pandora bot not work or responds any more ..why ?

^WeSt  -  Apr 07, 2021

pandorabots website has closed their free service.

RIP

Sign in to comment

RIcko   -  Sep 09, 2018

Thanks, looks well written.

 Respond  
Somsubhra1   -  Jan 29, 2016

I use it and it's a nice script. It would have been better if there was a facility which would make the bot stop talking without the "!pandora off" like "Shut up". Also the bot replies too much and to every sentence. It would have been better if it spoke out once in a while i.e. sometimes and prevented channel spamming.

 Respond  
dma   -  Nov 22, 2015

how can i change the color of the text? get back to me DMA

 Respond  
dma   -  Nov 06, 2015

how do i get it started to make it talk

dma  -  Nov 06, 2015

yeah , so i can't get this to work! ;(

^WeSt  -  Nov 15, 2015

Read the description ->>>>>>> !Pandora ON/OFF

dma  -  Nov 16, 2015

ty
i was told not to use it on my network, but i out it in my casino room

Sign in to comment

cptpan   -  Jun 12, 2015

Can you make it so the user it's talking to can say a word to make it STOP talking to them?

The old bot you could say 'shut up' and it would stop talking.

cptpan  -  Jun 12, 2015

Or so that it only talks if you say it's name in the channel? Otherwise it just explodes.

Sign in to comment

cptpan   -  Jun 12, 2015

This is awesome. And it can talk to more than one user at a time.

Good work!

 Respond  
commy   -  May 17, 2015

Just wanted to say this works great. Thanks.

I'm trying to adapt it a bit for my needs, though. I'm trying to get it to send a message to the channel whenever there's a ping from the server.

Instead of using what the person last said as the message sent to pandorabots.com, I'd use a %botmessage var, which I'd set up to just be the last message said in the channel. That part is all well and fine, but I can't figure out how to change this script to utilize that var in the on:ping scenario.

Any help would be appreciated!

 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.