Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 alice. $+ %t www.pandorabots.com 80
- 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: www.pandorabots.com
- 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 }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement