This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Checking for ops in channels and reporting

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
M
MetalGuru1972
Voice
Posts: 2
Joined: Mon Sep 17, 2007 5:41 pm

Checking for ops in channels and reporting

Post by MetalGuru1972 »

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Re: Checking for ops in channels and reporting

Post by awyeah »

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.
- 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: Select all

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.
==================================
Post Reply