This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

sugestion

Old posts that have not been replied to for several years.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

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

Code: Select all

if {[llength $bla] < 2} {continue}
add something like this to check for blank lines
Elen sila lúmenn' omentielvo
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Papillon wrote:add something like this to check for blank lines
as i said, check for them or just don't put them in there the first way ;)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

exactly :mrgreen:
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Here is the finished *click* code:

Code: Select all

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. :D
Once the game is over, the king and the pawn go back in the same box.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

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
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
Locked