This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

solicitud de guiones

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
vam2u
Voice
Posts: 31
Joined: Sat Mar 27, 2021 11:19 pm
Location: Malaysia

Post by vam2u »

Thanks for your prompt response @simo :-)
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
s
simo
Revered One
Posts: 1077
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

try this :

Code: Select all

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"
      }
   }
}
s
simo
Revered One
Posts: 1077
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

edited:

Code: Select all

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"
      }
   }
}
Online
User avatar
CrazyCat
Revered One
Posts: 1234
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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: Select all

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

Code: Select all

puthelp "Chanserv :deop $chan $nick"
Hope this helps :P
ComputerTech
s
simo
Revered One
Posts: 1077
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

he needed it for dalnet crazycat and dalnet doesnt use: privmsg chanserv
Online
User avatar
CrazyCat
Revered One
Posts: 1234
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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.
s
simo
Revered One
Posts: 1077
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

most networks use aliases tho including dalnet
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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

same with using /cs or or PRIVMSG Chanserv :P
ComputerTech
User avatar
vam2u
Voice
Posts: 31
Joined: Sat Mar 27, 2021 11:19 pm
Location: Malaysia

Post by vam2u »

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: Select all

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"
      }
   }
}
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

hi

Post by Gulio »

If u like try this too

Code: Select all


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

s
simo
Revered One
Posts: 1077
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
User avatar
vam2u
Voice
Posts: 31
Joined: Sat Mar 27, 2021 11:19 pm
Location: Malaysia

Post by vam2u »

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
Post Reply