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.

X Protection Script

Old posts that have not been replied to for several years.
Locked
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

X Protection Script

Post by blood_x »

TCL Script as below;

set x(channels) "#chan1 #chan2"

bind kick - "*" kick:extract
bind mode - "* +b" xstuff:ban

# Suspend
proc kick:extract {nick uh hand chan vict reas} {
global botnick
if {$nick != "X"} { return }
set kicker [string trim [lindex [split $reas] 0] {()}]
if {$vict == $botnick} {
putserv "PRIVMSG X :suspend $chan ${kicker} 7 d 340" }
return }

# Unban
proc xstuff:ban {nick uhost hand chan mc ban} {
global botnick botname
set bmask "*!*@[lindex [split $uhost @] 1]"
if {[string match "$ban" "$botname"] && [botisop $chan]} {
if {[string match "$bmask" "$botname"]} { set bmask [maskhost *!*[string trimleft $uhost ~]]}
putserv "MODE $chan -bo+b $ban $nick $bmask"
putserv "KICK $chan $nick :Not Allowed - Banning Service Bot" }
return }

By using this script, someone who kick or ban channel bot (eggdrop) using X on undernet.org will get suspend. Here, how to add if someone deop the bot (eggdrop) using X? In other word, if someone deop the bot using X, he/she will also get suspended.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

A lil tweak to your (wich look a LOT with the ones from xstuff.tcl heh) codes:

Code: Select all

# Suspend 
proc kick:extract {nick uh hand chan vict reas} {
  if {$nick == "X" && [isbotnick $vict]} {
    set kicker [string trim [lindex [split $reas] 0] {()}] 
    putserv "PRIVMSG X :suspend $chan $kicker 7 d 340"
  }
}

# Unban 
proc xstuff:ban {nick uhost hand chan mc ban} { 
  global botnick botname 
  if {![string match -nocase $ban $botname] || ![botisop $chan]} {
    return
  }
  set bmask "*!*@[lindex [split $uhost @] 1]" 
  if {[string match "$bmask" "$botname"]} {
    set bmask [maskhost *!*[string trimleft $uhost ~]]
  } 
  putserv "MODE $chan -bo+b $ban $nick $bmask" 
  putserv "KICK $chan $nick :Not Allowed - Banning Service Bot"
} 
If you intend or use the x(channels) variable to *mark* the channels where you want a specific thing to happen better use setudef (check the doc files), as for the on-deop a "bind mode" should do the trick.
Once the game is over, the king and the pawn go back in the same box.
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Yeah, I think it is from xstuff.tcl.. I don't remember it coz I've remove some unneeded proc for my customization.. Argh, can you give direct foward example.. cause I'm really busy to read a README.. hehe.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Nah, I'm way to lazy atm. :mrgreen:
Once the game is over, the king and the pawn go back in the same box.
Locked