Making a script for my channel, basically, you send the bot a file, it stores it, you do !set_pic <filename> it makes it the picture of the day. you do !pic, it send the file, and if you specify a specific filename, it sends you that.
so i wrote the script, getting a couple of errors, nothing major, just missing a close brace for the 2nd proc, and io have extra characters after close brace for pub 1
so, read over this around 30 times. And cant for the life of me find the error. Can you lend me assistance in finding the irritaitng bug please?[23:06:51] <Natsuki-Chan> [23:06] Tcl error [pub:picoday]: missing close-bracket
[23:07:04] <Natsuki-Chan> [23:07] Tcl error [pub:pic]: extra characters after close-brace
Code: Select all
set dir(main) "filesys/incoming"
#This sets the bind for the !pic command
bind pub - !pic pub:pic
#This sets the bind for ops and halfops for picture of the day
bind pub ol|ol !set_pic pub:picoday
proc pub:pic { nick host hand chan text } {
global dir
if {$text == ""}{
set $dir(file) $dir(main)/$dir(potd)
dccsend $dir(file) $nick
putcmdlog "$dir(file) sent to !$nick -- $hand! on $chan"
} {
set dir(filename) [lindex [split $text] 0]
set dir(file) $dir(main)/$dir(filename)
if {[fileexists $dir(main)/$dir(filename)]} {
dccsend $dir(file) $nick
putcmdlog "$dir(file) sent to !$nick -- $hand! on $chan"
} {
puthelp "notice $nick :File Cannot be Sent because it does not Exist on the File Space"
putcmdlog "Failed Send due to Bad file error"
}
}
}
proc pub:picoday {nick host hand chan text} {
global dir
set dir(filename) [lindex [split $text 0]
if {[fileexists $dir(main/$dir(filename)]} {
set dir(potd) $dir(filename)
putcmdlog "New Picture of the Day uploaded by !$hand - $nick! - $dir(potd)
} {
puthelp "notice $nick :File does not exist on the File System, please check your imput or upload that file"
putcmdlog "New Picture of the Day - Failed"
}
}
putlog "\Picture of the Day V0.1 by Weirdo loaded"
