Advertisement
Ford

Pandoras talking bot (test edit)

Nov 12th, 2012
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 9.67 KB | None | 0 0
  1. ;Pandora's talking Bot Script by Ford_Lawnmower -- irc.GeekShed.net #Script-Help
  2. On *:Text:*:#: {
  3.   if ($hget(Pandora,$+($network,$chan))) {
  4.     var %text $strip($1-)
  5.     if ($me isin %text) { hadd Pandora $+($network,$chan) $puttok($hget(Pandora,$+($network,$chan)),$wildsite,6,32) }
  6.     if (shutup isin %text) && ($nick isop $chan || $gettok($hget(Pandora,$+($network,$chan)),6,32) == $wildsite) {
  7.       .msg $chan I will not be silenced forever :P
  8.       hadd Pandora $+($network,$chan) $puttok($hget(Pandora,$+($network,$chan)),0,6,32)
  9.       return
  10.     }
  11.     if ($gettok($hget(Pandora,$+($network,$chan)),6,32) == $wildsite) {
  12.       var %sockname $+(pandora,$nick,$ticks,$r(1,1000))
  13.       sockopen %sockname $gettok($hget(Pandora,$+($network,$chan)),1,32) 80
  14.       sockmark %sockname $+($chan,,04<,07,$nick,04>) $fixurl($wildsite) $fixurl($replace(%text,$me,$gettok($hget(Pandora,$+($network,$chan)),5,32))) $hget(Pandora,$+($network,$chan))
  15.     }
  16.   }
  17. }
  18. On *:Action:$(* $+ $me $+ *):#: {
  19.   if ($nick !isreg $chan) {
  20.     var %sockname $+(pandora,$nick,$ticks,$r(1,1000))
  21.     sockopen %sockname $gettok($hget(Pandora,$+($network,$chan)),1,32) 80
  22.     sockmark %sockname $+($chan,,04<,07,$nick,04>) $fixurl($wildsite) $fixurl($replace($strip($1-),$me,$gettok($hget(Pandora,$+($network,$chan)),5,32))) $hget(Pandora,$+($network,$chan))
  23.   }
  24. }
  25. On *:Sockopen:Pandora*: {
  26.   if (!$sockerr) {
  27.     tokenize 32 $sock($sockname).mark
  28.     var %post $+(&custid=,$2,&input=,$3)
  29.     .sockwrite -n $sockname POST $5 HTTP/1.1
  30.     .sockwrite -n $sockname User-Agent: Opera 9.6
  31.     .sockwrite -n $sockname Host: $4
  32.     .sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
  33.     .sockwrite -n $sockname Content-Length: $calc($len(%post) + 1)
  34.     .sockwrite -n $sockname $crlf %post
  35.   }
  36. }
  37. On *:Sockread:Pandora*: {
  38.   if ($sockerr) { echo -at >sockerror Pandora< }
  39.   else {
  40.     var %pandora | sockread %pandora
  41.     if ($between(%pandora,$gettok($sock($sockname).mark,6,32),$gettok($sock($sockname).mark,7,32),1)) {
  42.       var %ifmatch $regsubex($replace($replace($ifmatch,&quot;,",&lt;,<,&gt;,>),<em>,$chr(2),</em>,$chr(2),robot,woman),/(<[^<]*>)/g,$null)
  43.       if (%ifmatch != I will pass it along to my botmaster. && Your IP address !isin %ifmatch) {
  44.         .timer $+ $+(PD,$network,$gettok($sock($sockname).mark,1,32)) 1 2 .msg $replace($gettok($sock($sockname).mark,1,32),,$chr(32)) $httpstrip($remove(%ifmatch,www dot pandorabots dot com pandora talk botid,$&
  45.           I will pass it along to my botmaster.,demo vhost pandorabots dot com pandora talk botid))
  46.         sockclose $sockname
  47.       }
  48.     }
  49.   }
  50. }
  51. On *:Sockwrite:Pandora*: {
  52.   if ($sockerr) {
  53.     echo -at Pandoras Site is Currently overloaded - $sockerr
  54.     return
  55.   }
  56. }
  57. On *:Start: {
  58.   hmake Pandora
  59.   if ($exists(Pandora.hsh)) { hload Pandora Pandora.hsh }
  60. }
  61. On *:Exit: {
  62.   if ($hget(Pandora)) {
  63.     hsave Pandora Pandora.hsh
  64.     hfree Pandora
  65.   }
  66. }
  67. menu nicklist {
  68.   $iif(!$hget(Pandora,$+($network,$chan)),$style(2)) Pandora
  69.   .Set the focus of $gettok($hget(Pandora,$+($network,$chan)),5,32) on $$1: {
  70.     if (!$address($$1,2)) { who $$1 }
  71.     hadd Pandora $+($network,$chan) $puttok($hget(Pandora,$+($network,$chan)),$address($$1,2),6,32)
  72.     echo -a Focus switched to $$1
  73.   }
  74. }
  75. ;Testing focus on join
  76. on *:join:#: {
  77.   if ($hget(Pandora,$+($network,$chan)) && $nick != $me) {
  78.     hadd Pandora $+($network,$chan) $puttok($hget(Pandora,$+($network,$chan)),$address($nick,2),6,32)
  79.   }
  80. }
  81. menu channel {
  82.   $iif($hget(Pandora,$+($network,$chan)),$style(1)) Pandora
  83.   .$iif($hget(Pandora,$+($network,$chan)),$style(1)) Select Bot for $chan:DialogOpen $+(botselect,$network,$chan) botselect
  84.   .$iif(!$hget(Pandora,$+($network,$chan)),$style(2)) Bot Off for $chan:hdel Pandora $+($network,$chan) | echo -at Pandora is deactivated for $chan
  85.   .Use bot from botid: {
  86.     var %botname $$?"Enter Your Bots Name"
  87.     if (%botname) { var %botid $$?"Enter Your Bots ID" }
  88.     if (%botname) && (%botid) {
  89.       hadd -m Pandora $+($network,$chan) www.pandorabots.com $+(/pandora/talk-xml?botid=,%botid) <that> </that> $replace(%botname,$chr(32),_) 0
  90.       echo -a The Bot %botname %botid has been started on $chan
  91.     }
  92.   }
  93. }
  94. dialog -l BotSelect {
  95.   title "Pandoras Bot Selection"
  96.   size -1 -1 96 108
  97.   option dbu
  98.   text "Network:", 1, 7 8 25 8, right
  99.   text "Channel:", 2, 7 18 25 8, right
  100.   text "", 3, 35 8 57 8
  101.   text "", 4, 35 18 57 8
  102.   combo 5, 8 30 82 50, sort size vsbar
  103.   radio "On", 6, 24 81 18 10, left
  104.   radio "Off", 7, 48 81 18 10
  105.   button "Close", 8, 61 92 29 12, cancel
  106.   button "Accept", 9, 8 92 29 12
  107. }
  108. On *:dialog:BotSelect*:Sclick:9: {
  109.   if ($did($dname,6).state) {
  110.     hadd -m Pandora $+($did($dname,3).text,$did($dname,4).text) $botinfo($did($dname,5).seltext)
  111.     echo -at $did($dname,5).seltext has been activated for $did($dname,4).text
  112.     if ($dialog($dname)) { dialog -x $dname }
  113.   }
  114.   else { echo -at Bot is turned off for $+($did($dname,4).text,!) If you want to activate pandora, click On. }
  115. }
  116. On *:dialog:BotSelect*:init:*: {
  117.   did -a $dname 3 $network
  118.   did -a $dname 4 $active
  119.   didtok $dname 5 14 LilithObaid(Portuguese)Sara(Spainish)Mathilde(French)Dr DuckHector van DaemonGabi(German-Adault)Eliza(German)Grandma ElaineIncognita
  120.   didtok $dname 5 14 Smoshinator(Rude)Spambot(Rude)AFRObot(Rude)DawnstarWraithRoninChabba(German)LaurieGodAliceFake Kirk
  121.   did -c $dname $iif($hget(Pandora,$+($network,$active)),6,7)
  122.   did -fc $dname 5 $iif($gettok($hget(Pandora,$+($network,$active)),7,32),$didwm($dname,5,$replace($gettok($hget(Pandora,$+($network,$active)),7,32),_,$chr(32))),2)
  123. }
  124. On *:Text:.focus *:?: {
  125.   if ($2 !ischan) || ($3 !ison $2) { .msg $nick Proper syntax is .focus #channel nickname. The channel must exist & the nickname must be on the channel! | return }
  126.   if (!$hget(Pandora,$+($network,$2))) { .msg $nick No bot is turned on for that channel! Please add a bot before changing focus! | return }
  127.   if ($nick !isop $2) { .msg $nick You must be an operator on $2 to change the focus of the bot! | return }
  128.   if ($3 == $me) { .msg $nick You cannot place the focus on me!! I am the bot silly :P | return }
  129.   focus $network $2-
  130.   .msg $nick Focus for $network channel $2 has been changed to $3 at the address $address($3,2)
  131. }
  132. alias focus {
  133.   if ($hget(Pandora,$+($1,$2))) {
  134.     hadd Pandora $+($1,$2) $puttok($hget(Pandora,$+($1,$2)),$address($3,2),6,32)
  135.   }
  136. }
  137. alias -l DialogOpen { dialog $iif($dialog($1),-v,-m) $1- }
  138. alias -l fixurl return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2))
  139. alias -l httpstrip {
  140.   var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove($replace($remove(%x,&nbsp;),&lt;,<,&gt;,>),<br>)
  141.   return %x
  142. }
  143. ;alias by Gummo
  144. alias -l between {
  145.   noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi)
  146.   return $regml($4)
  147. }
  148. alias -l botinfo {
  149.   if ($1- == Alice) { var %return www.pandorabots.com /pandora/talk-xml?botid=f5d922d97e345aa1 <that> </that> Alice 0 }
  150.   elseif ($1- == God) { var %return www.pandorabots.com /pandora/talk-xml?botid=b21f0d757e36f385 <that> </that> God 0 }
  151.   elseif ($1- == Laurie) { var %return www.pandorabots.com /pandora/talk-xml?botid=b800da72be34d5d9 <that> </that> Laurie 0 }
  152.   elseif ($1- == Chabba(German)) { var %return www.pandorabots.com /pandora/talk-xml?botid=9e129a956e3548fd <that> </that> Chabba 0 }
  153.   elseif ($1- == Ronin) { var %return www.pandorabots.com /pandora/talk-xml?botid=d3012a1f2e377a96 <that> </that> Ronin 0 }
  154.   elseif ($1- == Wraith) { var %return www.pandorabots.com /pandora/talk-xml?botid=e2ee8c6c9e377a87 <that> </that> Wraith 0 }
  155.   elseif ($1- == Dawnstar) { var %return www.pandorabots.com /pandora/talk-xml?botid=c1776ae8ce354d1f <that> </that> Dawnstar 0 }
  156.   elseif ($1- == AFRObot(Rude)) { var %return www.pandorabots.com /pandora/talk-xml?botid=9d3dc63c7e34956d <that> </that> AFRObot 0 }
  157.   elseif ($1- == Spambot(Rude)) { var %return www.pandorabots.com /pandora/talk-xml?botid=d3b8db41ee36d42d <that> </that> Spambot 0 }
  158.   elseif ($1- == Smoshinator(Rude)) { var %return www.pandorabots.com /pandora/talk-xml?botid=b4db4c279e3420eb <that> </that> Smoshinator 0 }
  159.   elseif ($1- == Incognita) { var %return www.pandorabots.com /pandora/talk-xml?botid=f7634aec7e3652ed <that> </that> Incognita 0 }
  160.   elseif ($1- == Grandma Elaine) { var %return www.pandorabots.com /pandora/talk-xml?botid=8f02c14a0e34bbe4 <that> </that> Grandma_Elaine 0 }
  161.   elseif ($1- == Eliza(German)) { var %return www.pandorabots.com /pandora/talk-xml?botid=e4fc10b06e3632ef <that> </that> Eliza 0 }
  162.   elseif ($1- == Gabi(German-Adault)) { var %return www.pandorabots.com /pandora/talk-xml?botid=bd81f97c0e354f35 <that> </that> Gabi 0 }
  163.   elseif ($1- == Hector van Daemon) { var %return www.pandorabots.com /pandora/talk-xml?botid=be43a1422e36ad7b <that> </that> Hector_van_Daemon 0 }
  164.   elseif ($1- == Dr Duck) { var %return www.pandorabots.com /pandora/talk-xml?botid=f3b9b50cbe344c44 <that> </that> Dr_Duck 0 }
  165.   elseif ($1- == Mathilde(French)) { var %return www.pandorabots.com /pandora/talk-xml?botid=eff729829e36e89c <that> </that> Mathilde 0 }
  166.   elseif ($1- == Sara(Spainish)) { var %return www.pandorabots.com /pandora/talk-xml?botid=e71c0d43fe35093a <that> </that> Sara 0 }
  167.   elseif ($1- == Obaid(Portuguese)) { var %return www.pandorabots.com /pandora/talk-xml?botid=a29a250aee36f3b3 <that> </that> Obaid 0 }
  168.   elseif ($1- == Lilith) { var %return www.pandorabots.com /pandora/talk-xml?botid=b9b96b247e34f4f2 <that> </that> Lilith 0 }
  169.   elseif ($1- == Fake Kirk) { var %return sheepridge.pandorabots.com /pandora/talk-xml?botid=fef38cb4de345ab1 <that> </that> Fake_Kirk 0 }
  170.   ;http://sheepridge.pandorabots.com/pandora/talk-xml?botid=fef38cb4de345ab1
  171.   return %return $replace($1-,$chr(32),_)
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement