egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

check op %

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Tue Apr 25, 2006 11:13 am    Post subject: check op % Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Apr 26, 2006 4:47 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Wed Apr 26, 2006 6:54 am    Post subject: Reply with quote

sorry did understand,, modify what script?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Apr 26, 2006 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Wed Apr 26, 2006 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Wed Apr 26, 2006 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Apr 26, 2006 9:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Wed Apr 26, 2006 9:34 pm    Post subject: Reply with quote

do i have to set ratemins to something?
Back to top
View user's profile Send private message
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Thu Apr 27, 2006 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Apr 28, 2006 6:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
.pt
Halfop


Joined: 16 Nov 2005
Posts: 71

PostPosted: Sat Apr 29, 2006 9:00 pm    Post subject: Reply with quote

tks Smile

best regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber