Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:PART:#: {
- if ($nick == $me) { .timer[AI_ $+ $chan $+ _*] off | return }
- .timer[AI_ $+ $chan $+ _ $+ $nick $+ ] off
- }
- ON @*:TEXT:*:#: {
- tokenize 32 $strip($1-)
- var %p = $evalnext($+(%,pandora_,$chan))
- var %s = $evalnext($+(%,pandora_,$chan,_,$nick,_say))
- var %d = $evalnext($+(%,pandora_,$chan,_delay))
- if ($1 == !pandora) {
- if ($nick !isop $chan) { msg $chan ( $+ $bold($nick) $+ ): Error, You are NOT an channel operator! | return }
- if (!$2) { msg $chan ( $+ $bold($nick) $+ ): Error, Please specify an option! | return }
- if ($2 == ON) {
- if (%p) { msg $chan ( $+ $bold($nick) $+ ): Error, The Pandora Bot is already enabled for this channel! | return }
- set %pandora_ $+ $chan 1
- msg $chan ( $+ $bold($nick) $+ ): You have enabled the Pandora Bot for this channel.
- }
- if ($2 == OFF) {
- if (!%p) { msg $chan ( $+ $bold($nick) $+ ): Error, The Pandora Bot is already disabled for this channel! | return }
- set %pandora_ $+ $chan 0
- msg $chan ( $+ $bold($nick) $+ ): You have disabled the Pandora Bot for this channel.
- }
- return
- }
- if ($1 == !pandoradelay) {
- if ($nick !isop $chan) { msg $chan ( $+ $bold($nick) $+ ): Error, You are NOT an channel operator! | return }
- if (!$2) { msg $chan ( $+ $bold($nick) $+ ): Error, Please specify an number! | return }
- if ($2 !isnum) { msg $chan ( $+ $bold($nick) $+ ): Error, Please specify only numbers! | return }
- if ($2 < 3) || ($2 > 300) { msg $chan ( $+ $bold($nick) $+ ): Error, Please a number from 3-300 ! | return }
- if ($2 == %d) { msg $chan ( $+ $bold($nick) $+ ): Error, Please use an other number and NOT the same with now! | return }
- set %pandora_ $+ $chan $+ _delay $2
- msg $chan ( $+ $bold($nick) $+ ): The Pandora Bot delay has been changed from $bold($iif(%d,$v1,5)) to $bold($2) second(s).
- return
- }
- if (!%p) || (%s == $1-) { return }
- set -eu6 %pandora_ $+ $chan $+ _ $+ $nick $+ _say $1-
- var %t = $ticks $+ $ctime $+ $rand(1,100000000000)
- sockopen -e pandora_ $+ %t www.pandorabots.com 443
- sockmark pandora_ $+ %t $nick $chan $1-
- }
- ON *:SOCKOPEN:pandora_*: {
- if ($sockerr) {
- msg $gettok($sock($sockname).mark,2,32) ( $+ $bold($gettok($sock($sockname).mark,1,32)) $+ ): Error, The Pandora Bot had an connection problem!
- return
- }
- var %t = $+(&botcust2=,$gettok($sock($sockname).mark,1,32),&input=,$urlencode($gettok($sock($sockname).mark,3-,32)))
- sockwrite -nt $sockname POST /pandora/talk?botid=a847934aae3456cb HTTP/2.0
- sockwrite -nt $sockname Host: $sock($sockname).addr
- sockwrite -nt $sockname Cache-Control: no-cache
- sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded
- sockwrite -nt $sockname Content-Length: $len(%t)
- sockwrite -nt $sockname $crlf %t
- }
- ON *:SOCKREAD:pandora_*: {
- if ($sockerr) {
- msg $gettok($sock($sockname).mark,2,32) ( $+ $bold($gettok($sock($sockname).mark,1,32)) $+ ): Error, The Pandora Bot had an connection reading problem!
- return
- }
- var %r
- sockread %r
- if (*<font size* iswm %r) && (*</font>* iswm %r) {
- var %n = $gettok($sock($sockname).mark,1,32)
- var %c = $gettok($sock($sockname).mark,2,32)
- var %s = $iif(%pandora_ [ $+ [ %c ] $+ ] _delay,$v1,5)
- var %m = $nohtml(%r)
- .timer[AI_ $+ %c $+ _ $+ %n $+ ] 1 %s .msg %c $bold(%n) $+ : %m
- sockclose $sockname
- }
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
- alias -l nohtml { return $regsubex($1-, /<[^>]+(?:>|$)|^[^<>]+>/g,) }
- alias -l urlencode { return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2)) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement