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.

Notice all Ops on command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
A
Ajax87
Voice
Posts: 2
Joined: Fri Mar 03, 2006 3:39 pm

Notice all Ops on command

Post by Ajax87 »

Hi, I want my eggdrop bot to send a Notice message to ALL ops in a channel when anyone shouts !admin. I'm sure this must be doable, but it's beyond me.

The reason is I'm setting up our server reports to feed into IRC, so this will allow someone on the server to call for an admin by typing "/irc !admin" ingame :). Neat eh :).
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

This should of been posted on Script Request but

Code: Select all

# this is the channel where you want the script to work on
set ::admin(chan) "#channel"

bind pub -|- !admin pub:admin

proc pub:admin {nickname hostname handle channel text} {
 if {[string match -nocase "$::admin(chan)" $channel]} {
  foreach user [chanlist $channel] {
   if {[isop $user $channel]} {
    putserv "NOTICE $user :Admin request by $nickname in $channel."
   }
  }
 }
}
r0t3n @ #r0t3n @ Quakenet
A
Ajax87
Voice
Posts: 2
Joined: Fri Mar 03, 2006 3:39 pm

Post by Ajax87 »

apologies, and thanks also.
s
syfx
Voice
Posts: 6
Joined: Wed Jun 15, 2005 12:29 pm

Post by syfx »

Hi guys, im looking for a script that is very similar to this, but instead of NOTICE 'ing 1 user, could the script above be modified to output the ':Admin request by $nickname in $channel' into another IRC channel?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Improved since tosser's script will only use lots of messages for no good reason. :roll:

Code: Select all

# this is the channel where you want the script to work on
set adminchan "#channel"

bind pub -|- !admin pub:admin

proc pub:admin {nickname hostname handle channel text} {
  global adminchan; set list ""
  if {[string equal -nocase $adminchan $channel]} {
    foreach user [chanlist $channel] {
      if {[isop $user $channel]} {
        lappend list $user
      }
    }
    if {[llength $list]} {
      putserv "NOTICE [join $list ,] :Admin request by $nickname in $channel."
    }
  }
}
Also, to pm into a different channel

Code: Select all

# this is the channel where you want the script to work on
set userchan #channel
# this is the channel the messages gets sent too.
set adminchan #channel2

bind pub -|- !admin pub:admin

proc pub:admin {nickname hostname handle channel text} {
  global userchan adminchan; set list ""
  if {[string equal -nocase $userchan $channel]} {
    putserv "PRIVMSG $adminchan :Admin request by $nickname in $channel."
  }
}
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

MeTroiD wrote:Improved since tosser's script will only use lots of messages for no good reason. :roll:
The only reason would be compatibility with all networks, since a few might have set max targets to 1. Its a pity eggdrop doesnt parse/save the init strings for purposes like max target lookup etc. ^-^. Theoretically you could dynamically limit the target number... but probably it is 1 or 20 and there will never be 20 admins only :D.
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...
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Some ircds support "status messages", so

Code: Select all

putserv "PRIVMSG @$adminchan :Admin request by $nickname in $channel."
is possible on those to send a message to chanops.
M
Minus
Voice
Posts: 8
Joined: Sat Jul 01, 2006 4:42 pm

Post by Minus »

how can i make it so if a user sayes in any channel ex :

I need a bnc please help

the eggdrop takes the keyword ex "bnc" and say in the adminchan "I need a bnc please help $nickname $channel"
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

How would you go about making the script noctice the user typing the command, like:

user:!staff
-bot- Staff has been notified, please be patient.

*EDIT* Okay I fixed it, I just added:

Code: Select all

putserv "NOTICE $nickname :Notice send to staff, please be patient."
Post Reply