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 

solicitud de guiones
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
flink
Voice


Joined: 21 Feb 2021
Posts: 22
Location: Canarias

PostPosted: Sun Mar 21, 2021 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Sun Mar 21, 2021 1:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
flink
Voice


Joined: 21 Feb 2021
Posts: 22
Location: Canarias

PostPosted: Sun Mar 21, 2021 3:53 pm    Post subject: Reply with quote

ComputerTech thanks for replying so quickly
works perfectly and it does what I asked for, thanks a lot.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Mon Mar 22, 2021 4:04 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Mon Mar 22, 2021 11:03 am    Post subject: Reply with quote

ive tested your version as well Caesar but it didnt seem to trigger and no errors returned
Back to top
View user's profile Send private message
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 210
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Mon Mar 22, 2021 10:23 pm    Post subject: Reply with quote

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"
  }
}

_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Tue Mar 23, 2021 12:20 am    Post subject: Reply with quote

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 Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Tue Mar 23, 2021 1:44 am    Post subject: Reply with quote

@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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Tue Mar 23, 2021 2:01 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Tue Mar 23, 2021 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Tue Mar 23, 2021 11:17 am    Post subject: Reply with quote

Ah true caesar, i was thinking the binds were not triggering, and yeah i didn't think the rest out Razz

Thanks Wink
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Tue Mar 23, 2021 2:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Thu Jun 17, 2021 9:53 am    Post subject: Reply with quote

It looks like i'm not able to get it work on Dalnet, anyone can give me a helping hand Smile



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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Thu Jun 17, 2021 5:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Thu Jun 17, 2021 5:28 pm    Post subject: Reply with quote

edited
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 -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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