| View previous topic :: View next topic |
| Author |
Message |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Tue Apr 25, 2006 11:13 am Post subject: check op % |
|
|
hi all, does anyone know if exists or can make a script that can count the % a bot is opped in a chan? i tried to search the forum and the tcl script archive but nothing like, so if someone can point a site or make one it would be great tks.
example:
<user> !opless #chan
<eggdrop> 75% without op on $chan
PS: the objective of this script is that i lend some bot to people, and if the bot stays there without op not doing anything theres no objective to be there just to fill up the chan |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Apr 26, 2006 4:47 am Post subject: |
|
|
modify the script to use '[isop $nick] || [ishalfop $nick]' instead of just '[isop $nick]'. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Apr 26, 2006 6:54 am Post subject: |
|
|
| sorry did understand,, modify what script? |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Apr 26, 2006 7:45 am Post subject: |
|
|
sorry, I somehow read after waking up, you would a scrpt that does not only count ops, but also halfops...
so you were looking for something like? | Code: | bind pub - !opless opless
proc opless {nick uhost hand chan text} {
if {![validchan $text] || ([channel get $text secret] && ![onchan $nick $text])} {
puthelp "NOTICE $nick :I am not on such channel"
return 0
}
set users [chanlist $text]
set total [llength $users]
set ops 0
foreach user $users {
if {[isop $user] || [ishalfop $user]} {
incr ops
}
}
puthelp "PRIVMSG $chan :[expr {100 - round(100.0 * $ops / $total)}]% without op on $text"
return 1
} |
_________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Apr 26, 2006 11:40 am Post subject: |
|
|
oh sorry, is nothing like that, maybe i explained myself wrong, its like this..
i run a channel were there are 4 bots that users can request for their channels so they can have a bot for them, and i want something to check from the time that bot spends on the channel what is the % of time that the op had ops, so i can know if the op is having op most of the time..
tks in advance |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Apr 26, 2006 6:01 pm Post subject: |
|
|
| or something like a timer to check if the bot is op and count the times is op for that chan and the times is not op, at the end off like a day he check the 2 variables and if the opless one is bigger than the other he notices me or leave the chan |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Apr 26, 2006 9:10 pm Post subject: |
|
|
| Code: | bind time - * deoprate
bind pub - !opless ratereply
set ratemins 0
proc deoprate args {
global deoprate ratemins
foreach c [channels]
if {![info exists deoprate([set c [string tolower $c]])]} { set deoprate($c) 0 }
if {![botisop $c]} { incr deoprate($c) }
}
incr ratemins
}
proc ratereply {nick uhost hand chan arg} {
global deoprate ratemins
if {[validchan [set c [lindex [split $arg] 0]]] && [info exists deoprate($c)]} {
puthelp "privmsg $chan :[expr {$deoprate($c)/$ratemins*100}]% without op on $c"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Wed Apr 26, 2006 9:34 pm Post subject: |
|
|
| do i have to set ratemins to something? |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Thu Apr 27, 2006 1:56 am Post subject: |
|
|
ignore my last post. just one more thing if isnt much trouble can u make the command !opless list all chans the bot is on instead of checking !opless #chann ?
tks in advance |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Apr 28, 2006 6:32 pm Post subject: |
|
|
| Code: | bind time - * deoprate
bind pub - !opless ratereply
set ratemins 0
proc deoprate args {
global deoprate ratemins
foreach c [channels]
if {![info exists deoprate([set c [string tolower $c]])]} { set deoprate($c) 0 }
if {![botisop $c]} { incr deoprate($c) }
}
incr ratemins
}
proc ratereply {nick uhost hand chan arg} {
global deoprate ratemins
foreach c [channels] {
if {[info exists deoprate($c)]} {
puthelp "privmsg $chan :[expr {$deoprate($c)/$ratemins*100}]% without op on $c"
}
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
.pt Halfop
Joined: 16 Nov 2005 Posts: 71
|
Posted: Sat Apr 29, 2006 9:00 pm Post subject: |
|
|
tks
best regards |
|
| Back to top |
|
 |
|