Code: Select all
proc addmy:id3c { bot com arg } {
global chann_ db_handle
set pattern { ([^>]+) ([^>]+) ([0-9]+) ([0-9]+) }
if { [regexp $pattern $arg match rlsname genre year sampling] }
{
set result [mysqlsel $db_handle "SELECT `rlsname` FROM `id3c` WHERE `rlsname` = '$rlsname'"]
}
if { $result == "0" } {
mysqlexec $db_handle "INSERT INTO `id3c` ( `rlsname` , `genre` , `year` , `sampling` ) VALUES ( '$rlsname' , '$genre' , '$year' , '$sampling' )"
putquick "PRIVMSG $chann_(addid3c) :!addid3c $rlsname $genre $year $sampling"
}
}
Code: Select all
!addid3c Marduk-World_Funeral-Remastered-2014-BERC Black Metal 2014 44100
Code: Select all
-- Table structure for table `id3c`
--
CREATE TABLE IF NOT EXISTS `id3c` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rlsname` varchar(240) CHARACTER SET utf8 NOT NULL,
`genre` text CHARACTER SET utf8,
`year` year(4) NOT NULL,
`sampling` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `rlsname` (`rlsname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=602 ;