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
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

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

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

Post by ComputerTech »

Try this

Code: Select all

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

Message/Channel =  puthelp/putserv

Modes    =  putquick/putserv
ComputerTech
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

ComputerTech thanks for replying so quickly
works perfectly and it does what I asked for, thanks a lot.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Haven't tested this but should be a compact version of what you wanted:

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

if {![matchaddr $target $::botname]} return
with:

Code: Select all

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

Post by simo »

ive tested your version as well Caesar but it didnt seem to trigger and no errors returned
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

hola yo hablo español intente con esto (Hi, i speak spanish, try this)

Code: Select all

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"
  }
}
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Don't know if this is the best way of doing it.

Code: Select all

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 :P
ComputerTech
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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

Post by simo »

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

Post by simo »

tested it some more and this seems to work well:

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

Post by ComputerTech »

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

Thanks :wink:
ComputerTech
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, right, i forgot the

Code: Select all

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

Post by vam2u »

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

Post by simo »

try this vam2u :

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

Post by simo »

edited
Post Reply