Thanx for the advise guys on the previous topics but no matter what i try i cannot get the bits you have suggested to work.
if i have say ftp://123.456.789.012
in templist.txt & some one /msg the egg with ADD ftp://123.456.789.012 all i need to work is that the egg will search templist.txt and 1) find it & 2) say sorry but ftp://123.456.789.012 is already in
templist.txt } else { write it to templist.txt, is there anything else i could try ??
Many Many thanx again & no the file is very small & nowhere near 500Mb - lol
Nero, you're doing something wrong in the other part of the script. All of our suggestions for finding lines (including your *own* code) work just fine.
If you want help with the other part of the code, you will have to post it.
set ftp_file "/home/path/to/your/bot/templist.txt"
set ftp_site ""
bind msg - add add_ftp_site
proc add_ftp_site {nick host hand chan text} {
global ftp_file ftp_site
set ftp_site "$text"
set fs [open $ftp_file r]
while {![eof $fs]} {
gets $fs line
if {[string match "$ftp_site*" $line]} {
putserv "MSG $nick :Sorry but $ftp_site is already in the list!"
close $fs
} else {
set ap [open $ftp_file a]
puts $ap "$ftp_site"
putserv "MSG $nick :$ftp_site has been added to the list."
close $ap
}
}
}
I think that'll work, don't kill me if it doesn't I didn't have the time to test it