well okay i added it and its on the web but i dont understand how it actually works...
http://www.egghelp.org/cgi-bin/tcl_arch ... ad&id=1076
there the actual download
Code: Select all
#playlist scan by #@homer
#version 0.5
#email fkhg1@web.de (reason scriptname.tcl)
#icq 92566354
#simple make a playlist of all your mp3's or what you whant
#than put it into a direcory (simple ~/playlists/playlist01.htm or what you whant)
#use !addpl Playlist1 ~/playlists/playlist01.html (be sure that you are bot owner)
#if you whant to donate me paypal: fkhg1@web.de
#if you have any problems with the script just visit me
#my homepage www.homer-im-bett.de.vu
#
#i have made this script for the radio #dynamix in irc.quakenet.org www.rautedynamix.de
#if you have any good ideas what i can code just visit me :D i have a lot of time ^^
#copyright 2004 homer^im^bett Florian K.
bind pub n !addpl appp
bind pub - !setcurrent scurr
bind pub - !playlist plsearch
#do not change or ripp anything under this line:
#-----------------------------------------------
proc searchlist {listname nick strings} {
if {![file exists $listname]} {
putserv "NOTICE $nick :Playlist Not Found"
varin ~/stream.txt scan no
return noplaylist
}
if {[file exists $listname]} {
set fs [open $listname r]
set found 0
regsub -all " " $strings "*" bla
gets $fs point
while {![eof $fs]} {
if {[string match -nocase "*$bla*" $point]} {
incr found
set output($found) $point
}
gets $fs point
}
close $fs
if {$found == 0} {
putserv "NOTICE $nick :nothing found!!!"
varin ~/stream.txt scan no
return found0
}
if {$found <= 5} {
set afound 1
while {$afound <= $found} {
regsub -all "<BR>" $output($afound) "" text
regsub -all "<br>" $text "" text
puthelp "NOTICE $nick :$afound / $found found: $text"
incr afound
}
varin ~/stream.txt scan no
return afterwhile
}
if {$found >= 5} {
putserv "NOTICE $nick :too many matches ($found) show the first 5 matches"
set afound 1
while {$afound <= 5} {
regsub -all "<BR>" $output($afound) "" text
regsub -all "<br>" $text "" text
puthelp "NOTICE $nick :$afound / $found found: $text"
incr afound
}
}
}
varin ~/stream.txt scan no
}
proc appp {nick host handle chan text} {
if {$text == ""} {
putserv "NOTICE $nick :Syntax: !addpl NAME OF HTML PLAYLIST ~/playlists/XXXXX.html \"!addpl play01 ~/playlists/play01.html\""
return help
}
addpl $nick [lindex $text 0] [lindex $text 1] $chan
}
proc addpl { nick plname pl chan } {
if {![file exists $pl]} {
putserv "NOTICE $nick :PlayList Not Found"
return noplaylist
}
if {[file exists $pl]} {
varin ~/playlists.txt $plname $pl
putserv "NOTICE $nick :playlist saved as: $plname"
putserv "PRIVMSG $chan :playlist: $pl : $nick name: $plname"
return everythingdone
}
}
proc scurr {nick host handle chan text} {
if {[lindex $text 0] == ""} {
putserv "NOTICE $nick :!setcurrent playlistname"
return 0
}
if {![file exists [varout ~/playlists.txt [lindex $text 0]]]} {
putserv "PRIVMSG $chan :playlist not in list"
return 1
}
if {[varout ~/playlists.txt [lindex $text 0]] == "0"} {
putserv "PRIVMSG $chan :playlist not in list"
return 2
}
if {[varout ~/playlists.txt [lindex $text 0]] != "0"} {
varin ~/stream.txt current [varout ~/playlists.txt [lindex $text 0]]
varin ~/stream.txt curpl [lindex $text 0]
putserv "PRIVMSG $chan :playlist set to: [varout ~/playlists.txt [lindex $text 0]]"
return 10000
}
}
proc plsearch {nick host handle chan text} {
if {[varout ~/stream.txt curpl] == 0} {
putserv "NOTICE $nick :Playlist not loadet"
return nopl
}
if {[varout ~/stream.txt current] == 0} {
putserv "NOTICE $nick :Playlist not loadet"
return nopl
}
if {[varout ~/stream.txt scan] == "scan"} {
putserv "NOTICE $nick :Please wait"
return already
}
if {$text == ""} {
putserv "NOTICE $nick :syntax: !playlist string to search"
return 0
}
if {[llength [split $text ""]] <= 2} {
putserv "NOTICE $nick :string to short must be longer than 3 letters"
return 2short
}
varin ~/stream.txt scan scan
putserv "NOTICE $nick :Scanning playlist: [varout ~/stream.txt curpl]"
searchlist [varout ~/stream.txt current] $nick [lrange $text 0 end]
return 0
}
##### one piece of my var.tcl normal it is very big if you whant it contact me in irc.quakenet.org #@homer #####
#copyright 2004 homer^im^bett Florian K.
#do not change or ripp anything under this line:
#-----------------------------------------------
proc varin {storeplace var text} {
if {![file exists $storeplace]} {
set fs [open $storeplace w]
puts $fs ""
close $fs
}
set change 0
set fs [open $storeplace r]
set tmpfs [open $storeplace.tmp w]
while {![eof $fs]} {
gets $fs line
if {[lindex $line 0] != $var && [lindex $line 0] != ""} {
puts $tmpfs "$line"
}
if {[lindex $line 0] == $var} {
puts $tmpfs "$var [lrange $text 0 end]"
set change 1
}
}
if {!$change} {
puts $tmpfs "$var [lrange $text 0 end]"
}
close $fs
close $tmpfs
set fs [open $storeplace.tmp r]
set grrr "[read $fs]"
close $fs
set fs [open $storeplace w]
puts $fs "$grrr"
close $fs
return 0
}
proc varout {storeplace var} {
if {![file exists $storeplace]} {
return file!exists
}
set fs [open $storeplace r]
set varX 0
set ende 0
while {![eof $fs] || !$ende} {
gets $fs line
if {[lindex $line 0] == $var} {
close $fs
return [lrange $line 1 end]
set varX [lrange $line 1 end]
set ende 1
}
if {$line == ""} {
close $fs
return 0
}
}
close $fs
return $varX
}
now my real question is how does it work?
bind pub n !addpl appp
bind pub - !setcurrent scurr
bind pub - !playlist plsearch
^---- What do these mean is this something i need to do somewhere ?
and if not where does the Playlist Directory need to reside i added it in like three directories and one of them worked but not sure which one its actually in hehe.
but my real problem is what use is this. when i try to search like !playlist name it keeps saying not loadet so obviousely something is wrong can anyone help with how this actually works and the right steps to get it running ...