Code: Select all
proc handle:need {channel need} {
if {![matchattr Q "|o" $channel]} {
if {![matchattr L "|o" $channel]} { return 0 }
switch $need {
op {
putserv "PRIVMSG L :op $channel" -next
return 1
}
unban {
putserv "PRIVMSG L :UNBANALL $channel" -next
}
invite {
putserv "PRIVMSG L :INVITE $channel" -next
}
limit {
putserv "PRIVMSG L :CLEARCHAN $channel" -next
}
key {
putserv "PRIVMSG L :CLEARCHAN $channel" -next
}
default {
putserv "PRIVMSG L :CLEARCHAN $channel" -next
}
}
utimer 1 [subst "putserv \"JOIN $channel\" -next"]
return 1
}
switch [...]
}
so, this is the complet script this time and its complete my own (oh my god ). plz forgive the puzzling if statments, i was having problems using else and elseif, so i had to find a way without . if you think the more code could be the trouble i'll try to optimize the code. a tried to keep cpu usage low, so i saved some commands outputs like [nick2hand $nick]. i started using putserv to deop people, but found back to pushmode.
Code: Select all
#De Kus' Channellamer Script. Especially for Chans with op for all a must have! :)
#Current Feature:
# - removes key and limit from not authorised persons and deops them.
# - ensures to get a handle for this user to keep him deopt.
# - global deop up to channel kickban for botkickers! (to disable just set # in front of the bind line of botripper)
#version 1.1
#1.0 : 11.12.02 channellamer and addnewuser completed and functional in satisfiing way, so i called this 1.0 final :)
#1.0.1: 16.12.02 Added botripper in alpha stat (non tested)
bind mode - * channellamer
#script to deop non-master key setter oder master deopper permanently
#non master l below 5 will be deletet and non op will be deopt permanently
proc channellamer {nick uhost hand chan mode victim} {
global botnick
set handle [nick2hand $nick]
if { [matchattr $hand "m|m" $chan] || !(($mode == "+k") || ($mode == "-o") || ($mode == "+l")) || ($botnick == "$nick")} { return 0 }
if { $mode == "-o" } {
set victimhandle [nick2hand $victim]
if { [matchattr $victimhandle "m|m" $chan] } {
pushmode $chan -o "$nick"
pushmode $chan +o "$victim"
flushmode $chan
if { [matchattr $handle "d|d" $chan] } { return 1 }
set newhandle $handle
if { $hand == "*" } {
set newhandle [addnewuser $nick $uhost]
}
chattr $newhandle |-o+d $chan
putserv "NOTICE $chan :Deoplamer $newhandle gegen $victimhandle erfolgreich deoppt."
putcmdlog "Deopper $newhandle gegen $victimhandle auf $chan deoppt am [ctime [unixtime]]."
setuser $newhandle COMMENT "Deoppte $victimhandle auf $chan am [ctime [unixtime]]."
return 1
}
return 0
}
if { $mode == "+l" } {
if { $victim < 5 } {
pushmode $chan -l
pushmode $chan -o $nick
if { [matchattr $handle "o|o" $chan] || [matchattr $handle "f|f" $chan] || [matchattr $handle "d|d" $chan] } { return 1 }
set newhandle $handle
if { $hand == "*" } {
set newhandle [addnewuser $nick $uhost]
}
chattr $newhandle |-o+d $chan
putserv "NOTICE $chan :Lowlimitlamer $newhandle erfolgreich deoppt."
putcmdlog "$newhandle wegen Limitsetzen auf $victim auf $chan deoppt am [ctime [unixtime]]."
setuser $newhandle COMMENT "Setzte Limit $victim auf $chan am [ctime [unixtime]]."
return 1
}
return 0
}
pushmode $chan -o "$nick"
pushmode $chan -k "$victim"
pushmode $chan -i
flushmode $chan
if { [matchattr $handle "d|d" $chan] } { return 1 }
set newhandle $handle
if { $hand == "*" } {
set newhandle [addnewuser $nick $uhost]
}
chattr $newhandle |-o+d $chan
putserv "NOTICE $chan :Keylamer $newhandle erfolgreich deoppt."
putcmdlog "Keysetzer $newhandle auf $chan deoppt by channellamer am [ctime [unixtime]]."
setuser $newhandle COMMENT "Setzte auf $chan ein Key am [ctime [unixtime]]."
return 1
}
#function to ensure to get a new user and returns the new handle name
proc addnewuser {nick uhost} {
set handle $nick
if { !([adduser $nick [maskhost $uhost]]) } {
set handle bad[rand 999999]
if { !([adduser $handle [maskhost $uhost]) } { return * }
}
return $handle
}
bind kick - "* $botnick" botripper
proc botripper { $nick $host $handle $chan $target $reason } {
if { [matchattr $handle "f|f" $chan] || [matchattr $hand "m|m" $chan] || [matchattr $handle "o|" $chan]} { return 0 }
if { [matchattr $handle "|o" $chan] } {
chattr $handle |-o $chan
putserv "NOTICE $nick :Nein, so geht das nicht. Ich weiß, du hast Op hier, aber mich wird nicht gekickt, lass das einen Channelmaster oder -friend machen und lass das!"
putserv "NOTICE $nick :Op flag für $chan entfernt. Melde dich beim Admin, beim nächsten Mal gibts globales Deop!"
return 2
}
if { [matchattr $handle "d|d" $chan] } {
chattr $handle |+k $chan
putserv "NOTICE $chan :Leute was geht, mich hat grad jemand gekickt, den ich eigentlich deoppe! Falls das deoppen der Grund ist, dann meldet euch verdammt nochmal bei einem Admin! (tried to notifie DeKus about this)"
putserv "NOTICE $nick :Bevor das hier in ewigem gekicke und deoppe und so ausartet: kickban für $chan, sorry. Kannst ja versuchen ein Meister zu finden, der dir sicher hilft, falls das ein Unfall war :)."
#I tried to send me a privmsg which i would probably fastest read, in other case i simply send a note to me.
#In case you got that script from me, change this in your nicks and your bothandle! :)
set dekus [hand2nick emp|De_Kus]
if { $dekus == $botnick } {
if { [onchan emp|De_Kus] } {
set dekus emp|De_Kus
} elseif { [onchan emp|De_Kus^weg] } {
set dekus emp|De_Kus^weg
} elseif { [onchan emp|De_Kus^zZz] } {
set dekus emp|De_Kus^zZz
} else {
sendnote emp|De_Kus "$nick alias $handle hat mich mit deopflag von $chan gekickt!"
return 2
}
}
putserv "PRIVMSG [hand2nick emp|De_Kus]: $nick alias $handle hat mich mit deopflag von $chan gekickt!"
return 2
}
set newhandle $handle
if { $hand == "*" } {
set newhandle [addnewuser $nick $uhost]
}
chattr newhandle +d
putserv "NOTICE $nick :Glückwunsch, du hast das Herz der Sicherheit, den Eggdrop des Channels gekickt. Dies handelt dir allerdings ein globales Deopflag ein :). English quicky: Bot kicking sux -> global deop"
}
examble it worked:
Code: Select all
[18:23:23] * \sonunruhe\ (Millenium5@p50814E50.dip.t-dialin.net) has joined #landau
[18:23:23] * oFF]|[Legolas sets mode: +v \sonunruhe\
[18:23:24] * |EMP| sets mode: +o \sonunruhe\
[18:23:31] * [vibe`] (~blubb@pD9EADABB.dip.t-dialin.net) has joined #landau
[18:23:31] * oFF]|[Legolas sets mode: +v [vibe`]
[18:23:33] * |EMP| sets mode: +o [vibe`]
[18:23:38] * \sonunruhe\ sets mode: +pik (VirusScript
[18:23:38] * \sonunruhe\ sets mode: +l 1
[18:23:38] * \sonunruhe\ changes topic to 14(12VirusScript7 ME14)(15BeTa14) 10Get it at6 http://www.vScripT.cjb.net/ 10and6 http://www.yasarozg.net/
[18:23:38] * |EMP| sets mode: -pilko (VirusScript \sonunruhe\
[18:23:38] * \sonunruhe\ sets mode: -oooooo Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF emp|De_Kus^weg
[18:23:38] * hub.barrysworld.uk.quakenet.org sets mode: -o+ooooo \sonunruhe\ Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
[18:23:38] * hub.barrysworld.uk.quakenet.org sets mode: +o emp|De_Kus^weg
[18:23:38] * tiscali.dk.quakenet.org sets mode: -o+ooooo \sonunruhe\ Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
[18:23:38] * tiscali.dk.quakenet.org sets mode: +o emp|De_Kus^weg
[18:23:38] * \sonunruhe\ was kicked by |EMP| (Missbrauch eines Desync)
[18:23:39] -|EMP|@#landau- Keylamer \sonunruhe\ erfolgreich deoppt.
[18:23:44] -|EMP|@#landau- Deoplamer \sonunruhe\ gegen emp|De_Kus erfolgreich deoppt.
[18:23:46] * |EMP| sets mode: -ooooo Bg`ChiCka Blood[offline] E-waY einkauf-dyna EMP|CoS_OFF
and cause of the double msg i added a smal if, that checks if he is already beeing deopt .
and here a false:
Code: Select all
[21:46:32] * Kronix` (~kampflord@p508E697B.dip.t-dialin.net) has joined #landau
[21:46:32] * BloodRider sets mode: +v Kronix`
[21:46:33] * |EMP| sets mode: +o Kronix`
[21:46:42] * Maisysarah (sarah@pD9E38D0E.dip.t-dialin.net) Quit (Quit: <a1d0n> [19:26] <Maiskoernchen> ein grund den blonden von mir fehrn zu halten <<<<und ich war mit dem ne woche lang im selben zimmer!!!)
[21:50:35] * boo\\1] (~ZHGOZ@p508E697B.dip.t-dialin.net) has joined #landau (1 clone: @+Kronix`)
[21:50:36] * boo\\2] (~LZYZU@p508E697B.dip.t-dialin.net) has joined #landau (2 clones: @+Kronix` boo\\1])
[21:50:36] * boo\\3] (~LIHSB@p508E697B.dip.t-dialin.net) has joined #landau (3 clones: @+Kronix` boo\\2] boo\\1])
[21:50:36] * BloodRider sets mode: +v boo\\1]
[21:50:36] * BloodRider sets mode: +v boo\\2]
[21:50:36] * BloodRider sets mode: +v boo\\3]
[21:50:36] * Kronix` sets mode: +oo boo\\1] boo\\2]
[21:50:36] * |EMP| sets mode: +b *!*@p508E697B.dip.t-dialin.net
[21:50:36] * |EMP| sets mode: +o boo\\3]
[21:50:36] * boo\\1] sets mode: -bo *!*@p508E697B.dip.t-dialin.net |EMP|
[21:50:37] * L sets mode: +o |EMP|
[21:50:38] * |EMP| sets mode: -o+b Kronix` *!*@p508E697B.dip.t-dialin.net
[21:50:38] * Bg`ChiCka`bNc was kicked by boo\\1] (Bg`ChiCka`bNc)
[21:50:38] * BloodRider was kicked by boo\\2] (BloodRider)
[21:50:38] * c64|Solid was kicked by boo\\3] (c64|Solid)
[21:50:38] * Cha\ was kicked by boo\\1] (Cha\)
[21:50:38] * cryp^lernen was kicked by boo\\2] (cryp^lernen)
[21:50:38] * DiDi|afk was kicked by boo\\3] (DiDi|afk)
[21:50:38] * cryp^lernen (cryptic@pD9E4ACA2.dip.t-dialin.net) has joined #landau
[21:50:38] * Dschungeltier|a was kicked by boo\\1] (Dschungeltier|a)
[21:50:38] * E-waY was kicked by boo\\2] (E-waY)
[21:50:38] * emp|CoS21 was kicked by boo\\3] (emp|CoS21)
[21:50:38] * Dschungeltier|a (~Patrick.R@p508BEA8C.dip.t-dialin.net) has joined #landau
[21:50:39] * c64|Solid (Daniel@p508BD8D9.dip.t-dialin.net) has joined #landau
[21:50:39] * oFF]|[Lego`afk sets mode: +v cryp^lernen
[21:50:40] * Cha\ (cha@pD9E4AA3E.dip.t-dialin.net) has joined #landau
[21:50:41] * emp|De_Kus^weg was kicked by boo\\1] (emp|De_Kus^weg)
[21:50:43] *
[21:50:43] * Now talking in: (#landau)
[21:50:43] *
[21:50:43] * Topic: (9,1 Welcome ² #Landau - www.LD-WasGehtAb.de)
[21:50:43] * Set by: (TheWinner^afk) on (Monday December 16 2002 21:02:15)
[21:50:43] * Users: (20), Ops: (11/55%), Voiced: (6/30%), Regs: (3/15%)
[21:50:43] * Join synched in: (101) ms
[21:50:43] *
[21:50:43]
[21:50:43] * oFF]|[Lego`afk sets mode: +v FlyingFin[work]
[21:50:43] * murda|Trooper was kicked by boo\\2] (murda|Trooper)
[21:50:43] * oFF]|[Lego`afk was kicked by boo\\3] (oFF]|[Lego`afk)
[21:50:43] * L sets mode: +o emp|De_Kus^weg
[21:50:43] * murda|Trooper (baer@LINUX.Server.sind.gameserver-profis.de) has joined #landau
[21:50:44] * DiDi|afk (~bnc2@p50842170.dip0.t-ipconnect.de) has joined #landau
[21:50:44] * L sets mode: +o DiDi|afk
[21:50:45] * TheWinner was kicked by boo\\1] (TheWinner)
[21:50:45] * vaLLe`-n\a was kicked by boo\\2] (vaLLe`-n\a)
[21:50:45] * XmasN3o^afk was kicked by boo\\3] (XmasN3o^afk)
[21:50:45] * TheWinner (~TheWinner@p50843689.dip.t-dialin.net) has joined #landau
[21:50:46] * oFF]|[Lego`afk (_Legolas@p5084173A.dip.t-dialin.net) has joined #landau
[21:50:47] * [TEE]-on^two was kicked by boo\\1] ([TEE]-on^two)
[21:50:47] * [zivi|bnc] was kicked by boo\\2] ([zivi|bnc])
[21:50:47] * INSIGNIA was kicked by boo\\3] (INSIGNIA)
[21:50:47] * XmasN3o^afk (~Freak@pD9E4AF62.dip.t-dialin.net) has joined #landau
[21:50:47] * vaLLe`-n\a (junger_got@p5084374F.dip.t-dialin.net) has joined #landau
[21:50:47] * INSIGNIA (angel@ist.der.raucher-am-werk.de) has joined #landau
[21:50:47] * [TEE]-on^two (~lulu@p5084341C.dip.t-dialin.net) has joined #landau
[21:50:49] * boo\\2] sets mode: +o Kronix`
[21:50:51] * boo\\2] sets mode: -b *!*@p508E697B.dip.t-dialin.net
[21:50:54] * boo\\3] was kicked by DiDi|afk (2(Gamers.IRC 3.2 Advanced Kick Protection2))
[21:50:59] * DiDi|afk was kicked by boo\\1] (DiDi|afk)
[21:50:59] * emp|De_Kus^weg was kicked by boo\\2] (emp|De_Kus^weg)
[21:51:01] *
[21:51:01] * Now talking in: (#landau)
[21:51:01] *
[21:51:01] * Topic: (9,1 Welcome ² #Landau - www.LD-WasGehtAb.de)
[21:51:01] * Set by: (TheWinner^afk) on (Monday December 16 2002 21:02:15)
[21:51:01] * Users: (13), Ops: (4/31%), Voiced: (1/8%), Regs: (8/62%)
[21:51:01] * Join synched in: (20) ms
[21:51:01] *
[21:51:01]
[21:51:01] * INSIGNIA (angel@ist.der.raucher-am-werk.de) has joined #landau
[21:51:01] * Cha\ (cha@pD9E4AA3E.dip.t-dialin.net) has joined #landau
[21:51:01] * c64|Solid (Daniel@p508BD8D9.dip.t-dialin.net) has joined #landau
[21:51:02] * L sets mode: +o emp|De_Kus^weg
[21:51:02] * Dschungeltier|a (~Patrick.R@p508BEA8C.dip.t-dialin.net) has joined #landau
[21:51:02] * vaLLe`-n\a (junger_got@p5084374F.dip.t-dialin.net) has joined #landau
[21:51:02] * TheWinner was kicked by boo\\1] (TheWinner)
[21:51:03] * cryp^lernen was kicked by boo\\2] (cryp^lernen)
[21:51:03] * cryp^lernen (cryptic@pD9E4ACA2.dip.t-dialin.net) has joined #landau
[21:51:04] * [TEE]-on^two was kicked by boo\\1] ([TEE]-on^two)
[21:51:04] * FlyingFin[work] was kicked by boo\\2] (FlyingFin[work])
[21:51:04] * [TEE]-on^two (~lulu@p5084341C.dip.t-dialin.net) has joined #landau
[21:51:05] * FlyingFin[work] (~frank@ip3e83b5ca.speed.planet.nl) has joined #landau
[21:51:05] * DiDi|afk (~bnc2@p50842170.dip0.t-ipconnect.de) has joined #landau
[21:51:05] * L sets mode: +o DiDi|afk
[21:51:06] * Kronix` sets mode: +i
[21:51:07] * murda|Trooper was kicked by boo\\2] (murda|Trooper)
[21:51:08] * emp|De_Kus^weg was kicked by boo\\1] (emp|De_Kus^weg)
gets deoppt cause of ban
gets reoppt and this is the he did... he never put a second deop or a kick...
seems he stucked in some loop and died (probably EOF from client). last log entry was L response "done".
any idea, or to much code and history?
and im sad to tell you im using windrop... im having no shell .
currently i have the latest 1.6.14 complied cvs (4.12.), but had the same problem already with 1.6.13 final (hoped .14 would have already some fixes ^-^).
PS: ich hab für das letzte beispiel nochma in den channel logs nachgeschaut: das waren die letzten zeile, das ab "|EMP| joined #landau." muss schon nach dem neustart sein. also ist er nach den zeilen irgendwann abgeschmiert, hab aktiviert, dass er erst nachträglich die logs schreibt, er könnte also noch ein paar sekunden gelebt haben (muss er ja, sonst hätte ich gleich EOF noch gesehen).
Bg`ChiCka`bNc kicked from #landau by boo\\1]: Bg`ChiCka`bNc
BloodRider kicked from #landau |EMP| joined #landau.