Kod
###########################################################
# P-Nick Yonetim Sistemi - pnick.tcl #
# https://www.Sohbetlive.com.tr #
# v1.0.1 - Kanal Bildirim Duzeltme + !komutlar #
###########################################################
# ============================================
# KANAL AYARLARI
# ============================================
set pnick(chan) "#Badnick"
set pnick(chan2) "#System"
set pnick(debug) 1
# ============================================
# GLINE AYARLARI
# ============================================
set pnick(gline-time) "1d"
set pnick(gline-reason) "Yasakli nick listesinde"
# Oper bilgileri
set pnick(oper-nick) "Eggdrop"
set pnick(oper-pass) "eggsifresi"
array set pnick_list {}
proc pnick:load {} {
global pnick_list
set dosya "scripts/pnick_list.txt"
if {[file exists $dosya]} {
set fp [open $dosya r]
while {[gets $fp satir] >= 0} {
set satir [string trim $satir]
if {$satir != ""} {
set pnick_list([string tolower $satir]) 1
}
}
close $fp
putlog "PNICK: [array size pnick_list] nick yuklendi."
} else {
putlog "PNICK: pnick_list.txt bulunamadi, bos liste olusturuldu."
}
}
proc pnick:save {} {
global pnick_list
set dosya "scripts/pnick_list.txt"
set fp [open $dosya w]
foreach {nick deger} [array get pnick_list] {
puts $fp $nick
}
close $fp
putlog "PNICK: [array size pnick_list] nick kaydedildi."
}
# ============================================
# KANALA BILDIRIM - putserv kullan (daha guvenilir)
# ============================================
proc pnick:notify {msg} {
global pnick
putserv "PRIVMSG $pnick(chan) :\00304\[PNICK\]\003 $msg"
putlog "PNICK-NOTIFY: $msg"
}
# ============================================
# SERVER NOTICE FILTRELEME
# ============================================
bind raw - NOTICE pnick:raw_notice
proc pnick:raw_notice {from keyword text} {
global pnick pnick_list
if {$pnick(debug)} {
putlog "PNICK-DEBUG: RAW NOTICE from=$from text=$text"
}
# Client connecting - nick kontrol et ve Gline at
if {[string match "*Client connecting on port*" $text]} {
if {$pnick(debug)} {
putlog "PNICK-DEBUG: Client connecting MATCH"
}
if {[regexp {Client connecting on port [0-9]+: ([^ ]+)} $text -> cnick]} {
if {$pnick(debug)} {
putlog "PNICK-DEBUG: Nick bulundu: $cnick"
}
set lcnick [string tolower $cnick]
if {[info exists pnick_list($lcnick)]} {
if {$pnick(debug)} {
putlog "PNICK-DEBUG: Nick listede VAR: $cnick"
}
if {[regexp {\[([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\]} $text -> ip]} {
pnick:apply_gline $cnick "*@$ip"
putlog "PNICK: Yasakli nick baglandi - $cnick ($ip) - Gline atildi."
pnick:notify "Yasakli nick baglandi: \002$cnick\002 ($ip) - Gline atildi."
}
} else {
if {$pnick(debug)} {
putlog "PNICK-DEBUG: Nick listede YOK: $cnick"
}
}
}
return 0
}
# Q-line mesajlarini sessizce yut
if {[string match "*Forbidding Q-lined nick*" $text]} {
putlog "PNICK: Q-line mesaji (sessiz): $text"
return 1
}
return 0
}
# ============================================
# NICK KONTROLU - Join / Nick Change
# ============================================
bind join - * pnick:check_join
bind nick - * pnick:check_nick
proc pnick:check_join {nick uhost hand chan} {
global pnick pnick_list
if {$pnick(debug)} {
putlog "PNICK-DEBUG: JOIN nick=$nick uhost=$uhost chan=$chan"
}
set lnick [string tolower $nick]
if {[info exists pnick_list($lnick)]} {
pnick:apply_gline $nick $uhost
putlog "PNICK: Yasakli nick join - $nick ($uhost) - Gline atildi."
pnick:notify "Yasakli nick giris: \002$nick\002 ($uhost) - Gline atildi."
}
}
proc pnick:check_nick {nick uhost hand chan newnick} {
global pnick pnick_list
if {$pnick(debug)} {
putlog "PNICK-DEBUG: NICK CHANGE old=$nick new=$newnick uhost=$uhost"
}
set lnewnick [string tolower $newnick]
if {[info exists pnick_list($lnewnick)]} {
pnick:apply_gline $newnick $uhost
putlog "PNICK: Yasakli nick degisimi - $newnick ($uhost) - Gline atildi."
pnick:notify "Yasakli nick degisimi: \002$newnick\002 ($uhost) - Gline atildi."
}
}
proc pnick:apply_gline {nick uhost} {
global pnick
if {$pnick(debug)} {
putlog "PNICK-DEBUG: GLINE atiliyor - nick=$nick uhost=$uhost"
}
putserv "OPER $pnick(oper-nick) $pnick(oper-pass)"
putserv "GLINE +$uhost $pnick(gline-time) :$pnick(gline-reason)"
putlog "PNICK: Gline uygulandi - $nick ($uhost)"
}
# ============================================
# YETKI KONTROLU - isop veya ishalfop
# ============================================
proc pnick:isoper {nick chan} {
if {[isop $nick $chan]} { return 1 }
if {[ishalfop $nick $chan]} { return 1 }
return 0
}
# ============================================
# KOMUTLAR
# ============================================
bind pub -|- "!pnick-ekle" pnick:cmd_ekle
bind pub -|- "!pnick-sil" pnick:cmd_sil
bind pub -|- "!pnick-liste" pnick:cmd_liste
bind pub -|- "!pnick-say" pnick:cmd_say
bind pub -|- "!pnick-yenile" pnick:cmd_yenile
bind pub -|- "!pnick-debug" pnick:cmd_debug
bind pub -|- "!komutlar" pnick:cmd_komutlar
proc pnick:check_chan {chan} {
global pnick
if {$chan == $pnick(chan) || $chan == $pnick(chan2)} {
return 1
}
return 0
}
proc pnick:cmd_ekle {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
set eklenecek [string trim $text]
if {$eklenecek == ""} {
puthelp "PRIVMSG $chan :Kullanim: !pnick-ekle <nick>"
return
}
set pnick_list([string tolower $eklenecek]) 1
pnick:save
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 '\002$eklenecek\002' listeye eklendi."
putlog "PNICK: $nick tarafindan '$eklenecek' eklendi."
}
proc pnick:cmd_sil {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
set silinecek [string trim $text]
if {$silinecek == ""} {
puthelp "PRIVMSG $chan :Kullanim: !pnick-sil <nick>"
return
}
set lsilinecek [string tolower $silinecek]
if {[info exists pnick_list($lsilinecek)]} {
unset pnick_list($lsilinecek)
pnick:save
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 '\002$silinecek\002' listeden silindi."
putlog "PNICK: $nick tarafindan '$silinecek' silindi."
} else {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 '\002$silinecek\002' listede bulunamadi."
}
}
proc pnick:cmd_liste {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
set sayi [array size pnick_list]
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Toplam \002$sayi\002 yasakli nick var."
if {$sayi == 0} { return }
set liste ""
set sayac 0
foreach {nick deger} [array get pnick_list] {
append liste "$nick "
incr sayac
if {$sayac >= 30} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 $liste"
set liste ""
set sayac 0
}
}
if {$liste != ""} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 $liste"
}
}
proc pnick:cmd_say {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
set sayi [array size pnick_list]
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Toplam \002$sayi\002 yasakli nick kayitli."
}
proc pnick:cmd_yenile {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
array unset pnick_list
pnick:load
set sayi [array size pnick_list]
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Liste yenilendi. \002$sayi\002 nick yuklendi."
putlog "PNICK: $nick listeyi yeniledi."
}
proc pnick:cmd_debug {nick uhost hand chan text} {
global pnick pnick_list
if {![pnick:check_chan $chan]} { return }
if {![pnick:isoper $nick $chan]} {
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Bu komutu sadece +h/+o kullanabilir."
return
}
if {$pnick(debug)} {
set pnick(debug) 0
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Debug modu \002KAPANDI\002."
} else {
set pnick(debug) 1
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 Debug modu \002ACILDI\002."
}
putlog "PNICK: Debug modu $pnick(debug) olarak degistirildi."
}
proc pnick:cmd_komutlar {nick uhost hand chan text} {
global pnick
if {![pnick:check_chan $chan]} { return }
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 \002Komutlar:\002"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-ekle <nick> - Listeye nick ekle"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-sil <nick> - Listeden nick sil"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-liste - Yasakli nickleri listele"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-say - Toplam nick sayisi"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-yenile - Listeyi dosyadan yenile"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !pnick-debug - Debug modu ac/kapa"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 !komutlar - Bu listeyi goster"
puthelp "PRIVMSG $chan :\00304\[PNICK\]\003 \002Not:\002 +h veya +o yetkisi gerekir."
}
bind time - "*/10 * * * *" pnick:autosave
proc pnick:autosave {min hour day month year} {
pnick:save
}
pnick:load
putlog "pnick.tcl yuklendi - P-Nick Yonetim Sistemi v3.4"
putlog "PNICK: Kanal: $pnick(chan) / $pnick(chan2)"
putlog "PNICK: Kanal bildirimleri aktif (putserv)"
putlog "PNICK: Yetki: +h veya +o"
putlog "PNICK: Komutlar: !pnick-ekle !pnick-sil !pnick-liste !pnick-say !pnick-yenile !pnick-debug !komutlar" Kod
<Daemon> !komutlar
<Badsystem> [PNICK] Komutlar:
<Badsystem> [PNICK] !pnick-ekle <nick> - Listeye nick ekle
<Badsystem> [PNICK] !pnick-sil <nick> - Listeden nick sil
<Badsystem> [PNICK] !pnick-liste - Yasakli nickleri listele
<Badsystem> [PNICK] !pnick-say - Toplam nick sayisi
<Badsystem> [PNICK] !pnick-yenile - Listeyi dosyadan yenile
<Badsystem> [PNICK] !pnick-debug - Debug modu ac/kapa
<Badsystem> [PNICK] !komutlar - Bu listeyi goster
<Badsystem> [PNICK] Not: +h veya +o yetkisi gerekir.
Alıntı:
<Badsystem> [PNICK] Yasakli nick baglandi: _ibne_ibneye_shet (78.155.67.224) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: Esimkapali (168.243.77.204) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: Edirne-a (146.19.140.202) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: evlianm47 (171.228.33.208) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: evliminiligavatop_p (38.199.66.59) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: alanya_oralp_yv (38.199.66.57) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: Emrekfren (185.123.101.43) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: Arsin_msfr (79.72.86.11) - Gline atildi.
<Badsystem> [PNICK] Yasakli nick baglandi: OLGUN_DUL_M_ (45.159.22.157) - Gline atildi.
|
Conf dosyasi olusturup aktif edebilirsiniz.