Advanced shoutcast DJ Bot

Introduction

This script enables you to grab information from shoutcast/radio URL . and display them into multiple channels, and it;s also be able to be connected to multi irc servers.This bot is fit with users who are running radio websites, and it's probably the first shoutcast mirc script that capable to get information from 'two' different shoutcast servers at a time. it also has option that can record requested songs from ppl and check if the song has been played or not.
To run it, just simply connected to irc servers and set all required inputs such as shoutcast server/ips,ports. Then when it has been connected just add someone or yourself(with different client) as the owner or dj after updated the IAL. commands will be displayed by typing for.i.e; @help in a channel window where the bot exist which it will display a list of commands according to your status, the higher you status the more complete commands you can access, there are only 3 category of users available i.e owner, dj and regular users.Some commands are included but only apply on dalnet servers that uses chanserv like @up @down for op and deop the bot, and also deop protection but all other commands work in all irc servers. All existing inputs are available just to show how to fill them with your owned datas, however it can be used to test the bot

by:aditya

;----[ Advanced SHOUTcast DJ Bot ]---------------
; Filename. : shoutcast.mrc
; Release...: v1.0 on August 2004
; Author....: m.aditya a.k.a [|Red-X|]
; Location..: Jakarta - Indonesia
; Bugreport.: http://www.hawkee.com/
; E-mail....: m_aditya@kaskus.com
; Two shoutcast servers on Multi Servers/Channels
;------------------------------------------------
;start here
alias connect_ {
if (%shoutcast.currentdj [ $+ [ $cid ] ] == n/a) { unset %shoutcast.currentdj [ $+ [ $cid ] ] }
if (%shoutcast.channel [ $+ [ $cid ] ]) join %shoutcast.channel [ $+ [ $cid ] ]
%shoutcast.pass [ $+ [ $cid ] ] = $+($r(a,z),$r(10001,19999),$r(a,z))
}
alias addsong hadd song $1 $2-
alias delsong hdel song $1
alias hdj hadd dj $+($cid,$1) $2 $3-
alias ddj hdel dj $+($cid,$1)
alias ownercmd return $c(resetserver) - $c(addserver) - $c(dj) [add|del] - $c(up) - $c(down)
alias -l resetcurrentdj if (%shoutcast.currentdj [ $+ [ $1 ] ] == n/a) { unset %shoutcast.currentdj [ $+ [ $1 ] ] }
alias web return $iif($1,$+(http://,$1,:,$2,/listen.pls),n/a))
alias -l shoutcast.currenttopic return $replace(%shoutcast.channeltopic,,$iif($1,$1,n/a),,$iif($2 == n/a,n/a,$2),,$iif($3,$3,n/a),,$iif($4,$4,n/a),,$iif($5,$5,n/a))
alias -l shoutcast.currentcommand return $replace(%shoutcast.commandformat,,Skn $3 $+  $iif($1 == Listeners,Listeners,$iif($1 == peak,Peak Listeners,$iif($1 == bitrate,Bitrate,$iif($1 == song,Song)))),,$2 $iif($1 == bitrate,Kbps))
alias -l shoutcast.commandformat return :
alias -l shoutcast.channeltopic return - Current DJ: - Server: Website: News:
alias set.shoutcast.method {
if ($2 == dj) { %shoutcast.commscommand [ $+ [ $1 ] ] = $replace(%shoutcast.commandformat,,Commands,, $c(onair) - $c(offair) - $c(addnews) [1|2] - $c(chan) [add|del] ) }
else {
if (%shoutcast.method [ $+ [ $1 ] ] == 1) { %shoutcast.commscommand [ $+ [ $1 ] ] = $replace(%shoutcast.commandformat,,Commands,,$c(radio) $c(stat) $c(server) $c(dj) $c(listeners) $c(peak) $c(song) $c(bitrate) $c(shoutout) $c(request) $c(website) $c(news) $c(msg) $c(help) $c(seen) dj $c(creator)) }
else { %shoutcast.commscommand [ $+ [ $1 ] ] = $replace(%shoutcast.commandformat,,Commands,,$c(server) $c(dj) $c(listeners) $c(peak) $c(song) $c(bitrate) $c(shoutout) $c(request) $c(website) $c(news) $c(msg) $c(help) $c(seen) dj $c(creator)) }
}
if ($isid) return %shoutcast.commscommand [ $+ [ $1 ] ]
}
alias -l set.user.request {
var %x = $var(%shoutcast.server*,0)
var %i = 1, %shoutcast.server.temp [ $+ [ $1 ] ]
while (%i <= %x) {
if ($istok(server@website@news,$2,64)) { %shoutcast.server.temp [ $+ [ $1 ] ] = $addtok(%shoutcast.server.temp [ $+ [ $1 ] ],$iif($2,$+($iif($2 == server,http://),%shoutcast. [ $+ [ $+($2,%i) ] ],$iif($2 == server,$+(:,%shoutcast.port [ $+ [ %i ] ],/listen.pls)))),45) }
inc %i
}
if ($istok(server@website@news,$2,64)) { %request.command [ $+ [ $1 ] ] = $replace(%shoutcast.commandformat,,$2,,%shoutcast.server.temp [ $+ [ $1 ] ]) }
else { %request.command [ $+ [ $1 ] ] = $replace(%shoutcast.commandformat,,$iif($istok(shoutout@request,$2,64),$+($2,$chr(32),from,$chr(32),$3),$2),,$iif($istok(shoutout@request,$2,64),$iif($4,$4-,n/a),$iif($var($+(%,shoutcast.,$2,$1),1).value == n/a,n/a,$var($+(%,shoutcast.,$2,$1),1).value))) }
}
alias -l ctrigger {
var %s1 = $gettok($1,-1,46)
if (stat == %s1) { return Status:  $+ $iif($2 == 0,Stream down,Stream Active) Current/Peak/Max.Listeners: $+($3,/,$4,/,$5) Current Song: $7- Bitrate: $6  }
elseif (listeners == %s1) { var %shoutcast.clisteners = $+(%shoutcast.listeners. [ $+ [ $2 ] ],$chr(32),with Max.,$chr(32),%shoutcast.maxlisteners. [ $+ [ $2 ] ]) | return $shoutcast.currentcommand(listeners,%shoutcast.clisteners,$3-) }
elseif (peak == %s1) { return $shoutcast.currentcommand(peak,%shoutcast.peak. [ $+ [ $2 ] ],$3-) }
elseif (bitrate == %s1) { return $shoutcast.currentcommand(bitrate,%shoutcast.bitrate. [ $+ [ $2 ] ],$3-) }
elseif (song == %s1) { return $shoutcast.currentcommand(song,%shoutcast.song. [ $+ [ $2 ] ],$3-) }
}
alias -l reguestchan {
if (%reg.chan [ $+ [ $2 ] ]) { %t.chan = %reg.chan [ $+ [ $2 ] ] }
var %n = $var(%shoutcast.server*,0), %cz = $chan(0)
while (%n) {
%s = $var(%shoutcast.server*,%n).value
if ($var($+(%,$1,.,$2,%t.chan,%s),1).value != $null) { return $ifmatch }
dec %n
}
}
alias sockconnect {
set %nsite $var($+($chr(37),shoutcast,.,server,*),0)
while (%nsite) {
var %a = $var($+($chr(37),shoutcast,.,server,*),%nsite).value, %b = $var($+($chr(37),shoutcast,.,port,%nsite),1).value, %s = $+(shoutcast,.,%a,.,$cid,.,$1)
if ($sock(%s).to < 10) { .notice $2 connected to %a can not be proceed..previous request under processing.. | break }
elseif (%a) && (%b) && (%s) { echo -s -14 $+ $timestamp connecting to %a $+ : $+ %b | sockclose %s | sockopen %s %a %b }
if ($2 == auto) set %autoserve [ $+ [ $+($cid,%a) ] ] ok
dec %nsite
}
}
alias -l current.topic {
var %i = $var(%shoutcast.currenttopic*,0), %shoutcast.currenttopic.temp
while (%i) {
%shoutcast.currenttopic.temp = $addtok(%shoutcast.currenttopic.temp,%shoutcast.currenttopic [ $+ [ %i ] ],151)
dec %i
}
return $addtok(Welcome to..,%shoutcast.currenttopic.temp,58)
}
alias -l setcurrent.topic {
var %x = $var(%shoutcast.server*,0)
while (%x) {
%shoutcast.currenttopic [ $+ [ %x ] ] = $shoutcast.currenttopic(%shoutcast.name [ $+ [ %x ] ],%shoutcast.currentdj [ $+ [ $1 ] ],$web(%shoutcast.server [ $+ [ %x ] ],%shoutcast.port [ $+ [ %x ] ]),%shoutcast.news [ $+ [ %x ] ],%shoutcast.website [ $+ [ %x ] ])
dec %x
}
}
alias -l reportallchan {
scid $1
var %i = $chan(0)
while (%i) {
if ($istok(%shoutcast.channel [ $+ [ $1 ] ],$chan(%i),44)) msg $chan(%i) $2-
dec %i
}
scid -r
}
alias -l cmd return dj!website!server!commands!news!shoutout!request!stat!listeners!peak!bitrate!song!onair!offair!addnews!chan!resetserver!addserver!restart!msg!radio!help!creator!up!down!seen
alias -l c return $+(%shoutcast.trigger,$1)
alias shoutcast.version return Advanced SHOUTcast DJ Bot
alias -l restart run mirc.exe | exit
on !*:join:$(%shoutcast.channel [ $+ [ $cid ] ]): {
if (!%onjoin [ $+ [ $cid ] ]) {
set -u5 %onjoin [ $+ [ $cid ] ] !
if ($level($address($nick,0)) == asdj) {
hdj $nick join $chan $ctime
pvoice 10 $chan $nick
if ($nick == $owner) { .msg $nick 4@Owner welcome... }
if (!$istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) { .msg $nick Hi..4@DJ pls..login to get the bot access | halt }
else { halt }
}
elseif (%ojgreet [ $+ [ $cid ] ] == on) && (!%onjoin. [ $+ [ $+($cid,$chan,$site) ] ]) {
setcurrent.topic $cid
set -u600 %onjoin. [ $+ [ $+($cid,$chan,$site) ] ] !
set.shoutcast.method $cid
if (%ojnotice [ $+ [ $cid ] ] == 1) {
.notice $nick $current.topic
.timernot $+ $cid 1 2 .notice $nick %shoutcast.commscommand [ $+ [ $cid ] ]
}
else { .msg $nick $current.topic | .timermsg $+ $cid 1 2 .msg $nick %shoutcast.commscommand [ $+ [ $cid ] ] }
}
}
}
on !*:part:$(%shoutcast.channel [ $+ [ $cid ] ]): {
if ($nick == $owner) { halt }
hdj $nick part $chan $ctime $1-
if (!%part. [ $+ [ $+($cid,$chan) ] ]) { set -u8 %part. [ $+ [ $+($cid,$chan) ] ] 1 | goto next }
inc %part. [ $+ [ $+($cid,$chan) ] ]
if (%part. [ $+ [ $+($cid,$chan) ] ] >= 3) { halt }
:next | if (%ojgreet [ $+ [ $cid ] ] == on) {
if ($istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) && ($level($address($nick,0)) == asdj) { .msg $nick off4@air? }
else { .msg $nick thanks f4@r visit our room }
}
}
on !*:nick: {
if ($istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) {
%shoutcast.currentdj [ $+ [ $cid ] ] = $reptok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,$newnick,1,43)
hdj $nick nick $newnick $ctime
if ($nick == $owner) { alias owner return $newnick }
if (!%chnick. [ $+ [ $cid ] ]) {
set -u5 %chnick. [ $+ [ $cid ] ] !
setcurrent.topic $cid
var %n = $comchan($newnick,0)
while (%n) {
if ($istok(%shoutcast.channel [ $+ [ $cid ] ],$comchan($newnick,%n),44)) {
if ($comchan($newnick,%n).op) && (%ontopic [ $+ [ $cid ] ] == on) topic $comchan($newnick,%n) $current.topic
else msg $comchan($newnick,%n) $current.topic
}
dec %n
}
}
}
}
on ^*:quit: {
if ($nick == $owner) { goto end }
if ($istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) && (!%quit. [ $+ [ $cid ] ]) {
set -u10 %quit. [ $+ [ $cid ] ] 1
hdj $nick quit $ctime $1-
%shoutcast.currentdj [ $+ [ $cid ] ] = $remtok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,1,43)
echo $color(info2) -at :: $+ $nick left IRC remove4@ $+ $nick from dj4@list done..
}
:end | halt
}
;DJ Login
on ^!*:text:*:?: {
if ($level($address($nick,0)) == asdj) {
if ($left($1,1) != $c) { goto end }
if (%shoutcast.currentdj [ $+ [ $cid ] ] == n/a) { set %shoutcast.currentdj [ $+ [ $cid ] ] }
if ($istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) { .msg $nick you have been logged..no need to re12@login | goto end }
if (%login [ $+ [ $+($cid,$address($nick,0)) ] ] == 3) { .msg $nick you have been 3x login4@failed..sorry. | .ignore -u600 $nick 2 | goto end }
inc -u600 %login [ $+ [ $+($cid,$address($nick,0)) ] ]
if ($1 == $c(login)) && ($2 == %shoutcast.pass [ $+ [ $cid ] ]) {
%shoutcast.currentdj [ $+ [ $cid ] ] = $addtok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)
hdj $nick signed-in $chan $ctime
.msg $nick your login4@accepted
.timersendcmd $+ $cid $+ $nick 1 1 .raw privmsg $nick : $+ $set.shoutcast.method($cid,dj)
goto end
}
elseif ($1 != $c(login)) { .msg $nick wrong4@command...type $c(login) }
elseif ($2 != %shoutcast.pass [ $+ [ $cid ] ]) { .msg $nick wrong4@password. }
}
:end | close -m $nick | halt
}
on ^!*:notice:*:?: { halt }
on ^*:open:?:*: { if ($level($address($nick,0)) != asdj) { .msg $nick no4@message pls..I'm a BOT | close -m $nick | halt } }
on !*:text:*:$(%shoutcast.channel [ $+ [ $cid ] ]):{
if ($left($1,1) != $c) || (!$istok($cmd,$remove($1,$c),33)) { halt }
if (!%triger. [ $+ [ $+($cid,$wildsite) ] ]) && (!%smtrig [ $+ [ $+($cid,$chan) ] ]) { set -u8 %triger. [ $+ [ $+($cid,$wildsite) ] ] 1 | goto next }
if (%smtrig [ $+ [ $+($cid,$chan) ] ]) { tokenize 32 %smtrig [ $+ [ $+($cid,$chan) ] ] | .msg $chan $nick $+ : same request has been asked by $1 $duration($calc($ctime - $2)) ago ..sorry | halt }
inc -u8 %triger. [ $+ [ $+($cid,$wildsite) ] ] | set -u10 %smtrig [ $+ [ $+($cid,$chan) ] ] $nick $ctime
if (%triger. [ $+ [ $+($cid,$wildsite) ] ] >= 3) { .ignore -u10 $nick 2 | .notice $nick to $nick $+ : you've sent too many request in 10 secs ..ignore4@ $+ $nick for 10 secs | halt }
if (%triger. [ $+ [ $+($cid,$wildsite) ] ]) { .msg $chan $nick $+ : plz wait .for 10 secs before sending another comand | halt }
:next
if ($1 == $c(help)) {
if ($level($address($nick,0)) == asdj) && ($nick == $owner) { .msg $nick $set.shoutcast.method($cid,dj) $ownercmd }
elseif ($level($address($nick,0)) == asdj) { .msg $nick $set.shoutcast.method($cid,dj) }
else { msg $nick $set.shoutcast.method($cid) }
goto end
}
if ($1 == $c(dj)) && (!$2) {
.signal -n users $cid currentdj $chan
goto end
}
if ($1 == $c(website)) {
.signal -n users $cid website $chan
goto end
}
if ($1 == $c(server)) {
.signal -n users $cid server $chan
goto end
}
if ($1 == $c(commands)) {
set.shoutcast.method $cid
msg $chan %shoutcast.commscommand [ $+ [ $cid ] ]
if ($istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) && ($nick != $owner) {
.timercomdj $+ $cid $+ $nick 1 3 .msg $nick commands4@for-DJ : $c(onair) - $c(offair) - $c(addnews) [1|2] - $c(chan) [add|del] - $c(radio)
}
goto end
}
if ($1 == $c(news)) {
.signal -n users $cid news $chan
goto end
}
if ($1 == $c(shoutout)) && ($2) {
if (%shoutcast.currentdj [ $+ [ $cid ] ] == n/a) { .notice $nick to $nick $+ : Error: no4@DJ is on air to send shoutout }
else {
%djnick.temp = $gettok(%shoutcast.currentdj [ $+ [ $cid ] ],$rand(1,$numtok(%shoutcast.currentdj [ $+ [ $cid ] ],0)),43)
set.user.request $cid shoutout $nick $2-
.notice $nick to $nick $+ : Your shoutout " $+ $2- $+ " has been sent to %djnick.temp
.raw privmsg %djnick.temp : $+ < $+ $nick $+ > shoutout %request.command [ $+ [ $cid ] ]
}
goto end
}
if ($1 == $c(request)) {
if (!$2) { .notice $nick Syntax Error: type $c(request) | halt }
if (%shoutcast.currentdj [ $+ [ $cid ] ] == n/a) { .notice $nick Alert: No4@DJ is on air to proceed your request. | halt }
else {
if ($hfind(song,$+(*,$remove($2-,$chr(32)),*),1,w)) { %tx = $hget(song,$ifmatch)) | tokenize 32 %tx | .notice $nick to $nick $+ : $ifmatch was broadcasted $duration($calc($ctime - $1)) ago from $2 at $3 plz choose different title }
else {
%djnick.temp = $gettok(%shoutcast.currentdj [ $+ [ $cid ] ],$rand(1,$numtok(%shoutcast.currentdj [ $+ [ $cid ] ],0)),43)
set.user.request $cid request $nick $2-
if (%requestsend [ $+ [ $cid ] ] == 1) { .raw privmsg %djnick.temp : $+ < $+ $nick $+ > %request.command [ $+ [ $cid ] ] | .notice $nick to $nick $+ : Your request " $+ $2- $+ " has been sent. to %djnick.temp }
elseif (%requestlog [ $+ [ $cid ] ] == 1) { requestlog $cid $chan $nick $2- | .notice $nick to $nick $+ : Your request " $+ $2- $+ " has been logged }
goto end
}
}
}
if ($1 == $c(radio)) || ($1 == $c(stat)) || ($1 == $c(listeners)) || ($1 == $c(peak)) || ($1 == $c(bitrate)) || ($1 == $c(song)) {
if ($timer($+(auto,$cid)).secs < 15) .timer $+ $+(auto,$cid) off
if ($1 == $c(stat)) || ($1 == $c(radio)) {
if (!$istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) && (%shoutcast.method [ $+ [ $cid ] ] != 1) { .notice $nick access4@denied to show $remove($1,$c) | goto end }
}
var %r = $remove($1,$c)
if ($var($+(%,%r,.,$cid),1).value != $null) { .notice $nick to $nick $+ : Your request sent too fast..., wait 5 secs to send new request | halt }
set -u5 $+(%,%r,.,$cid) $nick
set %reg.chan [ $+ [ $cid ] ] $chan
if (%shoutcast.server1) set $+(%,%r,.,$cid,$chan,%shoutcast.server1) $chan
if (%shoutcast.server2) set $+(%,%r,.,$cid,$chan,%shoutcast.server2) $chan
sockconnect %r $nick
goto end
}
if ($1 == $c(msg)) {
if (!$2) || (!$3) { .notice $nick to $nick $+ :: did you send shit? | halt }
else {
.raw privmsg $2 : $+ < $+ $nick $+ > $3-
.notice $nick to $nick $+ :: Your message to $2 sent....
goto end
}
}
if ($1 == $c(seen)) && ($2 == dj) && ($3) { if ($level($address($3,0)) == asdj) seennick $chan $nick $3 | else msg $chan $nick $+ : $3 is not in the dj's list }
if ($1 == $c(creator)) { msg $chan -7 $+ $shoutcast.version v1.07- by $maker | goto end }
if ($level($address($nick,0)) == asdj) {
if (!$istok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,43)) {
.msg $nick Access4@Denied
.timer $+ $cid $+ $nick 1 1 .msg $nick Plz relog4@in type in this window -> $c(login)
goto end
}
else {
if ($1 == $c(onair)) {
.signal -n DJs $cid $chan
goto end
}
if ($1 == $c(offair)) {
hdj $nick offair $chan $ctime $1-
%shoutcast.currentdj [ $+ [ $cid ] ] = $reptok(%shoutcast.currentdj [ $+ [ $cid ] ],$nick,$+($nick,[,off,]),1,43)
.signal -n DJs $cid $chan
.msg $nick set4@ [ $+ [ $+($nick,[offair]) ] ] :you nick has been set to $+($nick,[offair]) pls relogin to get access again later
goto end
}
;syntax : for.i.e @addnews [1|2]
;[1|2] means to station1 or 2
if ($1 == $c(addnews)) {
if ($2) && ($3) {
unset %shoutcast.news [ $+ [ $2 ] ]
%shoutcast.news [ $+ [ $2 ] ] = $addtok(%shoutcast.name [ $+ [ $2 ] ],$3-,58)
.signal -n DJs $cid $chan
.notice $nick add4@news to %shoutcast.name [ $+ [ $2 ] ] $+ : $3-
goto end
}
else { .notice $nick syntax error: type $c(addnews) ə|2> | halt }
}
if ($1 == $c(chan)) {
if ($3) {
var %c = $addtok($chr(35),$remove($3,$chr(35)),0)
if ($2 == add) {
%shoutcast.channel [ $+ [ $cid ] ] = $addtok(%shoutcast.channel [ $+ [ $cid ] ],%c,44)
if ($me !ison %c) .timerjoin $+ $cid 1 5 join %c
.notice $nick add4@channel %c joining...
goto end
}
if ($2 == del) {
%shoutcast.channel [ $+ [ $cid ] ] = $remtok(%shoutcast.channel [ $+ [ $cid ] ],%c,1,44)
if ($me ison %c) .timerpart $+ $cid 1 5 part %c ask4@by $nick $iif($4,$4-,-) 7 $+ $shoutcast.version 7- by $maker at www.hawkee.com
.notice $nick del4@channel %c parting...
goto end
}
}
else { notice $nick syntax error: type $c(chan) add|del | halt }
}
if ($nick == $owner) {
if ($1 == $c(resetserver)) {
unset %shoutcast.server* %shoutcast.website* %shoutcast.name* %shoutcast.port* %nr.of.server
msg $chan reset4@server done
goto end
}
;i.e : @addserver merlin.net 8026
if ($1 == $c(addserver)) {
if ($2) && ($3) {
if (%nr.of.server > 2) { .msg $nick plz $c(resetserver) first before added | halt }
inc %nr.of.server
var %s = $remove($2,http://,www.)
set %shoutcast.website [ $+ [ %nr.of.server ] ] $+(http://,www.,%s)
set %shoutcast.name [ $+ [ %nr.of.server ] ] $+(%s,Radio,%nr.of.server,Online)
set $+($chr(37),shoutcast,.,server,%nr.of.server) %s
set $+($chr(37),shoutcast,.,port,%nr.of.server) $3
.msg $nick Station $+ %nr.of.server $+ : $+(%s,Radio,%nr.of.server,Online) Server: %s Port: $3 Website: $+(http://,www.,%s)
goto end
}
else { .msg $nick syntax error: type $c(addserver) | halt }
}
if ($1 == $c(dj)) {
if ($2 == add) && ($3) { .guser asdj $3 0 DJ | .msg $3 add4@DJ your Password: $+ %shoutcast.pass $+ $cid Login: type -> $c(login) }
if ($2 == del) && ($3) { .ruser asdj $3 0 | %shoutcast.currentdj [ $+ [ $cid ] ] = $remtok(%shoutcast.currentdj [ $+ [ $cid ] ],$3,1,43) | .msg $3 remove4@DJ sorry.. }
goto end
}
if (dal.net isin $server) {
if ($1 == $c(up)) && ($me !isop $chan) cs op $chan $me
if ($1 == $c(down)) && ($me isop $chan) { mode $chan +v-o $me $me }
goto end
}
if ($1 == $c(restart)) { restart | halt }
}
}
}
:end
}
on *:SOCKOPEN:$(shoutcast. $+ $+(%shoutcast.server1,*)):{
set -u0 %`t $gettok($sockname,-1,46)
var %cid = $gettok($sockname,-2,46)
if ($sockerr > 0) {
set %shoutcast.errorformat $replace(%shoutcast.commandformat,,Error,,No Connection To Server: $gettok($sockname,2-3,46))
if ($reguestchan($gettok($sockname,-1,46),%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.errorformat }
disp.status %cid 1 %shoutcast.errorformat
return
}
sockident $sockname
}
on *:sockread:$(shoutcast. $+ $+(%shoutcast.server1,*)):{
if ($sockerr > 0) return
:nextread
var %s.temp = $gettok($sockname,2,46), %n.temp = $remove(%shoutcast.name1,$chr(32),-,.), %`t = $gettok($sockname,-1,46), %cid = $gettok($sockname,-2,46)
if (%`t == radio) {
sockread %scasttemp
if ($sockbr == 0) return
tokenize 58 %scasttemp
var %t = $gethtml(%scasttemp)
if (%scasttemp == ICY 200 OK) { disp.status %cid 1 Loading Stream... }
elseif ($1 == icy-notice1) { hadd asdj $+(notice,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif ($1 == icy-notice2) { hadd asdj $+(notice,%n.temp) $addtok($hget(asdj,$+(notice,%n.temp)),$iif($deltok(%t,1,58),$ifmatch,.),32) }
elseif ($1 == icy-name) { hadd asdj $+(name,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a)) }
elseif ($1 == icy-genre) { hadd asdj $+(genre,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif ($1 == icy-url) { var %w = $iif($deltok(%t,1,58),$ifmatch,n/a) | hadd asdj $+(url,%n.temp) %w | %shoutcast.website1 = %w }
elseif ($1 == icy-br) { hadd asdj $+(bitrate,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif (icy !isin $1) {
sockclose $sockname
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch $streamreport(%n.temp) }
halt
}
goto nextread
}
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
var %scasttemp = $remove(%scasttemp,,)
tokenize 44 %scasttemp
if (*HTTP*404* iswm %scasttemp) { aline -p $+(@,$remove(%shoutcast.name1,$chr(32))) No data found on $gettok($sockname,2-3,46) | sockclose $sockname }
if (HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty) {
set %shoutcast.status. [ $+ [ %s.temp ] ] $2
set %shoutcast.listeners. [ $+ [ %s.temp ] ] $1
set %shoutcast.maxlisteners. [ $+ [ %s.temp ] ] $4
set %shoutcast.peak. [ $+ [ %s.temp ] ] $3
set %shoutcast.bitrate. [ $+ [ %s.temp ] ] $6
set %shoutcast.song. [ $+ [ %s.temp ] ] $7-
if ($7) addsong $remove($deltok($7-,1,45),$chr(32)) $ctime %n.temp $web(%shoutcast.server1,%shoutcast.port1)
if (%`t == stat) {
%shoutcast.report = $+(%n.temp,-,$ctrigger($sockname,$2,$1,$3,$4,$6,$7-))
disp.status %cid 1 %shoutcast.report
if (%autoserve [ $+ [ $+(%cid,%shoutcast.server1) ] ]) { unset %autoserve [ $+ [ $+(%cid,%shoutcast.server1) ] ] | reportallchan %cid %shoutcast.report | return }
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.report }
}
else {
if ($2 == 0) {
%shoutcast.report = $replace(%shoutcast.commandformat,,Alert:,,Streaming Is currently Down on Skn %n.temp)
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.report }
}
elseif ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch $ctrigger($sockname,%s.temp,%n.temp) }
disp.status %cid 1 %shoutcast.report
}
}
goto nextread
}
on *:sockclose:$(shoutcast. $+ $+(%shoutcast.server1,*)):{
var %`t = $gettok($sockname,-1,46), %cid = $gettok($sockname,-2,46)
if (($sockerr) || (%autoreport [ $+ [ $cid ] ] == off)) return
if (%`t == stat) && (%delay [ $+ [ %cid ] ]) {
scid %cid .timer $+ $+(auto,%cid) 1 %delay [ $+ [ %cid ] ] sockconnect stat auto
}
}
on *:SOCKOPEN:$(shoutcast. $+ $+(%shoutcast.server2,*)):{
set -u0 %`t $gettok($sockname,-1,46)
var %cid = $gettok($sockname,-2,46)
if ($sockerr > 0) {
set %shoutcast.errorformat $replace(%shoutcast.commandformat,,Error,,No Connection To Server: $gettok($sockname,2-3,46))
if ($reguestchan($gettok($sockname,-1,46),%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.errorformat }
disp.status %cid 2 %shoutcast.errorformat
return
}
sockident $sockname
}
on *:sockread:$(shoutcast. $+ $+(%shoutcast.server2,*)):{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
var %s.temp = $gettok($sockname,2,46), %n.temp = $remove(%shoutcast.name2,$chr(32),-,.), %`t = $gettok($sockname,-1,46), %cid = $gettok($sockname,-2,46)
if (%`t == radio) {
sockread %scasttemp
if ($sockbr == 0) return
tokenize 58 %scasttemp
var %t = $gethtml(%scasttemp)
if (%scasttemp == ICY 200 OK) { disp.status %cid 2 Loading Stream... }
elseif ($1 == icy-notice1) { hadd asdj $+(notice,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif ($1 == icy-notice2) { hadd asdj $+(notice,%n.temp) $addtok($hget(asdj,$+(notice,%n.temp)),$iif($deltok(%t,1,58),$ifmatch,.),32) }
elseif ($1 == icy-name) { hadd asdj $+(name,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a)) }
elseif ($1 == icy-genre) { hadd asdj $+(genre,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif ($1 == icy-url) { var %w = $iif($deltok(%t,1,58),$ifmatch,n/a) | hadd asdj $+(url,%n.temp) %w | %shoutcast.website2 = %w }
elseif ($1 == icy-br) { hadd asdj $+(bitrate,%n.temp) $iif($deltok(%t,1,58),$ifmatch,n/a) }
elseif (icy !isin $1) {
sockclose $sockname
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch $streamreport(%n.temp) }
halt
}
goto nextread
}
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
var %scasttemp = $remove(%scasttemp,,)
tokenize 44 %scasttemp
if (*HTTP*404* iswm %scasttemp) { aline -p $+(@,$remove(%shoutcast.name2,$chr(32))) No data found on $gettok($sockname,2-3,46) | sockclose $sockname }
if (HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty) {
set %shoutcast.status. [ $+ [ %s.temp ] ] $2
set %shoutcast.listeners. [ $+ [ %s.temp ] ] $1
set %shoutcast.maxlisteners. [ $+ [ %s.temp ] ] $4
set %shoutcast.peak. [ $+ [ %s.temp ] ] $3
set %shoutcast.bitrate. [ $+ [ %s.temp ] ] $6
set %shoutcast.song. [ $+ [ %s.temp ] ] $7-
if ($7) addsong $remove($deltok($7-,1,45),$chr(32)) $ctime %n.temp $web(%shoutcast.server2,%shoutcast.port2)
if (%`t == stat) {
%shoutcast.report = $+(%n.temp,-,$ctrigger($sockname,$2,$1,$3,$4,$6,$7-))
disp.status %cid 2 %shoutcast.report
if (%autoserve [ $+ [ $+(%cid,%shoutcast.server2) ] ]) { unset %autoserve [ $+ [ $+(%cid,%shoutcast.server2) ] ] | reportallchan %cid %shoutcast.report | return }
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.report }
}
else {
if ($2 == 0) {
%shoutcast.report = $replace(%shoutcast.commandformat,,Alert:,,Streaming Is currently Down on Skn %n.temp)
if ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch %shoutcast.report }
}
elseif ($reguestchan(%`t,%cid)) { scid -t1 %cid msg $ifmatch $ctrigger($sockname,%s.temp,%n.temp) }
disp.status %cid 2 %shoutcast.report

}
}
goto nextread
}
on *:sockclose:$(shoutcast. $+ $+(%shoutcast.server2,*)):{
var %`t = $gettok($sockname,-1,46), %cid = $gettok($sockname,-2,46)
if (($sockerr) || (%autoreport [ $+ [ $cid ] ] == off)) return
if (%`t == stat) && (%delay [ $+ [ %cid ] ]) {
scid %cid .timer $+ $+(auto,%cid) 1 %delay [ $+ [ %cid ] ] sockconnect stat auto
}
}
on *:SIGNAL:users: { set.user.request $1 $2 | msg $3 %request.command [ $+ [ $1 ] ] }
on *:SIGNAL:DJs: {
setcurrent.topic $1
if ($me isop $2) && (%ontopic [ $+ [ $1 ] ] == on) topic $2 $current.topic
else msg $2 $current.topic
}
;protection
on *:SIGNAL:opme: scid $1 cs op $2 $me
on !@*:ban:$(%shoutcast.channel [ $+ [ $cid ] ]):{ if ($banmask iswm $address($me,5)) { kick $chan $nick Banning channel bot addresses are Ilegal Action | mode $chan -b+b $banmask $wildsite } }
on *:notice:*has deopped*:$(%shoutcast.channel [ $+ [ $cid ] ]):{ if (dal.net isin $server) && ($nick == ChanServ) && ($4 == $me) && ($1 != $owner) { .signal -n opme $cid $chan } }
on !*:deop:$(%shoutcast.channel [ $+ [ $cid ] ]):{ if (dal.net isin $server) && ($opnick == $me) && ($nick != $owner) && ($nick != ChanServ) && (!%deopme [ $+ [ $+($cid,$chan) ] ]) { set -u5 %deopme [ $+ [ $+($cid,$chan) ] ] ! | .signal -n opme $cid $chan } }
on *:connect: .ial on | if ($wildtok(%shoutcast.channel [ $+ [ $cid ] ],*Change-Me*,1,44)) { unset %shoutcast.channel [ $+ [ $cid ] ] | incpl } | .timer 1 10 connect_
on *:start: default.set | .hmake song 500 | .hmake asdj 1 | hmake dj 10 | .anick $+($mnick,2) | %clonenumber = 2 | echo $color(info) -a -7 $+ $shoutcast.version 7- loaded.... | unsetvar
on *:exit: .hfree song | .rlevel asdj
alias sockident {
if (%`t == radio) {
sockwrite -n $1 GET / HTTP/1.0
sockwrite -n $1 Host: $sock($1).ip
sockwrite -n $1
}
else {
sockwrite -n $1 GET /7.html HTTP/1.0
sockwrite -n $1 Host: $sock($1).ip
sockwrite -n $1 User-Agent: Mozilla/5.0
sockwrite -n $1 $crlf
}
}
alias disp.status {
if (%actionlog [ $+ [ $1 ] ] == 0) return
if (!$window($+(@,$remove($var($+(%,shoutcast.name,$2),1).value,$chr(32))))) window -b $+(@,$remove($var($+(%,shoutcast.name,$2),1).value,$chr(32))) Tahoma 11
aline -p $+(@,$remove($var($+(%,shoutcast.name,$2),1).value,$chr(32))) $timestamp $3-
}
alias streamreport return Server-Notice: $iif($hget(asdj,$+(notice,$1)),$hget(asdj,$+(notice,$1)),n/a) Station-Name: $iif($hget(asdj,$+(name,$1)),$hget(asdj,$+(name,$1)),n/a) Genre: $iif($hget(asdj,$+(genre,$1)),$hget(asdj,$+(genre,$1)),n/a) URL: $iif($hget(asdj,$+(url,$1)), $hget(asdj,$+(url,$1)),n/a)
alias maker return $decode(W3xSZWQtWHxd,m)
alias -l gethtml {
var %text, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%text), %text = $remove(%text,&)
return %text
}
alias request {
if ($window(@Requestlog)) { return }
window -elk0 @Requestlog Tahoma 11
aline -p @Requestlog -------------------------------------------------------------------------------------------------
aline -p @Requestlog :: List of Request......................................
aline -p @Requestlog -------------------------------------------------------------------------------------------------
.timerasslog 1 2 window -b @Requestlog
}
alias requestlog {
if (!$window(@Requestlog)) { unset %countrequest [ $+ [ $+($1,$2) ] ] }
if (!%countrequest [ $+ [ $+($1,$2) ] ]) { set %countrequest [ $+ [ $+($1,$2) ] ] 1 }
else inc %countrequest [ $+ [ $+($1,$2) ] ]
request %countrequest [ $+ [ $+($1,$2) ] ]
aline -p @Requestlog ( $+ %countrequest [ $+ [ $+($1,$2) ] ] $+ ) $timestamp Channel:  $+ $remove($2,$chr(35)) Nick: $+ $3 Song:  $+ $4-
}
alias -l seennick {
var %i = $comchan($3,0)
if (!%i) { raw notice $2 : $+ $seenparse($3) | return }
while (%i) {
if ($comchan($3,%i) == $1) { msg $1 $2 :hm..it seems that you need to open your eyes widely }
else { raw notice $2 : $+ $3 is in $comchan($3,%i) right now | break }
dec %i
}
}
alias seenparse {
var %c = $hget(dj,$+($cid,$1))
if (!%c) { return $1 is not login yet }
var %n = $1
tokenize 32 %c
if ($1 == quit) { return I last saw %n quitting $duration($calc($ctime - $2)) ago $iif($3,with the message $3-) }
if ($1 == part) { return I last saw %n leaving $2 $duration($calc($ctime - $3)) ago with the message $4- }
if ($1 == join) { return I last saw %n joining $2 $duration($calc($ctime - $3)) ago. }
if ($1 == nick) { return I last saw %n changing nickname to $2 $duration($calc($ctime - $3)) ago. }
if ($1 == offair) { return I last saw %n asked for offair in $2 $duration($calc($ctime - $3)) ago. }
if ($1 == signed-in) { return I last saw %n signed-in in $2 $duration($calc($ctime - $3)) ago. }
}
on *:LOAD:{
;this variable are set just to show the setting need to be made, but it can anyway be used for testing
set %shoutcast.website1 http://tiongkokradio.com
set %shoutcast.website2 http://indoradio.sb5.org
set %shoutcast.name1 Teochew Radio Online1
set %shoutcast.name2 Teochew Radio Online2
set %shoutcast.server1 tiongkokradio.com
set %shoutcast.server2 indoradio.sb5.org
set %shoutcast.news1 %shoutcast.name1 $+ : added news
set %shoutcast.news2 %shoutcast.name2 $+ : added news
set %shoutcast.channeltopic $shoutcast.channeltopic
set %shoutcast.commandformat $shoutcast.commandformat
set %shoutcast.trigger @
set %shoutcast.port1 2222
set %shoutcast.port2 8181
echo $color(info) -a :: $+ $shoutcast.version v1.0 Succesfully loaded...
echo $color(info) -a ::Capable of Two socket connections to different IP's
echo $color(info) -a ::This Addon created by [|Red-X|]
echo $color(info) -a ::Bugs found or any question mail to m_aditya@kaskus.com or at www.hawkee.com or /msg [|Red-|] on @Dalnet #help-script..plz...respons...
.timer1 1 3 open shoutcast
}
alias -l open if (!$dialog($1)) dialog -mhr $1 $1
dialog shoutcast {
title $shoutcast.version
size -1 -1 203 158
option dbu
button "&OK", 13, 155 140 37 12, ok
button "&Cancel", 14, 112 140 37 12, cancel
tab "Main Settings", 1, 6 1 192 133
edit %shoutcast.name1, 2, 10 28 90 10, tab 1 autohs
edit %shoutcast.server1, 3, 10 49 90 10, tab 1 autohs
edit %shoutcast.port1, 4, 76 63 22 10, tab 1 autohs
edit %shoutcast.trigger, 5, 164 119 31 10, tab 1
edit %shoutcast.website1, 6, 10 96 90 10, tab 1 autohs
edit %shoutcast.channel [ $+ [ $cid ] ], 7, 10 119 148 10, tab 1 autohs
text "Channels:", 55, 11 111 41 8, tab 1
text "Website1", 54, 12 87 54 8, tab 1
text "Port:1", 52, 58 64 14 8, tab 1
text "Server1 Address:", 51, 11 40 63 8, tab 1
text "Station1 Name:", 50, 11 20 71 8, tab 1
text "Trigger:", 53, 165 111 25 8, tab 1
edit %shoutcast.name2, 11, 105 28 90 10, tab 1 autohs
edit %shoutcast.server2, 12, 105 49 90 10, tab 1 autohs
edit %shoutcast.port2, 15, 171 63 22 10, tab 1 autohs
text "Port:2", 16, 152 64 14 8, tab 1
text "Station2 Name:", 17, 106 20 71 8, tab 1
edit %shoutcast.website2, 18, 105 96 91 10, tab 1 autohs
text "Website2", 19, 106 87 54 8, tab 1
text "Server2 Address:", 22, 106 40 63 8, tab 1
edit %shoutcast.pass [ $+ [ $cid ] ], 23, 51 77 47 10, tab 1 autohs
edit %shoutcast.pass [ $+ [ $cid ] ], 24, 146 77 47 10, tab 1 autohs
text "Password", 25, 16 72 29 8, tab 1
text "connection1", 62, 16 78 29 8, tab 1
text "Password", 26, 108 72 34 8, tab 1
text "connection2", 63, 108 78 34 8, tab 1
box "", 38, 8 14 94 96, tab 1
box "", 43, 103 14 93 96, tab 1
tab "Message/Display settings", 34
text "Channel Topic:", 56, 11 17 51 8, tab 34
edit %shoutcast.channeltopic, 8, 11 25 180 10, tab 34 autohs
text "Variables: ", 57, 11 37 175 8, tab 34 disable
text "Command Responses:", 58, 11 46 80 8, tab 34
edit %shoutcast.commandformat, 9, 11 55 180 10, tab 34 autohs
text "Variables: ", 59, 11 67 124 8, tab 34 disable
check Set Topic %ontopic [ $+ [ $cid ] ], 28, 16 81 42 10, tab 34
radio "Message", 29, 117 100 42 10, tab 34
radio "Notice", 30, 117 114 42 10, tab 34
check Join/part Greeting %ojgreet [ $+ [ $cid ] ], 31, 118 86 66 10, tab 34
box "", 27, 11 75 98 30, tab 34
box "on join/part greeting", 35, 111 75 82 55, tab 34
check method %shoutcast.method, 36, 18 113 35 12, tab 34 push flat
box "", 60, 11 104 98 26, tab 34
text "User's commands", 61, 56 115 45 8, tab 34
check Auto Display %autoreport [ $+ [ $cid ] ], 37, 60 81 47 10, tab 34
combo 39, 66 92 24 41, tab 34 size drop disable
text "STAT display every", 41, 16 95 49 8, tab 34
text "secs", 42, 93 95 17 8, tab 34
tab "Request/Activities Settings", 44
text "server1 news:", 40, 13 17 48 8, tab 44
edit %shoutcast.news1, 10, 12 25 180 10, tab 44 autohs
edit %shoutcast.news2, 20, 12 54 180 10, tab 44 autohs
text "server2 news:", 21, 13 45 48 8, tab 44
box "User's Request Setting", 45, 12 68 181 39, tab 44
radio "Forward User's request to a DJ randomizely ", 46, 46 79 116 10, tab 44
radio "Log User's Request to @Requestlog", 47, 46 92 102 10, tab 44
box "Activity Log", 48, 12 108 181 22, tab 44
check "Display activities on @station-name window ", 49, 47 116 114 10, tab 44
link "About asDJ-Bot v1.0", 32, 8 142 66 8
}
ON *:DIALOG:shoutcast:init:0:{
did -ca $dname 39 %delay [ $+ [ $cid ] ]
didtok -a $dname 39 44 60,120,180,240,300,360,420,600,1200,2400,3600
if (%shoutcast.method [ $+ [ $cid ] ] == 1) { did -u $dname 36 | did -a $dname 36 Method 1 } | else { did -c $dname 36 | did -a $dname 36 Method 2 }
if (%ontopic [ $+ [ $cid ] ] == off) did -u $dname 28 | else did -c $dname 28
if (%ojgreet [ $+ [ $cid ] ] == on) { did -e $dname 29,30 | did -c $dname 31 } | else { did -b $dname 29,30 | did -u $dname 31 }
if (%autoreport [ $+ [ $cid ] ] == on) { did -e $dname 39,41 | did -c $dname 37 } | else { did -b $dname 39,41 | did -u $dname 37 }
if (%ojmsg [ $+ [ $cid ] ] == 1) { %ojnotice [ $+ [ $cid ] ] = 0 | did -u $dname 30 | did -c $dname 29 } | else { %ojnotice [ $+ [ $cid ] ] = 1 | did -c $dname 30 | did -u $dname 29 }
if (%requestlog [ $+ [ $cid ] ] == 1) { %requestsend [ $+ [ $cid ] ] = 0 | did -u $dname 46 | did -c $dname 47 } | else { %requestsend [ $+ [ $cid ] ] = 1 | did -c $dname 46 | did -u $dname 47 }
if (%actionlog [ $+ [ $cid ] ] == 1) did -c $dname 49 | else did -u $dname 49
}
ON *:DIALOG:shoutcast:sclick:*:{
if ($did == 13) {
set %shoutcast.name1 $did($dname,2)
set %shoutcast.server1 $did($dname,3)
set %shoutcast.port1 $did($dname,4)
set %shoutcast.trigger $did($dname,5)
set %shoutcast.website1 $did($dname,6)
set %shoutcast.name2 $did($dname,11)
set %shoutcast.server2 $did($dname,12)
set %shoutcast.port2 $did($dname,15)
set %shoutcast.website2 $did($dname,18)
set %shoutcast.channel [ $+ [ $cid ] ] $did($dname,7)
set %shoutcast.channeltopic $did($dname,8)
set %shoutcast.commandformat $did($dname,9)
set %shoutcast.news1 $did($dname,10)
set %shoutcast.news2 $did($dname,20)
set %shoutcast.pass [ $+ [ $scon(1).cid ] ] $did($dname,23)
set %shoutcast.pass [ $+ [ $scon(2).cid ] ] $did($dname,24)
set %delay [ $+ [ $cid ] ] $did($dname,39)
}
if ($did == 29) { %ojmsg [ $+ [ $cid ] ] = $iif(%ojmsg [ $+ [ $cid ] ] == 1,0,1) | if ($did(29).state == 1) { %ojmsg [ $+ [ $cid ] ] = 1 | %ojnotice [ $+ [ $cid ] ] = 0 | did -u $dname 30 | did -c $dname 29 } | else { %ojnotice [ $+ [ $cid ] ] = 1 | did -c $dname 30 | did -u $dname 29 } }
if ($did == 30) { %ojnotice [ $+ [ $cid ] ] = $iif(%ojnotice [ $+ [ $cid ] ] == 1,0,1) | if ($did(30).state == 1) { %ojnotice [ $+ [ $cid ] ] = 1 | %ojmsg [ $+ [ $cid ] ] = 0 | did -c $dname 30 | did -u $dname 29 } | else { %ojmsg [ $+ [ $cid ] ] = 1 | did -u $dname 30 | did -c $dname 29 } }
if ($did == 28) { %ontopic [ $+ [ $cid ] ] = $iif(%ontopic [ $+ [ $cid ] ] == on,off,on) | if (%ontopic [ $+ [ $cid ] ] == on) did -ca $dname 28 Set Topic on | else did -ua $dname 28 Set Topic off }
if ($did == 31) { %ojgreet [ $+ [ $cid ] ] = $iif(%ojgreet [ $+ [ $cid ] ] == on,off,on) | if (%ojgreet [ $+ [ $cid ] ] == on) { did -e $dname 29,30 | did -ca $dname 31 Join/part Greeting on } | else { did -b $dname 29,30 | did -ua $dname 31 Join/part Greeting off } }
if ($did == 32) { if (!$dialog(about.asdj)) dialog -mv about.asdj about.asdj }
if ($did == 36) { %shoutcast.method [ $+ [ $cid ] ] = $iif(%shoutcast.method [ $+ [ $cid ] ] == 1,2,1) | if (%shoutcast.method [ $+ [ $cid ] ] == 1) { did -ua $dname 36 method 1 } | else { did -ca $dname 36 method 2 } | echo $color(info2) -a $iif(%shoutcast.method [ $+ [ $cid ] ] == 1,Method 1,Method 2) $+ - User's $set.shoutcast.method($cid) }
if ($did == 37) { %autoreport [ $+ [ $cid ] ] = $iif(%autoreport [ $+ [ $cid ] ] == on,off,on) | if (%autoreport [ $+ [ $cid ] ] == on) { did -e $dname 39,41 | did -ca $dname 37 Auto Display on } | else { did -b $dname 39,41 | did -ua $dname 37 Auto Display off } }
if ($did == 46) { %requestsend [ $+ [ $cid ] ] = $iif(%requestsend [ $+ [ $cid ] ] == 1,0,1) | if ($did(46).state == 1) { %requestsend [ $+ [ $cid ] ] = 1 | %requestlog [ $+ [ $cid ] ] = 0 | did -u $dname 47 | did -c $dname 46 } | else { %requestlog [ $+ [ $cid ] ] = 1 | did -c $dname 47 | did -u $dname 46 } }
if ($did == 47) { %requestlog [ $+ [ $cid ] ] = $iif(%requestlog [ $+ [ $cid ] ] == 1,0,1) | if ($did(47).state == 1) { %requestlog [ $+ [ $cid ] ] = 1 | %requestsend [ $+ [ $cid ] ] = 0 | did -u $dname 46 | did -c $dname 47 } | else { %requestsend [ $+ [ $cid ] ] = 1 | did -c $dname 46 | did -u $dname 47 } }
if ($did == 49) { %actionlog [ $+ [ $cid ] ] = $iif(%actionlog [ $+ [ $cid ] ] == 1,0,1) | if ($did(49).state == 1) { %actionlog [ $+ [ $cid ] ] = 1 | did -c $dname 49 } | else { %actionlog [ $+ [ $cid ] ] = 0 | did -u $dname 49 } }
}
alias -l default.set {
set %shoutcast.currentdj [ $+ [ $cid ] ] n/a
set %delay [ $+ [ $cid ] ] 600
set %shoutcast.channel [ $+ [ $cid ] ] #Change-Me1,#Change-Me2,#Change-Me3,#etc
set %shoutcast.method [ $+ [ $cid ] ] 1
set %shoutcast.pass [ $+ [ $cid ] ] 1234change
set %actionlog [ $+ [ $cid ] ] 0
}
alias -l unsetvar unset %nr.of.server %request.* %song* %listeners* %bitrate* %stat* %peak*
alias incpl open error | .timerdlg 1 3 open shoutcast
dialog error {
title asDJ-Bot Error
size -1 -1 108 37
option dbu
text "ERROR: configuration incomplete!",3, 11 7 95 7
button "Close" 4, 38 20 25 12, Ok
}
dialog about.asdj {
title "About asDJ-Bot v1.0"
size -1 -1 86 78
option dbu
box "", 1, -6 59 100 50
button "close", 2, 47 65 37 10, cancel
text "Author:", 3, 3 2 25 8
link "E-Mail", 5, 30 9 54 8
link "http://www.hawkee.com", 8, 3 16 82 8
text "[|Red-X|]", 6, 30 2 54 8
text "Contact:", 4, 3 9 25 8
text "©2004 by M.Aditya", 9, 3 55 82 8
text "You can find more information in the readme. Always check the website for updates and/or other scripts.", 10, 3 27 80 26
}
ON *:DIALOG:about.asdj:sclick:*: {
if ($did == 4) .url -n mailto: m_aditya@kaskus.com
if ($did == 8) .url -n http://www.hawkee.com
}
menu channel,menubar,status,nicklist {
$+(&,$shoutcast.version)
.&Make New Connection: %nick = $iif($?="nick?",$!,$mnick) | server -m $$?="server?" $$?="port?" -i %nick
.-
.Configure:if (!$dialog(shoutcast)) dialog -mr shoutcast shoutcast
.-
.&IAL status
..$iif($chan(#).ial == $true,All addresses OK):echo No need to update IAL for #
..$iif($chan(#).ial == $false,IAL for # Incomplete. Update?):.who #
.-
.$iif($chan(#).ial == $false,$style(2)) Assignment
..$iif($active !ischan,$style(2)) Owner
...$iif($ulist($address($snick(#,1),0),asdj,1),&Del.,&Add) $snick(#,1): resetcurrentdj $cid | $iif($ulist($address($snick(#,1),0),asdj,1),.ruser,.guser) asdj $snick(#,1) 0 | if ($ulist($address($snick(#,1),0),asdj,1)) { alias owner return $snick(#,1) | %shoutcast.currentdj [ $+ [ $cid ] ] = $addtok(%shoutcast.currentdj [ $+ [ $cid ] ],$snick(#,1),43) | .msg $snick(#,1) added4@Owner } | else { alias owner return | %shoutcast.currentdj [ $+ [ $cid ] ] = $remtok(%shoutcast.currentdj [ $+ [ $cid ] ],$snick(#,1),1,43) | .msg $snick(#,1) del4@Owner }
..$iif($active !ischan,$style(2)) &DJ
...$iif($ulist($address($snick(#,1),0),asdj,1),&Del.,&Add) $snick(#,1): resetcurrentdj $cid | $iif($ulist($address($snick(#,1),0),asdj,1),.ruser,.guser) asdj $snick(#,1) 0 | if ($ulist($address($snick(#,1),0),asdj,1)) { msg $snick(#,1) added4@DJ, type $c(login) %shoutcast.pass [ $+ [ $cid ] ] } | else { %shoutcast.currentdj [ $+ [ $cid ] ] = $remtok(%shoutcast.currentdj [ $+ [ $cid ] ],$snick(#,1),1,43) | .msg $snick(#,1) del4@DJ }
.$iif($active ischan,$active)
..$iif($istok(%shoutcast.channel [ $+ [ $cid ] ],#,44),&Del.,&Add) $active: if ($istok(%shoutcast.channel [ $+ [ $cid ] ],#,44)) { %shoutcast.channel [ $+ [ $cid ] ] = $remtok(%shoutcast.channel [ $+ [ $cid ] ],#,1,44) } | else { %shoutcast.channel [ $+ [ $cid ] ] = $addtok(%shoutcast.channel [ $+ [ $cid ] ],#,44)) } | echo $color(info) -a ::Active Channels: %shoutcast.channel [ $+ [ $cid ] ]
.-
.$iif($active != status window,Advertise):say I'm using -7 $+ $shoutcast.version v1.07- by $maker
}
menu @Requestlog {
dclick window -c @Requestlog
Copy: clipboard $sline($active,1)
Clear screen: dline -s 4 $+ -
-
&Del. line:var %ln = $sline($active,1).ln | dline -s %ln $+ - $+ %ln
-
Close: .window -c $active
}
on *:UNLOAD:{
echo -a ::unloaded $shoutcast.version addon
unsetvar | unset %shoutcast*
}
;eos

Categories



0 comments: "Advanced shoutcast DJ Bot"

 
Copyright 2009 - Belajar Seo 2010 Blogspot Template » Wordpress Themes