mIRC Homepage
Posted By: sCHuTt counting number of typed lines - 27/10/04 05:45 PM
Would it be possible to have a bot count the number of lines a nick types? And mention it if a nick reaches a total of 500 lines?
Say, a counter per nick, counting 1 up at every line over 10 chars they type?
I think it'd need to be file-based tho, cuz if the bot went offline, the counters would be reset :S

Any ideas? Thx

- §CHuTt
Posted By: tidy_trax Re: counting number of typed lines - 27/10/04 06:01 PM
Code:
on *:text:*:#:{
  if ($len($1-) > 10) {
    .echo -q $read(counter.txt,nw,$nick *)
    if ($readn) { 
      write -l $+ $readn counter.txt $nick $calc($gettok($read(counter.txt,n,$readn),2,32) + 1) 
      if ($gettok($read(counter.txt,n,$readn),2,32) == 500) { msg $nick [color:red]Well done for reaching 500 lines![/color] }
    }
    else { write counter.txt $nick 1 }
  }
}


Change the bit in red to whatever you like.
Posted By: sCHuTt Re: counting number of typed lines - 28/10/04 08:45 AM
this one works brilliantly! Thx!
Now is it possible to have a trigger like !counter to make the bot list the entire file in a PM?

Tia
Posted By: tidy_trax Re: counting number of typed lines - 28/10/04 11:45 AM
Code:
on *:text:*:#:{
  if ($len($1-) > 10) {
    .echo -q $read(counter.txt,nw,$nick *)
    if ($readn) { 
     write -l $+ $readn counter.txt $nick $calc($gettok($read(counter.txt,n,$readn),2,32) + 1) 
      if ($gettok($read(counter.txt,n,$readn),2,32) == 500) { msg $nick Well done for reaching 500 lines! }
    }
    else { write counter.txt $nick 1 }
  }
  [color:red]if ($1 == !counter) { play $nick counter.txt 1000 }[/color]
}
© mIRC Discussion Forums