westor

Pandora Bot for Wikked v1.0

May 15th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.76 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 == ON) {
  6.       if (%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already enabled for this channel! | return }
  7.       else {
  8.         set %pandora_ [ $+ [ $chan ] ] 1
  9.         .msg $chan ( $+ $nick $+ ): You have enabled the Pandora Bot for this channel.
  10.       }
  11.     }
  12.     if ($2 == OFF) {
  13.       if (!%pandora_ [ $+ [ $chan ] ]) { .msg $chan ( $+ $nick $+ ): Error, The Pandora Bot is already disabled for this channel! | return }
  14.       else {
  15.         unset %pandora_ [ $+ [ $chan ] ]
  16.         .msg $chan ( $+ $nick $+ ): You have disabled the Pandora Bot for this channel.
  17.       }
  18.     }
  19.   }
  20.   elseif ($1 !== !pandora) {
  21.     if (!%pandora_ [ $+ [ $chan ] ]) { return }
  22.     var %t = $ticks $+ $ctime
  23.     sockopen alice. $+ %t www.pandorabots.com 80
  24.     sockmark alice. $+ %t $mid($md5($address($chan,2)),16) $chan $regsubex($1-,/([^\w])/Sg,$+(%,$base($asc(\1),10,16,2)))
  25.   }
  26. }
  27.  
  28. on *:sockopen:alice.*:{
  29.   tokenize 32 $sock($sockname).mark
  30.   var %u $+(&botcust2=,$1&input=,$3)
  31.   sockwrite -n $sockname POST /pandora/talk?botid=f5d922d97e345aa1&skin=custom_input HTTP/1.1
  32.   sockwrite -n $sockname Host: www.pandorabots.com
  33.   sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
  34.   sockwrite -n $sockname Content-Length: $len(%u .)
  35.   sockwrite -n $sockname $crlf %u
  36. }
  37.  
  38. on *:sockread:alice.*:{
  39.   if (!$sockerr) {
  40.     var %s
  41.     $event %s
  42.     if $regex(%s,^.*<em>(.*?)<\/em><\/b>$) {
  43.       .timer.AI. $+ $r(1,999) 1 7 msg $gettok($sock($sockname).mark,2,32) $regml(1)
  44.       sockclose $sockname
  45.     }
  46.   }
  47. }
Add Comment
Please, Sign In to add comment