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
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri Jun 18, 2021 1:36 am    Post subject: Reply with quote

Thanks for your prompt response @simo Smile
It work out nicely now!
If it can punish (deop the user) who deop or ban the bot nick will be even greater.

simo wrote:
edited
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Fri Jun 18, 2021 12:57 pm    Post subject: Reply with quote

try this :

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 "mode $chan -o $nick" }
         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 "mode $chan -o $nick" } else {   puthelp "chanserv unban $chan $botnick"  ; puthelp "chanserv deop $chan $nick" }
         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: Sat Jun 19, 2021 11:07 am    Post subject: Reply with quote

edited:

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 :\002 $nick what you are doing is not helping the smooth running of the channel\002"
         puthelp "chanserv deop $chan $nick"
         puthelp "chanserv op $chan $botnick"
 }
      }
      "+b" {
         if {![matchaddr $target $::botname]} return
         if {[botisop $chan]} {  puthelp "mode $chan -b $target"  ;  puthelp "mode $chan -o $nick" } else {   puthelp "chanserv unban $chan $botnick"  ; puthelp "chanserv deop $chan $nick" }
         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
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 848
Location: France

PostPosted: Sat Jun 19, 2021 12:15 pm    Post subject: Reply with quote

My 2 cents: using puthelp "PRIVMSG ChanServ :deop $chan $nick" might be better than puthelp "chanserv deop $chan $nick" as the command chanserv is a server-specific alias.
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Sat Jun 19, 2021 12:56 pm    Post subject: Reply with quote

CrazyCat wrote:
My 2 cents: using puthelp "PRIVMSG ChanServ :deop $chan $nick" might be better than puthelp "chanserv deop $chan $nick" as the command chanserv is a server-specific alias.


Yep! that is correct, although in DalNET(following users above request to make it work for DalNET), you have to either use
Code:

puthelp "PRIVMSG ChanServ@services.dal.net :deop $chan $nick"

Or
Code:

puthelp "Chanserv :deop $chan $nick"


Hope this helps Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Sat Jun 19, 2021 1:27 pm    Post subject: Reply with quote

he needed it for dalnet crazycat and dalnet doesnt use: privmsg chanserv
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 848
Location: France

PostPosted: Sat Jun 19, 2021 2:54 pm    Post subject: Reply with quote

So you'd better use PRIVMSG chanserv@services.dal.net to have a script which can work everywhere (just need to change the host).
Using the alias is imho a bad idea, because it could be really restrictive.
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Sat Jun 19, 2021 5:47 pm    Post subject: Reply with quote

most networks use aliases tho including dalnet
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Sat Jun 19, 2021 8:51 pm    Post subject: Reply with quote

I personally just use PRIVMSG chanserv@services.dal.net

same with using /cs or or PRIVMSG Chanserv Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Wed Jun 30, 2021 10:11 am    Post subject: Reply with quote

Sorry for my late update @simo, it works well so far.
But there is 1 observation, when other op deop in channel it will trigger the bot to perform "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"


simo wrote:
edited:

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 :\002 $nick what you are doing is not helping the smooth running of the channel\002"
         puthelp "chanserv deop $chan $nick"
         puthelp "chanserv op $chan $botnick"
 }
      }
      "+b" {
         if {![matchaddr $target $::botname]} return
         if {[botisop $chan]} {  puthelp "mode $chan -b $target"  ;  puthelp "mode $chan -o $nick" } else {   puthelp "chanserv unban $chan $botnick"  ; puthelp "chanserv deop $chan $nick" }
         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
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Fri Jul 02, 2021 12:07 am    Post subject: hi Reply with quote

If u like try this too

Code:


bind mode - "*-*o*" self-pro:autoreop

proc self-pro:autoreop {nick uhost hand chan mode target} {
   global botnick
   if {($target == $botnick)} {
      putquick "cs op $chan"
   }
}


bind kick - * prot:kick

proc prot:kick {nick uhost handle channel theone arg} {
   global botnick
   if {[string tolower $theone] == [string tolower $botnick] } {
      if {[matchattr handle o]} { return 0 }
      putserv "cs unban $channel"
      putserv "cs invite $channel"
      putserv "join $channel "
      pushmode $channel +o $botnick
      return 0
   }
}

bind mode - "* +b" prot_ban

proc prot_ban {nick uhost hand chan mc ban} {
   global botnick botname
   if {[string match "$ban" "$botname"]} {
      putserv "cs unban $chan $botnick"
   } else {
      set pnicks ""
      foreach user [chanlist $chan b] {
         if {[matchattr [nick2hand $user $chan] o]} {lappend pnicks $user}
      }
      foreach pnick $pnicks {
         if {[string match "$ban" "$pnick![getchanhost $pnick $chan]"]} {
            putserv "cs unban $chan $botnick"
         }
      }
   }
}

Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Sat Jul 03, 2021 1:44 pm    Post subject: Reply with quote

when a random chanops gets deopped it sends out the text?

that seems odd since its checks if the BOT is deopped and only the BOT
Back to top
View user's profile Send private message
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Tue Jul 13, 2021 2:07 am    Post subject: Reply with quote

Yes, it's weird when other op in the channel deop, it will trigger the message as well. I tried it a few times, it does happen.
For now I comment off the message.
Thanks for following up @simo

simo wrote:
when a random chanops gets deopped it sends out the text?

that seems odd since its checks if the BOT is deopped and only the BOT
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
Page 3 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