| View previous topic :: View next topic |
| Author |
Message |
shag Voice
Joined: 13 Jul 2006 Posts: 3
|
Posted: Thu Jul 13, 2006 3:11 pm Post subject: Possible to count 2 things with one trigger? |
|
|
I'm currently trying to make a script that will count the voiced users in a specific chan, and also count the lines of a vertain file, and then display them both in one line like
There are x users and there are x lines in the file.
Thats just a short rundown, this is what I have so far.
| Code: | bind pub - !stats voiced
proc voiced {nick uhost hand chan arg} {
set i 0
set cname #chan
foreach n [chanlist $cname] {
if {[isvoice $n $cname]} { incr i }
}
puthelp "privmsg $chan :There are currently $i voices online!"
} |
|
|
| Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Thu Jul 13, 2006 5:08 pm Post subject: |
|
|
| Code: | bind pub - !stats voiced
proc voiced {nick uhost hand chan arg} {
set i 0
set cname #chan
foreach n [chanlist $cname] {
if { [isvoice $n $cname] } {
incr i
}
}
set fname "path/to/file.txt"
set fs [open $fname r]
set data [read $fs]
close $fs
set lines [split $data \n]
set length [llength $lines]
puthelp "PRIVMSG $chan :There are currently $i voices online and $length lines in ${fname}!"
return
} |
|
|
| Back to top |
|
 |
shag Voice
Joined: 13 Jul 2006 Posts: 3
|
Posted: Thu Jul 13, 2006 5:23 pm Post subject: |
|
|
| Wow man thanks I was trying to use set i 0 again and like change it to a different letter. Thanks for the help works great apreciate it greatly! |
|
| Back to top |
|
 |
|