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 

sending a message to all ops on a channel [Solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
jeremie
Voice


Joined: 30 Aug 2007
Posts: 9

PostPosted: Sun Sep 09, 2007 4:06 pm    Post subject: sending a message to all ops on a channel [Solved] Reply with quote

I have been writing a script which warns somebody if they say a banned word on a channel.

It sends a warning to that person and I want it to send a private message to all ops on the channel.

I know how to send it as a notice but the ops would rather have it sent to them as a private message.

I have looked in as many places I can think of and not found any solution.

Will somebody please help me with this?


Last edited by jeremie on Mon Sep 24, 2007 11:10 am; edited 1 time in total
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Sep 10, 2007 7:12 am    Post subject: Re: sending a message to all ops on a channel Reply with quote

Try this
Code:
foreach target [chanlist $dest] {
 if {[isop $target $dest]} {
  puthelp "PRIVMSG $target :$warning"
 }
}
Please set dest to what the #channel_name is, and warning to the message it will send to the ops. You can also make this into a proc by doing.
Code:
proc msg_ops {text} {
 set dest [lindex [split $text] 0]
  set warn [join [lrange [split $text] 1 end]]
   foreach target [chanlist $dest] {
    if {[isop $target $dest]} {
     puthelp "PRIVMSG $target :$warn"
    }
   }; return 1
}
The use msg_ops "#channel some_warning_message" in your script to send a private warning to all ops on the channel. Smile Hope it helps.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Sep 10, 2007 4:27 pm    Post subject: Reply with quote

You're msg_ops proc is bad, you should check the dest syntax correctly, see if the channel is added etc...

Code:
proc msg_ops {channel msg} {
    if {![validchan $channel]} { return }
    if {$msg == ""} { return }
    foreach user [chanlist $channel] {
        if {$user != "" && [isop $user $channel]} {
            puthelp "PRIVMSG $user :[join $msg]"
        }
    }
    return 1
}

_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
jeremie
Voice


Joined: 30 Aug 2007
Posts: 9

PostPosted: Mon Sep 10, 2007 4:29 pm    Post subject: [Solved] sending a message to all ops on channel Reply with quote

I tried that and it worked perfectly.

Thank you TCL_no_TK and Tosser^^

Smile
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Sep 12, 2007 3:29 am    Post subject: Reply with quote

You will need this if the bot is op, so it doesn't need to message itself, heh.

Code:

proc msg_ops {channel msg} {
    if {![validchan $channel]} { return }
    if {$msg == ""} { return }
    foreach user [chanlist $channel] {
        if {$user != "" && [isop $user $channel] && ![isbotnick $user]} {
            puthelp "PRIVMSG $user :[join $msg]"
        }
    }
    return 1
}

_________________
·­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
jeremie
Voice


Joined: 30 Aug 2007
Posts: 9

PostPosted: Wed Sep 12, 2007 2:42 pm    Post subject: Reply with quote

I'm not sure how you knew I was trying to work that one out too.

I have added that now and it's even better than before.

Thank you awyeah.

Smile
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 -> Scripting Help 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