alias isurl { ; by Wims
var %p m@((?:(?:https?|ircs?):noop $regex(isurl,$1-,%p)
if ($prop == all) {
var %a 1
while ($regml(isurl,%a)) { var %url = %url $v1 | inc %a 2 }
return $iif(%url,%url,0)
}
return $iif($prop isnum 0-,$regml(isurl,$prop),$iif($regml(isurl,0),$true,$false))
}
on $*:TEXT:!songrequest &:if ((%floodreqsong) || ($($+(%,floodreqsong.,$nick),2))) { return }
if (!$2) { msg $chan Error, Please specify a song link! | return }
if (!$isurl($2)) { msg $chan Error, Please specify a valid link url! | return }
if (!$3) { msg $chan Error, Please specify a song name! | return }
set -eu30 %floodreqsong On
set -eu60 %floodreqsong. $+ $nick On
write songlist.txt $3-
write songlinks.txt $2
write songusers.txt $nick
msg $chan $nick -> Added $qt($3-) song name with $qt($2) link to the song queue list.
}
on *:text:!currentsong:if ((%floodcurrentsong) || ($($+(%,floodcurrentsong.,$nick),2))) { return }
set -eu30 %floodcurrentsong On
set -eu60 %floodcurrentsong. $+ $nick On
if ($read(songlist.txt,n,1)) {
var %slist = $read(songlist.txt,n,1)
var %slink = $read(songlinks.txt,n,1)
var %suser = $read(songusers.txt,n,1)
msg $chan Current Song: %slist $chr(124) Requested by %suser $chr(124) %slink
}
else { msg $chan There are no more songs in the queue list. }
}
on *:text:!nextsong:if ((%floodnextsong) || ($($+(%,floodnextsong.,$nick),2))) { return }
if ($nick !isop set -eu30 %floodnextsong On
set -eu60 %floodnextsong. $+ $nick On
if ($read(songlist.txt,n,2)) {
var %slist2 = $read(songlist.txt,n,2)
var %slink2 = $read(songlinks.txt,n,2)
var %suser2 = $read(songusers.txt,n,2)
msg $chan Next Song: %slist2 $chr(124) Requested by %suser2 $chr(124) %slink2
}
else { msg $chan There are no more songs in the queue list. }
}
on *:text:!clearsongs:if ((%floodclearsong) || ($($+(%,floodclearsong.,$nick),2))) { return }
if ($nick !isop set -eu30 %floodclearsong On
set -eu60 %floodclearsong. $+ $nick On
var %t = $lines(songlist.txt)
if (%t) {
write -c $qt(songlist.txt)
write -c $qt(songlinks.txt)
write -c $qt(songusers.txt)
msg $chan $nick -> The song list has been cleared.
}
else { msg $chan There are no more songs in the queue list. }
}