Hi there,

I need some help, I want to add in a way for the bot to recognize links so that for the !songrequest command, if one does not give a link, their input will not be accepted. I am fairly new to IRC, so I apologize if the script has errors!

For example:

This: !songrequest Maroon 5 - Sugar youtu.be/09R8_2nJtjg?list=RDRgKAFK5djSk

Should give an output of "added song name Maroon 5 - Sugar to the song queue. youtu.be/09R8_2nJtjg?list=RDRgKAFK5djSk"

Any help is appreciated. Thanks in advance!




on $*:TEXT:!songrequest &:#: {
if ((%floodsongrequest) || ($($+(%,floodsongrequest.,$nick),2))) { return }
write songlist.txt $2
write songlinks.txt $3
write songusers.txt $nick
msg $chan Added song name $2 to the song queue. %slink
}

on *:text:!currentsong:#: {
if ((%floodcurrentsong) || ($($+(%,floodcurrentsong.,$nick),2))) { return }
set -u30 %floodcurrentsong On
set -u60 %floodcurrentsong. $+ $nick On {
if ($read(songlist.txt,2)) {

var %slist2 $read(songlist.txt,1)
var %slink2 $read(songlinks.txt,1)
var %suser2 $read(songusers.txt,1)
msg $chan Current Song: %slist $chr(124) Requested by %suser $chr(124) %slink
write -dl1 songlist.txt
write -dl1 songlinks.txt
write -dl1 songusers.txt
}
else {
msg $chan There are no more songs in the queue.
write -dl1 songlist.txt
write -dl1 songlinks.txt
write -dl1 songusers.txt
}
}
}

on *:text:!nextsong:#: {
if ($nick isop #) {
if ((%floodnextsong) || ($($+(%,floodnextsong.,$nick),2))) { return }
set -u5 %floodnextsong On
set -u10 %floodnextsong. $+ $nick On {
if ($read(songlist.txt,2)) {
var %slist2 $read(songlist.txt,2)
var %slink2 $read(songlinks.txt,2)
var %suser2 $read(songusers.txt,2)

msg $chan Next Song: %slist $chr(124) Requested by %suser $chr(124) %slink
write -dl1 songlist.txt
write -dl1 songlinks.txt
write -dl1 songusers.txt
}
else {
msg $chan There are no more songs in the queue.
write -dl1 songlist.txt
write -dl1 songlinks.txt
write -dl1 songusers.txt
}
}
}
else msg # This command is only available to moderators.
}

Last edited by Khonor; 26/01/16 03:21 PM.