bind pub - !which which:pub
set filename which.dat
proc which:pub {nick host hand chan arg} {
global filename
if {[ownerison $chan]} {
foreach user [userlist n] {
if {[onchan $user $chan]} {
privmsg "PRIVMSG $nick :New Which\(\002[join [lrange $arg 0 end]]\002\) by \(\002$nick\002\) is been submited on \(\002[clock format [clock seconds] -format \"%A %d %B %Y at %T\"]\002\)
}
}
} else {
set wfile [open $filename w]
puts $wfile "n [clock seconds] $nick [join [lrange $arg 0 end]]"
close $wfile
putserv "NOTICE $nick :Your Which is been submited."
}
}
proc ownerison {chan} {
foreach user [userlist n] {
if {[onchan $user $chan]} {
return 1
}
}
return 0
}
bind join - * join:pub
proc join:pub {nick host hand} {
global filename
if {[matchattr $nick n] && [file exists $filename]} {
set rfile [open $filename r]
set data [read $rfile]
close $rfile
foreach line [split $data \n] {
if {[string -nocase equal n [lindex $line 0]]} {
privmsg "PRIVMSG $nick :New Which \(\002[join [lrange $line 3 end]]\002\) by \(\002[lindex $line 2]\002\) is been submited on \(\002[clock format [lindex $line 1] -format \"%A %d %B %Y at %T\"]\002\)."
}
}
set wfile [open $filename w]
foreach line [split $data \n] {
if {[string match -nocase equal n [lindex $line 0]]} {
puts $wfile "o [join [lrange $line 1 end]]"
} else {
puts $wfile "$line"
}
}
close $wfile
}
}
didn't test it but it will notify owner on join if there where no owners present on the channel while the which is submited there this is only public if u want /msg command edit it a bit let me know if it is bugfree sorry got no time and don't feel like testing hehe