| View previous topic :: View next topic |
| Author |
Message |
flink Halfop

Joined: 21 Feb 2021 Posts: 53 Location: Canarias
|
Posted: Sun Mar 21, 2021 12:07 pm Post subject: |
|
|
simo thank you very much
works perfectly, just what I needed.
how would it be to exclude the owner of the eggdrop who can -o ,+b, etc
I included it to send a memo to the owner of the eggdrop in case it is useful to someone who needs it:
| Code: | bind mode - "*-*o*" protect:autoreop
proc protect:autoreop {nick uhost hand chan mode target} {
global botnick
if {($target == $botnick) && ($nick != $botnick)} {
putnow "privmsg chan op $chan $botnick"
putnow "mode $chan -o $nick"
putnow "privmsg $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
putnow "privmsg MEMO send owner :$nick removed @ from $chan's $botnick"
}
}
bind mode - "* +b" prot_banX
proc prot_banX {nick uhost hand chan mc ban} {
global botnick botname
if {[string match "$ban" "$botname"]} {
putnow "privmsg chan unban $chan $botnick"
putnow "privmsg $nick :\002what you are doing is not helping the smooth running of the channel\002"
putnow "privmsg MEMO send owner :$nick bans $botnick from $chan"
putnow "mode $chan -o $nick"
}
} |
thank you in advance for all the help provided, thanks to people like you, this does not fall into oblivion. |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sun Mar 21, 2021 1:57 pm Post subject: |
|
|
Try this
| Code: |
bind MODE - "*-*o*" protect:autoreop
proc protect:autoreop {nick uhost hand chan mode target} {
global botnick
if {[matchattr $hand "n"]} {
return 1 }
if {($target == $botnick) && ($nick != $botnick)} {
putnow "PRIVMSG chan op $chan $botnick"
puthelp "PRIVMSG $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
puthelp "PRIVMSG memo send owner :$nick removed @ from $chan's $botnick"
putquick "MODE $chan -o $nick"
}
}
bind MODE - "* +b" prot_banX
proc prot_banX {nick uhost hand chan mc ban} {
global botnick botname
if {[matchattr $hand "n"]} {
return 1 }
if {[string match "$ban" "$botname"]} {
putserv "PRIVMSG chan unban $chan $botnick"
puthelp "PRIVMSG $nick :\002what you are doing is not helping the smooth running of the channel\002"
putserv "PRIVMSG MEMO send owner :$nick bans $botnick from $chan"
putquick "MODE $chan -o $nick"
}
}
|
Tips:
try to avoid using putnow when possible, for example
| Code: |
Message/Channel = puthelp/putserv
Modes = putquick/putserv
|
_________________ ComputerTech |
|
| Back to top |
|
 |
flink Halfop

Joined: 21 Feb 2021 Posts: 53 Location: Canarias
|
Posted: Sun Mar 21, 2021 3:53 pm Post subject: |
|
|
ComputerTech thanks for replying so quickly
works perfectly and it does what I asked for, thanks a lot. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Mar 22, 2021 4:04 am Post subject: |
|
|
Haven't tested this but should be a compact version of what you wanted:
| Code: |
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
puthelp "PRIVMSG Chan dop $chan $nick"
puthelp "PRIVMSG Chan op $chan $botnick"
puthelp "PRIVMSG $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
puthelp "PRIVMSG Memo send owner :$nick removed @ from $chan's $botnick"
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} {
puthelp "MODE $chan -b $target"
} else {
puthelp "PRIVMSG chan unban $chan $botnick"
puthelp "PRIVMSG Chan op $chan $botnick"
}
puthelp "PRIVMSG $nick :\002what you are doing is not helping the smooth running of the channel\002"
puthelp "PRIVMSG Memo send owner :$nick banned $target on $chan that is matching my address."
}
}
}
|
The matchaddr command doesn't exist in eggdrop versions below 1.6.20 if recall right, so in case you run an older version replace:
| Code: |
if {![matchaddr $target $::botname]} return
|
with:
| Code: |
if {![string match -nocase $target $::botname]} return
|
I've used puthelp that uses a slower queue, so adjust to whatever you wish. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Mar 22, 2021 11:03 am Post subject: |
|
|
| ive tested your version as well Caesar but it didnt seem to trigger and no errors returned |
|
| Back to top |
|
 |
