Firstly, I'll try to explain what type of script do I need:
"When a user having ident "cht-v3.1" or "off" joins any channel, bot DCC sends him/her file "vkt.ini" and puts his hostmask (for example: *!*@user.domain.com) into a file, so when users from the same hostmask joins to channel again, the file won't be sent again".
Please note that bot should send that file only for people having idents "cht-v3.1" or "off" but not any other!
I've two skripts here:
This script sends the file only for cht-v3.1 or off ident owners but it doesn't check if that file was sent for a certain hostmask in the past, so it send it to user every time (s)he joins a channel:
Code: Select all
set sendfile "/home/hide/_stuff/vkt.ini"
bind join - * join:send
proc join:send {nick uhost hand chan} {
if {[isbotnick $nick]} {
return
}
set ident [lindex [split $uhost @] 0]
if {![regexp -all {cht-v3.1|off} $ident]} {
return
}
dccsend $::sendfile $nick
}
here I have another script but it doesn't work due to unknown reason but I give it You anyway (maybe it'll help).
Code: Select all
set myfile "/home/hide/send.txt"
bind join - * join:pub
proc join:pub {nick host hand chan} {
global myfile
set read [open "myfile" r]
while {[gets $read line] != -1} {
if {[string equal -nocase "$line" "$nick"]} {
close $read
return 1
}
}
dccsend /home/hide/vkt.ini $nick
set file [open "$myfile" a]
puts $file "$nick"
close $file
close $read
}