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 

Checking for ops in channels and reporting

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


Joined: 17 Sep 2007
Posts: 2

PostPosted: Tue Sep 18, 2007 11:37 am    Post subject: Checking for ops in channels and reporting Reply with quote

Hi,

I hope someone can help with this question.

When my bot joins channels, is it possible for it to set a timer and check it's Op or Hop status ever x mins? If it is opped, i would like it reported into a specific channel.

I know there are several scripts that check for Ops status, but i have a specific need for the base code. If anyone can help, it would be much appriciated. Thank you
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Sep 18, 2007 8:52 pm    Post subject: Re: Checking for ops in channels and reporting Reply with quote

MetalGuru1972 wrote:
Hi,

I hope someone can help with this question.

When my bot joins channels, is it possible for it to set a timer and check it's Op or Hop status ever x mins? If it is opped, i would like it reported into a specific channel.

I know there are several scripts that check for Ops status, but i have a specific need for the base code. If anyone can help, it would be much appriciated. Thank you


This is should work as you want it too.

Quote:

- It will check every 5 minutes.
- You can replace value 5 in both timers to set what ever value you want.
- Replace #reportchannel to the channel you want to report it to.



Code:

bind join - "*" check:ops

proc check:ops {nick uhost hand chan} {
 if {[isbotnick $nick]} {
  timer 5 [list see:ops $chan]
  }
}

proc see:ops {chan} {
 if {[botonchan $chan]} {
  set ops 0; set voices 0
   foreach user [chanlist $chan] {
    if {[isop $user $chan]} {
    incr ops
    } elseif {[isvoice $user $chan]} {
     incr voices
    }
   }
   if {[botisop $chan]} {
    putserv "PRIVMSG #reportchannel :Ops: $ops - Voices: $voices"
    }
  }
 timer 5 [list see:ops $chan]
}


*** For this script to work you have to make the bot join the channel.
- Either restart the bot or make it cycle the channel.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
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