mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 21
S
sCHuTt Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2004
Posts: 21
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

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.


New username: hixxy
Joined: Aug 2004
Posts: 21
S
sCHuTt Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2004
Posts: 21
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

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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]
}


New username: hixxy

Link Copied to Clipboard