Advertisement
westor

Pandora Bot for Wikked v1.1

May 15th, 2015
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.95 KB | None | 0 0
  1. ON *:TEXT:*:#: { ; by westor
  2.   tokenize 32 $strip($1-)
  3.   if ($1 == !pandora) {
  4.     if ($nick !isop $chan) { .msg $chan ( $+ $nick $+ ): Error, You are not an channel moderator! | return }
  5.     if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an option! | return }
  6.     if ($2 == ON) {
  7.       if (%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already enabled for this channel! | return }
  8.       else {
  9.         set %pandora_ [ $+ [ $chan ] ] 1
  10.         .msg $chan ( $+ $nick $+ ): You have enabled the Pandora Bot for this channel.
  11.       }
  12.     }
  13.     if ($2 == OFF) {
  14.       if (!%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already disabled for this channel! | return }
  15.       else {
  16.         unset %pandora_ [ $+ [ $chan ] ]
  17.         .msg $chan ( $+ $nick $+ ): You have disabled the Pandora Bot for this channel.
  18.       }
  19.     }
  20.   }
  21.   if ($1 == !pandoradelay) {
  22.     if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an number! | return }
  23.     if ($2 !isnum) { .msg $chan ( $+ $nick $+ ): Error, Please specify only numbers! | return }
  24.     if ($2 == %pandora_ [ $+ [ $chan ] $+ ] _delay) { .msg $chan ( $+ $nick $+ ): Error, Please use an other number and NOT the same with now! | return }
  25.     set %pandora_ [ $+ [ $chan ] $+ ] _delay $2
  26.     .msg $chan ( $+ $nick $+ ): The Pandora Bot delay has been changed to $2 second(s).
  27.   }
  28.   elseif ($1 !== !pandora) && ($1 !== !pandoradelay) {
  29.     if (!%pandora_ [ $+ [ $chan ] ]) { return }
  30.     var %t = $ticks $+ $ctime
  31.     sockopen alice. $+ %t www.pandorabots.com 80
  32.     sockmark alice. $+ %t $mid($md5($address($chan,2)),16) $chan $nick $regsubex($1-,/([^\w])/Sg,$+(%,$base($asc(\1),10,16,2)))
  33.   }
  34. }
  35.  
  36. on *:sockopen:alice.*: {
  37.   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 }
  38.   tokenize 32 $sock($sockname).mark
  39.   var %u $+(&botcust2=,$2&input=,$4)
  40.   sockwrite -n $sockname POST /pandora/talk?botid=f5d922d97e345aa1&skin=custom_input HTTP/1.1
  41.   sockwrite -n $sockname Host: www.pandorabots.com
  42.   sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
  43.   sockwrite -n $sockname Content-Length: $len(%u .)
  44.   sockwrite -n $sockname $crlf %u
  45. }
  46.  
  47. on *:sockread:alice.*: {
  48.   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 }
  49.   var %s
  50.   sockread %s
  51.   if $regex(%s,^.*<em>(.*?)<\/em><\/b>$) {
  52.     var %ch = $gettok($sock($sockname).mark,2,32)
  53.     var %nick = $gettok($sock($sockname).mark,3,32)
  54.     var %sec = $iif(%pandora_ [ $+ [ %ch ] $+ ] _delay,$v1,5)
  55.     .timer.AI. $+ %ch $+ . $+ $rand(1,10000) 1 %sec msg %ch  $+ %nick $+ : $regml(1)
  56.     sockclose $sockname
  57.   }
  58. }
  59.  
  60. ON *:PART:#: {
  61.   if ($nick == $me) { .timer.AI. $+ $chan $+ .* off }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement