if I remember correctly opening in "a" mode, it will automatically always set the accesspoint of that file to the end of the file, thus adding a blank line at the end
and no, your proc doesn't have any way of checking if a line is blank
bind pub f .click my:click
proc my:click {nick uhost hand chan text} {
set list [split [read [set f [open "koc.db" r]]][close $f] \n]
set i 0
foreach bla $list {
if {[llength $bla] < 2} {
continue
}
if {[expr [unixtime] - [lindex $bla 1]] >= 86400} {
putserv "PRIVMSG $chan :[lindex $bla 0]"
incr i
}
}
if {$i} {
putserv "PRIVMSG $chan :Search complete.. Found \002$i\002 result[expr {$i==1?"":"s"}].."
} {
putserv "PRIVMSG $chan :Sorry, no links have been found to be clicked. Try again later."
}
}
Any sugestions are welcomed.
Once the game is over, the king and the pawn go back in the same box.
you could add a cleanup...
it could check for the time difference -> delete the line
else you dbase will become quite large by the time, thats not nescessary since only the latest 24h links seam to be of interrest
My interest in this is have all possible links I've clicked till now in my database cos I don't want to use anymore the channel bot cos is usualy lagged and when I try to click some links it dosen't tell me corectly what links should I click cos sometemes it quits with excess flood .. so, that's why I want to make a personal database Now I should think of an way to add the result of the clicked links in to the database..
Once the game is over, the king and the pawn go back in the same box.