Arnold_X-P Master

Joined: 30 Oct 2006 Posts: 221 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Mon Mar 22, 2021 10:23 pm Post subject: |
|
|
hola yo hablo espaņol intente con esto (Hi, i speak spanish, try this)
| Code: | bind mode - "*-o*" antideopbot
proc antideopbot {nick uhost hand chan mc arg} {
global botnick
if {[isbotnick $arg] && ![matchattr $hand mn|mn $chan]} {
putquick "PRIVMSG chan op $chan $botnick"
putserv "PRIVMSG $chan :no me bajes $nick soy un bot administrador no te pases, respeta" -next
putserv "mode $chan -o $nick"
}
} |
_________________
thanks to that they help, that others learn  |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Tue Mar 23, 2021 12:20 am Post subject: |
|
|
Don't know if this is the best way of doing it.
| Code: |
bind MODE - "*-*o*" protect:bot
bind MODE - "* +b" protect:bot
proc protect:bot {nick uhost hand chan mode target} {
global botnick owner
if {[matchattr $hand "n"] && [$target == $botnick] && [$nick == $botnick]} {return 1}
switch -- $mode {
"*-*o*" {
putquick "PRIVMSG chan op $chan $botnick"
puthelp "PRIVMSG $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
putserv "PRIVMSG memo send $owner :$nick removed @ from $chan's $botnick"
putquick "MODE $chan -o $nick"
}
"* +b" {
if {[string match "$target" "$botnick"]} {
putserv "PRIVMSG chan unban $chan $botnick"
puthelp "PRIVMSG $nick :\002what you are doing is not helping the smooth running of the channel\002"
putserv "PRIVMSG MEMO send owner :$nick bans $botnick from $chan"
putquick "MODE $chan -o $nick"
}
}
}
}
|
Untested  _________________ ComputerTech |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 23, 2021 1:44 am Post subject: |
|
|
@simo by any chance you had n flag? that's the only option that makes sense not to trigger anything.
@ComputerTech since I put the switch there we don't need to bind everything separately.
Also, use isbotnick when you want to check if any given nick is bot, I mean instead of [$target == $botnick] or [$nick == $botnick]} use [isbotnick $target] or [isbotnick $nick] _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Mar 23, 2021 2:01 am Post subject: |
|
|
I thought of that before i tested as well Caesar and to be sure i
Removed that line
if {[matchattr $hand n]} return
and it still didn't trigger |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Mar 23, 2021 3:29 am Post subject: |
|
|
tested it some more and this seems to work well:
| Code: |
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
if {[isbotnick $target]} {
puthelp "privmsg chan op $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} {
puthelp "mode $chan -b $target"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
} else {
puthelp "privmsg chan unban $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
}
|
thanks Caesar for combining the 2 proc into 1 |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Tue Mar 23, 2021 11:17 am Post subject: |
|
|
Ah true caesar, i was thinking the binds were not triggering, and yeah i didn't think the rest out
Thanks  _________________ ComputerTech |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 23, 2021 2:58 pm Post subject: |
|
|
Ah, right, i forgot the
| Code: |
if {[isbotnick $target]} {
|
part. Well, glad you sorted out. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
vam2u Voice

Joined: 27 Mar 2021 Posts: 20 Location: Malaysia
|
Posted: Thu Jun 17, 2021 9:53 am Post subject: |
|
|
It looks like i'm not able to get it work on Dalnet, anyone can give me a helping hand
| simo wrote: | tested it some more and this seems to work well:
| Code: |
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
if {[isbotnick $target]} {
puthelp "privmsg chan op $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} {
puthelp "mode $chan -b $target"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
} else {
puthelp "privmsg chan unban $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
}
|
thanks Caesar for combining the 2 proc into 1 |
|
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Jun 17, 2021 5:04 pm Post subject: |
|
|
try this vam2u :
| Code: |
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
if {[isbotnick $target]} { puthelp "chanserv op $chan $botnick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} { puthelp "mode $chan -b $target" } else { puthelp "chanserv unban $chan $botnick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
|
|
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Jun 17, 2021 5:28 pm Post subject: |
|
|
| edited |
|
| Back to top |
|
 |
|