| View previous topic :: View next topic |
| Author |
Message |
l.kleijn Voice
Joined: 18 May 2014 Posts: 33
|
Posted: Sat May 28, 2022 3:20 am Post subject: question |
|
|
Hi i have a little script and need some help with it.
| Code: | proc pub:global {nick host hand chan arg} {
global botnick opchan
if {[matchattr $hand G] == 1} {
if {$chan == "#IRCop"} {
return 0
}
foreach chan [channels] { putserv "PRIVMSG $chan :\002AANKONDIGING:\002 $nick: $arg" }
return 0
} else { putserv "NOTICE $nick :U hebt geen toegang." }
}
|
I want some help with it, if the channel is #IRCop it must say nothing.
Except other channels how do i change that ? |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat May 28, 2022 10:59 am Post subject: |
|
|
The simplest way imho is to add a flag to the channels to enable/disable the feature.
Now, I'm not sure to understand the query: do you want to disallow the usage of the pub command in channels or do you want to forbid the display of the message in channels ?
To block the command on channels:
| Code: | setudef flag nopub
proc pub:global {nick uhost handle chan text} {
if {[matchattr $hand G]} {
if {[channel get $chan nopub]} { return }
foreach c [channels] {
putserv "PRIVMSG $c :\002AANKONDIGING:\002 $nick: $text"
}
} else {
putserv "NOTICE $nick :U hebt geen toegang."
}
} |
To block the display of the message in channels:
| Code: | setudef flag nopub
proc pub:global {nick uhost handle chan text} {
if {[matchattr $hand G]} {
if {[string tolower $chan] eq "#ircop"} { return }
foreach c [channels] {
if {[channel get $c nopub]} { continue }
putserv "PRIVMSG $c :\002AANKONDIGING:\002 $nick: $text"
}
} else {
putserv "NOTICE $nick :U hebt geen toegang."
}
} |
And in the two case, you have to do .chanset #channel +nopub to forbid the usage or the display on #channel.
Note that the second script disallow the command in #ircop in any case _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
|