hmm...i try to write like this:
set files(1) "/blah/blah/new.txt"
set files(2) "/blah/blah/file3.txt"
set files(3) "/blah/blah/file2.txt"
set files(4) "/blah/blah/file1.txt"
if {![file exist files(1)]} { set f [open $files(1) a+]; close $f }
if {![file exist files(2)]} { set f [open $files(2) a+]; close $f }
if {![file exist files(3)]} { set f [open $files(3) a+]; close $f }
if {![file exist files(4)]} { set f [open $files(4) a+]; close $f }
proc add_url {nick host hand text} {
global files
set a [open $files(1) r+]
set b [read $a]
set c [open $files(2) r+]
set d [read $c]
set e [open $files(3) r+]
set f [read $e]
if {[string match -nocase "*$text*" $b]||[string match -nocase "*$text*" $d]||[string match -nocase "*$text*" $f]} {
return 0
}
seek $a 0 end
seek $c 0 end
seek $e 0 end
puts $a {text}
catch {close $a}
but my bot only detect if the url already on new file, then i add a different url (that not exist in new file but already exist in file1) example
http://bot.com, my bot cant detect it and then add it to new file, even if i add it again, the bot still add it to new file (so,
http://bot.com becomes double in new file)
