| Daemon | 12 Ağustos 2026 03:15 | TRCycle Webirc - Eggdrop Sürüm Bu aralar eggdrop'a sardığım için. TRCycle webirc tabanli socket botu eggdrop'a cevirdim. Test Sunucu : irc.sohbetlive.com
Komut Kullanım !cycle on/off/durum/close Cycle sistemini aç/kapat/durum gör
!saat Sabah 150 Sabah saatleri için 150 bot hedefi
!gün Cuma 50 Cuma günü +50 ekstra bot
!nick ekle Nick Rastgele nick havuzuna ekle
!knick ekle Nick Kayıtlı nick listesine ekle (auto register/identify)
!kanal ekle #Kanal Botların gireceği kanalları ayarla
!karşılama ekle <nick> hoşgeldin! Karşılama mesajı ekle
!loglar Log dosyalarını listele
!log 1 #Kanal 1. log dosyasını #Kanal'a yansıt
!konuşma on/off Log konuşma modunu aç/kapat
!clone Manuel olarak tek bot sok Dipnot Cycle rotasyonu her 30-60 dakikada bir %15 botu çıkarıp yenilerini sokar
Tüm ayarlar otomatik Hash/Cycle.fth dosyasına kaydedilir Kurulum Kod:
scripts/
├── TRCycle.tcl # Ana script
├── cycleloglar/ # Log dosyaları (nick¬mesaj formatı)
│ ├── 1.txt
│ └── ...
Hash/
├── Cycle.fth # Ayarların kaydedildiği dosya
├── Log.fth # Log verileri
└── Register.fth # Nick şifreleri Alıntı:
Log dosyaları bu şekilde çalışmakta.
Ahmet¬Merhaba arkadaşlar, nasılsınız?
Mehmet¬İyiyim teşekkürler, sen nasılsın?
Ayşe¬Bugün hava çok güzel değil mi?
| Kod:
#!/usr/bin/tclsh
# ==========================================================
# TRCycle - Eggdrop TCL
# ==========================================================
# ----- GLOBAL DEGISKENLER -----
array set cycle {}
array set logdata {}
array set register {}
array set bots {}
array set mesaj {}
array set cycle_fd {}
array set kac {}
array set say {}
# ----- AYARLAR -----
set cycle(botnick) "Cycle"
set cycle(password) "nickpass"
set cycle(ident) "ident"
set cycle(realname) "• Eggdrop Version™ Sunucuadi"
set cycle(oper) "Korupa korumapass25xx"
set cycle(serverip) "87.76.142.136"
set cycle(serverport) "7034"
set cycle(cyclechan) "#Cycle"
set cycle(adminnicks) "Daemon adminnick"
set cycle(ircport) "6667"
set cycle(mobilport) "7003"
set cycle(webport) "7033"
set cycle(portpass) ""
set cycle(webirc) "webircpass"
set cycle(durum) "on"
set cycle(Karsilama) "on"
set cycle(Reg) "on"
set cycle(Bad) "off"
set cycle(Konusma) "on"
set cycle(Cvp) "on"
set cycle(cycletime) "45" ;# Dakika - cycle periyodu (30-60 arasi rastgele)
set servers {
sunucuipadresi:6667
}
set oper-name "Oper"
set oper-pass "pass"
# Loglar dizini
set cycle(logdir) "scripts/cycleloglar"
# ----- YARDIMCI PROCS -----
proc _rand {min max} { expr {int(rand()*($max-$min+1))+$min} }
proc _gettok {str pos {char "¬"}} { lindex [split $str $char] [expr {$pos-1}] }
proc _tokcount {str sep} { llength [split $str $sep] }
proc _readfile {file} {
if {![file exists $file]} { return {} }
if {[catch {open $file r} fp]} { return {} }
fconfigure $fp -encoding utf-8
set data [read $fp]
close $fp
set sonuc {}
foreach satir [split [string trim $data] "\n"] {
if {[string trim $satir] ne ""} {
lappend sonuc $satir
}
}
return $sonuc
}
proc _writeline {file line} {
if {[catch {open $file a} fp]} { return }
fconfigure $fp -encoding utf-8
puts $fp $line
close $fp
}
proc _deleteline {file line} {
if {![file exists $file]} { return 0 }
set lines [_readfile $file]
set idx [lsearch -exact $lines $line]
if {$idx == -1} { return 0 }
set lines [lreplace $lines $idx $idx]
if {[catch {open $file w} fp]} { return 0 }
fconfigure $fp -encoding utf-8
foreach l $lines { if {$l ne ""} {puts $fp $l} }
close $fp
return 1
}
proc _filelinecount {file} { llength [_readfile $file] }
proc _sfre {} { return "[format %c [expr {97+int(rand()*26)}]][_rand 10 999][format %c [expr {97+int(rand()*26)}]][format %c [expr {97+int(rand()*26)}]][_rand 100 9999]" }
proc _mail {} { lindex[list gmail.com hotmail.com live.com] [_rand 0 2] }
proc _nick {host} { string trimleft [lindex [split $host !] 0] : }
# Log dosyalarini listele
proc _get_log_files {} {
set dir $::cycle(logdir)
if {![file isdirectory $dir]} { return {} }
set files [glob -nocomplain -directory $dir "*.txt"]
set result {}
foreach f [lsort $files] {
lappend result [file tail $f]
}
return $result
}
# Doğrudan girilen saat sayılarını okuyan fonksiyonlar
proc _sabah {} { if {[info exists ::cycle(Sabah)]} {return $::cycle(Sabah)}; return 150 }
proc _oglen {} { if {[info exists ::cycle(Oglen)]} {return $::cycle(Oglen)}; return 175 }
proc _aksam {} { if {[info exists ::cycle(Aksam)]} {return $::cycle(Aksam)}; return 200 }
proc _gece {} { if {[info exists ::cycle(Gece)]} {return $::cycle(Gece)}; return 175 }
proc _cycle_nick {} {
set r [_rand 1 10]
if {$r == 2 && [info exists ::cycle(Bad)] && $::cycle(Bad) ne "off" && [file exists badnick.txt]} {
set n [_readfile badnick.txt]
if {[llength $n]>0} {return [lindex $n [_rand 0 [expr {[llength $n]-1}]]]}
}
if {$r == 2 && [info exists ::cycle(Reg)] && $::cycle(Reg) ne "off" && [file exists kayitli.txt]} {
set n [_readfile kayitli.txt]
if {[llength $n]>0} {return [lindex $n [_rand 0 [expr {[llength $n]-1}]]]}
}
if {[file exists nick.txt]} {
set n [_readfile nick.txt]
if {[llength $n]>0} {return [lindex $n [_rand 0 [expr {[llength $n]-1}]]]}
}
return "Guest[_rand 1000 9999]"
}
proc _cycle_ident {} {
if {[file exists ident.txt]} {
set i [_readfile ident.txt]
if {[llength $i]>0} {return [lindex $i [_rand 0 [expr {[llength $i]-1}]]]}
}
return "WebUser¬http://www.site.com/¬Mobile IRC User"
}
proc _cycle_ip {} {
if {[file exists trip.txt]} {
set i [_readfile trip.txt]
if {[llength $i]>0} {
return [regsub -all {\.0} [lindex $i [_rand 0 [expr {[llength $i]-1}]]] ".[_rand 1 255]"]
}
}
return "1.2.3.[_rand 1 255]"
}
proc _get_port {ident} {
if {[string match -nocase "*Mobil*" $ident]} {return $::cycle(mobilport)}
if {[string match -nocase "*Web*" $ident]} {return $::cycle(webport)}
return $::cycle(ircport)
}
proc _isadmin {nick} {
global cycle
if {![info exists cycle(adminnicks)]} { return 0 }
expr {[lsearch -exact [split $cycle(adminnicks) " "] $nick] != -1}
}
# ----- DOSYA YUKLEME / KAYDETME -----
proc _load_cycle {} {
if {[file exists Hash/Cycle.fth]} {
if {![catch {open Hash/Cycle.fth r} fp]} {
fconfigure $fp -encoding utf-8
while {[gets $fp line] >= 0} { set ::cycle([lindex $line 0]) [lrange $line 1 end] }
close $fp
}
}
if {[file exists Hash/Log.fth]} {
if {![catch {open Hash/Log.fth r} fp]} {
fconfigure $fp -encoding utf-8
while {[gets $fp line] >= 0} { set ::logdata([lindex $line 0]) [lrange $line 1 end] }
close $fp
}
}
if {[file exists Hash/Register.fth]} {
if {![catch {open Hash/Register.fth r} fp]} {
fconfigure $fp -encoding utf-8
while {[gets $fp line] >= 0} { set ::register([lindex $line 0]) [lindex $line 1] }
close $fp
}
}
}
proc _save_cycle {} {
if {![file exists Hash]} {file mkdir Hash}
if {[catch {open Hash/Cycle.fth w} fp]} { return }
fconfigure $fp -encoding utf-8
foreach key [array names ::cycle] { puts $fp "$key $::cycle($key)" }
close $fp
}
proc _save_register {} {
if {![file exists Hash]} {file mkdir Hash}
if {[catch {open Hash/Register.fth w} fp]} { return }
fconfigure $fp -encoding utf-8
foreach key [array names ::register] { puts $fp "$key $::register($key)" }
close $fp
}
# ----- SOCKET YONETIMI -----
proc _sw {fd text} {
if {[lsearch -exact [file channels] $fd] == -1} {
_cycle_close $fd
return
}
if {![info exists ::cycle_fd($fd,status)]} { return }
if {[catch {
puts $fd $text
flush $fd
} err]} {
putlog "TRCycle Socket Hatasi ($fd): $err"
_cycle_close $fd
}
}
# Duzgun QUIT atip sonra kapat
proc _cycle_quit {fd {reason "TRCycle Restart"}} {
if {[lsearch -exact [file channels] $fd] != -1 && [info exists ::cycle_fd($fd,status)]} {
catch { _sw $fd "QUIT :$reason" }
}
after 3000[list _cycle_close $fd]
}
proc _cycle_close {fd} {
catch {fileevent $fd readable ""}
if {[lsearch -exact [file channels] $fd] != -1} {
catch {close $fd}
}
foreach key [array names ::cycle_fd "$fd,*"] {
catch {unset ::cycle_fd($key)}
}
}
proc _cycle_close_all {} {
foreach key [array names ::cycle_fd "*,status"] {
set fd [lindex [split $key ,] 0]
_cycle_quit $fd "TRCycle System Shutdown"
}
}
proc _cycle_open {nick ident ip port} {
if {[catch {set fd [socket $::cycle(serverip) $port]} err]} {
putlog "CYCLE HATA: Sunucuya baglanilamadi! IP: $::cycle(serverip) Port: $port | Hata: $err"
return
}
fconfigure $fd -buffering line -blocking 0 -encoding utf-8
set ::cycle_fd($fd,nick) $nick
set ::cycle_fd($fd,ip) $ip
set ::cycle_fd($fd,ident) $ident
set ::cycle_fd($fd,status) "connecting"
fileevent $fd readable[list _cycle_read $fd]
putlog "TRCycle: Bot baglaniyor -> $nick ($ip:$port)"
if {[info exists ::cycle(webirc)] && $::cycle(webirc) ne ""} {
_sw $fd "WEBIRC $::cycle(webirc) qwebirc $ip $ip"
}
if {[lsearch -exact [file channels] $fd] == -1} return
if {[info exists ::cycle(portpass)] && $::cycle(portpass) ne ""} {
_sw $fd "PASS $::cycle(portpass)"
}
if {[lsearch -exact [file channels] $fd] == -1} return
_sw $fd "NICK $nick"
_sw $fd "USER [_gettok $ident 1 ¬] bleh $ip :[_gettok $ident 2 ¬]"
}
proc _cycle_read {fd} {
if {[eof $fd] || [catch {gets $fd line}]} { _cycle_close $fd; return }
if {$line eq ""} return
set parts [split $line " "]
set src [lindex $parts 0]
set cmd [lindex $parts 1]
set tgt [lindex $parts 2]
if {[string equal -nocase $src "PING"]} { _sw $fd "PONG [string trimleft [lindex $parts 1] :]"; return }
if {$cmd eq "433"} { set nn [_cycle_nick]; _sw $fd "NICK $nn"; set ::cycle_fd($fd,nick) $nn; return }
if {$cmd eq "001"} {
set ::cycle_fd($fd,status) "connected"
set cnick $::cycle_fd($fd,nick)
set kls "#Sohbet"
if {[info exists ::cycle(Kanal)]} { set kls [join [split $::cycle(Kanal) " "] ,] }
# OPER GIRISI
if {[info exists ::cycle(oper)] && $::cycle(oper) ne ""} {
set operparts [split $::cycle(oper) " "]
if {[llength $operparts] >= 2} {
after [expr {[_rand 2 4]*1000}][list _sw $fd "OPER [lindex $operparts 0] [lindex $operparts 1]"]
}
}
after [expr {[_rand 2 5]*1000}][list _sw $fd "JOIN $kls"]
if {[file exists kayitli.txt]} {
set kl [_readfile kayitli.txt]
if {[lsearch -exact $kl $cnick] != -1} {
if {![info exists ::register($cnick)]} {
set ps [_sfre]; set ::register($cnick) $ps; _save_register
after [expr {[_rand 5 10]*1000}][list _sw $fd "ns register $ps ${cnick}@[_mail]"]
}
after [expr {[_rand 3 7]*1000}][list _sw $fd "ns identify $::register($cnick)"]
}
}
return
}
# Karsilama mesaji
if {[string equal -nocase $cmd "JOIN"] && [info exists ::cycle(Karsilama)] && $::cycle(Karsilama) eq "on"} {
set jnick [_nick $src]
set jchan [string trimleft $tgt :]
if {[file exists karsilama.txt]} {
set msgs [_readfile karsilama.txt]
if {[llength $msgs] > 0} {
set msg [lindex $msgs [_rand 0 [expr {[llength $msgs]-1}]]]
set msg [string map[list "<nick>" $jnick] $msg]
after [expr {[_rand 1 3]*1000}][list _sw $fd "PRIVMSG $jchan :$msg"]
}
}
}
}
# ----- CYCLE KONTROL / CLONE / QUIT -----
proc _cycle_count {} {
set c 0
foreach key [array names ::cycle_fd "*,status"] {
if {$::cycle_fd($key) eq "connected"} {incr c}
}
return $c
}
proc _clone {} {
set nick [_cycle_nick]
set ident [_cycle_ident]
set ip [_cycle_ip]
set port [_get_port $ident]
_cycle_open $nick $ident $ip $port
}
# Duzgun QUIT ile cikis
proc _quit_one {} {
set fds {}
foreach key [array names ::cycle_fd "*,status"] {
set fd [lindex [split $key ,] 0]
if {$::cycle_fd($key) ne "connected"} continue
lappend fds $fd
}
if {[llength $fds] > 0} {
set fd [lindex $fds [_rand 0 [expr {[llength $fds]-1}]]]
set nn $::cycle_fd($fd,nick)
putlog "TRCycle: Bot cikis yapiyor -> $nn"
_cycle_quit $fd "Leaving"
}
}
# Periyodik cycle - botlar cikip tekrar girer
proc _cycle_rotate {} {
if {[info exists ::cycle(durum)] && $::cycle(durum) eq "off"} { return }
set aktif [_cycle_count]
if {$aktif < 5} { return } ;# En az 5 bot olsun cycle icin
set cikacak [expr {int($aktif * 0.15)}] ;# %15 i ciksin
if {$cikacak < 1} { set cikacak 1 }
if {$cikacak > 10} { set cikacak 10 }
putlog "TRCycle: Cycle rotasyonu - $cikacak bot cikip tekrar girecek."
set fds {}
foreach key [array names ::cycle_fd "*,status"] {
set fd [lindex [split $key ,] 0]
if {$::cycle_fd($key) eq "connected"} { lappend fds $fd }
}
for {set i 0} {$i < $cikacak && [llength $fds] > 0} {incr i} {
set idx [_rand 0 [expr {[llength $fds]-1}]]
set fd [lindex $fds $idx]
set fds [lreplace $fds $idx $idx]
set nn $::cycle_fd($fd,nick)
putlog "TRCycle: Cycle cikis -> $nn"
_cycle_quit $fd "TRCycle Rotation"
}
# Cikan botlarin yerine yenileri girecek
after [expr {[_rand 5 15]*1000}][list _cycle_kontrol]
}
proc _cycle_kontrol {} {
if {[info exists ::cycle(durum)] && $::cycle(durum) eq "off"} {
putlog "TRCycle: Otomatik giris KAPALI (durum=off)"
return
}
set h [clock format [clock seconds] -format %H]
set h [string trimleft $h 0]; if {$h eq ""} {set h 0}
set aktif [_cycle_count]
set hedef 0
if {$h >= 6 && $h <= 11} {
set hedef [_sabah]
} elseif {$h >= 12 && $h <= 17} {
set hedef [_oglen]
} elseif {$h >= 18 && $h <= 23} {
set hedef [_aksam]
} else {
set hedef [_gece]
}
# Gun bazli fazlalik
set gun [string tolower [clock format [clock seconds] -format %A]]
set gunmap[list monday pazartesi tuesday salı wednesday çarşamba thursday perşembe friday cuma saturday cumartesi sunday pazar]
set guntr [string map $gunmap $gun]
if {[info exists ::cycle(Gun_$guntr)]} {
set hedef [expr {$hedef + $::cycle(Gun_$guntr)}]
}
putlog "TRCycle: Kontrol calisiyor - Aktif: $aktif, Hedef: $hedef"
if {$aktif < $hedef} {
set fark [expr {$hedef - $aktif}]
if {$fark > 10} { set fark 10 }
for {set i 0} {$i < $fark} {incr i} {
_clone
}
} elseif {$aktif > $hedef} {
set fark [expr {$aktif - $hedef}]
if {$fark > 5} { set fark 5 }
for {set i 0} {$i < $fark} {incr i} {
_quit_one
}
}
}
# ----- LOG KONUSMA SISTEMI -----
proc _start_log_speak {chan} {
if {![info exists ::logdata($chan)]} return
if {![info exists ::logdata($chan,active)] || !$::logdata($chan,active)} return
if {[llength $::logdata($chan)] == 0} return
# Bagli botlardan rastgele birini sec
set fds {}
foreach key [array names ::cycle_fd "*,status"] {
set fd [lindex [split $key ,] 0]
if {$::cycle_fd($key) eq "connected"} { lappend fds $fd }
}
if {[llength $fds] == 0} {
after 5000[list _start_log_speak $chan]
return
}
set fd [lindex $fds [_rand 0 [expr {[llength $fds]-1}]]]
set idx $::logdata($chan,index)
if {$idx >= [llength $::logdata($chan)]} {
set idx 0
}
set line [lindex $::logdata($chan) $idx]
set lmsg [lindex $line 1]
# Mesaji bot uzerinden gonder
_sw $fd "PRIVMSG $chan :$lmsg"
set ::logdata($chan,index) [expr {$idx + 1}]
# Sonraki mesaj icin rastgele gecikme (3-8 saniye)
set delay [expr {[_rand 3 8]*1000}]
after $delay[list _start_log_speak $chan]
}
# ----- DURUM RENKLI GOSTERIM -----
proc _durum {key} {
if {[info exists ::cycle($key)] && $::cycle($key) eq "on"} { return "\0033Açık\003" }
return "\0034Kapalı\003"
}
# ----- KOMUTLAR -----
catch {unbind pub - !tory pub_tory}
catch {unbind pub - !cycle pub_cycle}
catch {unbind pub - !saat pub_saat}
catch {unbind pub - !gün pub_gun}
catch {unbind pub - !gun pub_gun}
catch {unbind pub - !nick pub_nick}
catch {unbind pub - !knick pub_knick}
catch {unbind pub - !badnick pub_badnick}
catch {unbind pub - !kanal pub_kanal}
catch {unbind pub - !karşılama pub_karsilama}
catch {unbind pub - !karsilama pub_karsilama}
catch {unbind pub - !loglar pub_loglar}
catch {unbind pub - !log pub_log}
catch {unbind pub - !konuşma pub_konusma}
catch {unbind pub - !konusma pub_konusma}
catch {unbind pub - !özelkonuşma pub_ozelkonusma}
catch {unbind pub - !ozelkonusma pub_ozelkonusma}
catch {unbind pub - !clone pub_manual_clone}
bind pub - !tory pub_tory
bind pub - !cycle pub_cycle
bind pub - !saat pub_saat
bind pub - !gün pub_gun
bind pub - !gun pub_gun
bind pub - !nick pub_nick
bind pub - !knick pub_knick
bind pub - !badnick pub_badnick
bind pub - !kanal pub_kanal
bind pub - !karşılama pub_karsilama
bind pub - !karsilama pub_karsilama
bind pub - !loglar pub_loglar
bind pub - !log pub_log
bind pub - !konuşma pub_konusma
bind pub - !konusma pub_konusma
bind pub - !özelkonuşma pub_ozelkonusma
bind pub - !ozelkonusma pub_ozelkonusma
bind pub - !clone pub_manual_clone
proc pub_tory {nick uhost hand chan text} {
if {![string equal -nocase $chan $::cycle(cyclechan)] || ![_isadmin $nick]} return
putquick "PRIVMSG $chan :\0032***\003 $::cycle(botnick) \0032v2 Komut Listesi\003 ***"
putquick "PRIVMSG $chan :"
putquick "PRIVMSG $chan :\0034!cycle\003 <\0034on\003|\0034off\003|\0034durum\003|\0034close\003> Cycle bot girişini yönetir. (Durum: [_durum durum])"
putquick "PRIVMSG $chan :\0034!saat\003 <\0034Sabah\003|\0034Öğlen\003|\0034Akşam\003|\0034Gece\003> <\0034Sayı\003> Saatlere göre bot sayısı."
putquick "PRIVMSG $chan :\0034!gün\003 <\0034Gün\003> <\0034Sayı\003> Günlere göre fazladan bot sayısı."
putquick "PRIVMSG $chan :\0034!nick\003 <\0034ekle\003|\0034sil\003> <\0034nick\003> Nick listesi yönetimi."
putquick "PRIVMSG $chan :\0034!knick\003 <\0034ekle\003|\0034sil\003|\0034on\003|\0034off\003> Kayıtlı nick listesi. (Durum: [_durum Reg])"
putquick "PRIVMSG $chan :\0034!badnick\003 <\0034ekle\003|\0034sil\003|\0034on\003|\0034off\003> Bad nick listesi. (Durum: [_durum Bad])"
putquick "PRIVMSG $chan :\0034!kanal\003 <\0034ekle\003|\0034sil\003|\0034list\003> Kanal listesi yönetimi."
putquick "PRIVMSG $chan :\0034!karşılama\003 <\0034ekle\003|\0034sil\003|\0034list\003|\0034on\003|\0034off\003> Karşılama mesajları. (Durum: [_durum Karsilama])"
putquick "PRIVMSG $chan :\0034!loglar\003 scripts/cycleloglar/ dizinindeki log dosyalarını listeler."
putquick "PRIVMSG $chan :\0034!log\003 <\0034ID\003> <\0034#Kanal\003> Belirtilen logu kanala yansıtır. (nick¬mesaj formatı)"
putquick "PRIVMSG $chan :\0034!log sil\003 <\0034#Kanal\003> Yansıtmayı durdurur."
putquick "PRIVMSG $chan :\0034!konuşma\003 <\0034on\003|\0034off\003> Log konuşma modu. (Durum: [_durum Konusma])"
putquick "PRIVMSG $chan :\0034!özelkonuşma\003 <\0034on\003|\0034off\003> Özel konuşma modu. (Durum: [_durum Cvp])"
putquick "PRIVMSG $chan :\0034!clone\003 Manuel olarak tek bot sokar."
putquick "PRIVMSG $chan :"
putquick "PRIVMSG $chan :\0032Şu an aktif cycle sayısı:\003 \0034[_cycle_count]\003"
}
proc pub_cycle {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set arg [string tolower [lindex $text 0]]
if {$arg eq "on" || $arg eq "acik"} {
set ::cycle(durum) "on"
_save_cycle
putserv "PRIVMSG $chan :\0033Cycle girisi aktif edildi, botlar hemen sokuluyor...\003"
_cycle_kontrol
} elseif {$arg eq "off" || $arg eq "kapali"} {
set ::cycle(durum) "off"
_save_cycle
putserv "PRIVMSG $chan :\0034Cycle girisi durduruldu.\003"
} elseif {$arg eq "durum" || $arg eq "status"} {
set aktif [_cycle_count]
set durumtext $::cycle(durum)
putserv "PRIVMSG $chan :\0032Cycle Durum:\003 Durum: \0034$durumtext\003 | Aktif Bot Sayısı: \0034$aktif\003"
} elseif {$arg eq "close"} {
set ::cycle(durum) "off"
_save_cycle
_cycle_close_all
putserv "PRIVMSG $chan :\0034Tüm cycle botları kapatıldı ve sistem durduruldu.\003"
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !cycle <on|off|durum|close>"
}
}
proc pub_manual_clone {nick uhost hand chan text} {
if {![_isadmin $nick]} return
putserv "PRIVMSG $chan :\0033Manuel clone tetiklendi, socket açılıyor...\003"
_clone
}
proc pub_saat {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set per [string tolower [lindex $text 0]]
set val [lindex $text 1]
if {$per eq "list"} {
putserv "PRIVMSG $chan :\0032Saat Ayarları:\003 Sabah: [_sabah] | Öğlen: [_oglen] | Akşam: [_aksam] | Gece: [_gece]"
return
}
if {$val eq "" || ![string is integer -strict $val]} {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !saat <Sabah|Öğlen|Akşam|Gece> <Sayı> veya !saat list"
return
}
if {$per eq "sabah"} { set ::cycle(Sabah) $val
} elseif {$per eq "öğlen" || $per eq "oglen"} { set ::cycle(Oglen) $val
} elseif {$per eq "akşam" || $per eq "aksam"} { set ::cycle(Aksam) $val
} elseif {$per eq "gece"} { set ::cycle(Gece) $val
} else {
putserv "PRIVMSG $chan :\0034Geçersiz periyot. Kullanım:\003 !saat <Sabah|Öğlen|Akşam|Gece> <Sayı>"
return
}
_save_cycle
putserv "PRIVMSG $chan :\0033$per periyodu $val olarak ayarlandı.\003"
}
proc pub_gun {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set gun [string tolower [lindex $text 0]]
set val [lindex $text 1]
if {$gun eq "list"} {
set out "\0032Gün Ayarları:\003"
foreach g {Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi Pazar} {
set k [string tolower $g]
if {[info exists ::cycle(Gun_$k)]} { append out " $g: $::cycle(Gun_$k)" } else { append out " $g: 0" }
}
putserv "PRIVMSG $chan :$out"
return
}
if {$val eq "" || ![string is integer -strict $val]} {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !gün <Gün> <Sayı> veya !gün list"
return
}
set valid_gunler {pazartesi salı çarşamba perşembe cuma cumartesi pazar carsamba persembe}
if {[lsearch $valid_gunler $gun] == -1} {
putserv "PRIVMSG $chan :\0034Geçersiz gün. Kullanım:\003 !gün <Pazartesi|Salı|Çarşamba|Perşembe|Cuma|Cumartesi|Pazar> <Sayı>"
return
}
set ::cycle(Gun_$gun) $val
_save_cycle
putserv "PRIVMSG $chan :\0033$gun günü fazladan bot sayısı $val olarak ayarlandı.\003"
}
proc pub_nick {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
set nnick [lindex $text 1]
if {$cmd eq "ekle"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !nick ekle <nick>"; return }
_writeline nick.txt $nnick
putserv "PRIVMSG $chan :\0033$nnick nick listesine eklendi.\003"
} elseif {$cmd eq "sil"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !nick sil <nick>"; return }
if {[_deleteline nick.txt $nnick]} {
putserv "PRIVMSG $chan :\0034$nnick nick listesinden silindi.\003"
} else {
putserv "PRIVMSG $chan :\0034$nnick listede bulunamadı.\003"
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !nick <ekle|sil> <nick>"
}
}
proc pub_knick {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
set nnick [lindex $text 1]
if {$cmd eq "on"} {
set ::cycle(Reg) "on"; _save_cycle; putserv "PRIVMSG $chan :\0033Kayıtlı nick girişi açıldı.\003"; return
} elseif {$cmd eq "off"} {
set ::cycle(Reg) "off"; _save_cycle; putserv "PRIVMSG $chan :\0034Kayıtlı nick girişi kapatıldı.\003"; return
} elseif {$cmd eq "ekle"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !knick ekle <nick>"; return }
_writeline kayitli.txt $nnick
putserv "PRIVMSG $chan :\0033$nnick kayıtlı nick listesine eklendi.\003"
} elseif {$cmd eq "sil"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !knick sil <nick>"; return }
if {[_deleteline kayitli.txt $nnick]} {
putserv "PRIVMSG $chan :\0034$nnick kayıtlı nick listesinden silindi.\003"
} else {
putserv "PRIVMSG $chan :\0034$nnick listede bulunamadı.\003"
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !knick <ekle|sil|on|off> [nick]"
}
}
proc pub_badnick {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
set nnick [lindex $text 1]
if {$cmd eq "on"} {
set ::cycle(Bad) "on"; _save_cycle; putserv "PRIVMSG $chan :\0033Bad nick girişi açıldı.\003"; return
} elseif {$cmd eq "off"} {
set ::cycle(Bad) "off"; _save_cycle; putserv "PRIVMSG $chan :\0034Bad nick girişi kapatıldı.\003"; return
} elseif {$cmd eq "ekle"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !badnick ekle <nick>"; return }
_writeline badnick.txt $nnick
putserv "PRIVMSG $chan :\0033$nnick bad nick listesine eklendi.\003"
} elseif {$cmd eq "sil"} {
if {$nnick eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !badnick sil <nick>"; return }
if {[_deleteline badnick.txt $nnick]} {
putserv "PRIVMSG $chan :\0034$nnick bad nick listesinden silindi.\003"
} else {
putserv "PRIVMSG $chan :\0034$nnick listede bulunamadı.\003"
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !badnick <ekle|sil|on|off> [nick]"
}
}
proc pub_kanal {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
set k [lindex $text 1]
if {$cmd eq "list"} {
if {[info exists ::cycle(Kanal)]} {
putserv "PRIVMSG $chan :\0032Kanal Listesi:\003 $::cycle(Kanal)"
} else {
putserv "PRIVMSG $chan :\0032Kanal Listesi:\003 (Boş - Sadece #Sohbet)"
}
return
}
if {$k eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !kanal <ekle|sil|list> <#kanal>"; return }
if {$cmd eq "ekle"} {
if {[info exists ::cycle(Kanal)]} {
if {[lsearch -exact [split $::cycle(Kanal) " "] $k] == -1} {
append ::cycle(Kanal) " $k"
}
} else {
set ::cycle(Kanal) $k
}
_save_cycle
putserv "PRIVMSG $chan :\0033$k kanal listesine eklendi.\003"
} elseif {$cmd eq "sil"} {
if {[info exists ::cycle(Kanal)]} {
set kl [split $::cycle(Kanal) " "]
set idx [lsearch -exact $kl $k]
if {$idx != -1} {
set kl [lreplace $kl $idx $idx]
set ::cycle(Kanal) [join $kl " "]
_save_cycle
putserv "PRIVMSG $chan :\0034$k kanal listesinden silindi.\003"
} else {
putserv "PRIVMSG $chan :\0034$k listede bulunamadı.\003"
}
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !kanal <ekle|sil|list> <#kanal>"
}
}
proc pub_karsilama {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
set msg [join [lrange $text 1 end]]
if {$cmd eq "on"} {
set ::cycle(Karsilama) "on"; _save_cycle; putserv "PRIVMSG $chan :\0033Karşılama mesajları açıldı.\003"; return
} elseif {$cmd eq "off"} {
set ::cycle(Karsilama) "off"; _save_cycle; putserv "PRIVMSG $chan :\0034Karşılama mesajları kapatıldı.\003"; return
} elseif {$cmd eq "list"} {
if {[file exists karsilama.txt]} {
set msgs [_readfile karsilama.txt]
if {[llength $msgs] == 0} { putserv "PRIVMSG $chan :\0034Karşılama listesi boş.\003"; return }
set i 1
foreach m $msgs {
putserv "PRIVMSG $chan :\0032$i.\003 $m"
incr i
}
} else {
putserv "PRIVMSG $chan :\0034Karşılama listesi boş.\003"
}
return
} elseif {$cmd eq "ekle"} {
if {$msg eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !karşılama ekle <mesaj>"; return }
_writeline karsilama.txt $msg
putserv "PRIVMSG $chan :\0033Karşılama mesajı eklendi:\003 $msg"
} elseif {$cmd eq "sil"} {
if {$msg eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !karşılama sil <mesaj>"; return }
if {[_deleteline karsilama.txt $msg]} {
putserv "PRIVMSG $chan :\0034Karşılama mesajı silindi.\003"
} else {
putserv "PRIVMSG $chan :\0034Mesaj listede bulunamadı.\003"
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !karşılama <ekle|sil|list|on|off> [mesaj]"
}
}
# Log dosyalarini listele (scripts/cycleloglar/)
proc pub_loglar {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set files [_get_log_files]
if {[llength $files] == 0} {
putserv "PRIVMSG $chan :\0034scripts/cycleloglar dizininde log dosyası bulunamadı.\003"
return
}
putserv "PRIVMSG $chan :\0032Log Dosyaları (scripts/cycleloglar/):\003"
set i 1
foreach f $files {
putserv "PRIVMSG $chan :\0032$i.\003 $f"
incr i
}
}
# Log yansitma - nick¬mesaj formati
proc pub_log {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set cmd [string tolower [lindex $text 0]]
if {$cmd eq "sil"} {
set k [lindex $text 1]
if {$k eq ""} { putserv "PRIVMSG $chan :\0034Kullanım:\003 !log sil <#Kanal>"; return }
if {[info exists ::logdata($k)]} {
set ::logdata($k,active) 0
unset ::logdata($k)
unset ::logdata($k,index)
unset ::logdata($k,active)
putserv "PRIVMSG $chan :\0034$k kanalındaki log yansıtması durduruldu.\003"
} else {
putserv "PRIVMSG $chan :\0034$k kanalında aktif log yansıtması yok.\003"
}
return
}
set id [lindex $text 0]
set k [lindex $text 1]
if {$id eq "" || $k eq "" || ![string is integer -strict $id]} {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !log <ID> <#Kanal> veya !log sil <#Kanal>"
return
}
set files [_get_log_files]
if {$id < 1 || $id > [llength $files]} {
putserv "PRIVMSG $chan :\0034Geçersiz log ID. !loglar ile listeyi görüntüleyin.\003"
return
}
set filename [lindex $files [expr {$id - 1}]]
set filepath "$::cycle(logdir)/$filename"
if {![file exists $filepath]} {
putserv "PRIVMSG $chan :\0034Log dosyası bulunamadı.\003"
return
}
# Dosyayi nick¬mesaj formatinda parse et
set lines [_readfile $filepath]
set parsed {}
foreach line $lines {
set parts [split $line "¬"]
if {[llength $parts] >= 2} {
set lnick [string trim [lindex $parts 0]]
set lmsg [string trim [join [lrange $parts 1 end] "¬"]]
if {$lnick ne "" && $lmsg ne ""} {
lappend parsed[list $lnick $lmsg]
}
}
}
if {[llength $parsed] == 0} {
putserv "PRIVMSG $chan :\0034Log dosyası boş veya format hatalı (nick¬mesaj olmalı).\003"
return
}
set ::logdata($k) $parsed
set ::logdata($k,index) 0
set ::logdata($k,active) 0
putserv "PRIVMSG $chan :\0033$id. log ($filename) $k kanalına yüklendi. Satır sayısı: [llength $parsed]\003"
# Eger konusma modu aciksa hemen baslat
if {[info exists ::cycle(Konusma)] && $::cycle(Konusma) eq "on"} {
set ::logdata($k,active) 1
_start_log_speak $k
putserv "PRIVMSG $chan :\0033Log konuşması başlatıldı.\003"
} else {
putserv "PRIVMSG $chan :\0032Bilgi:\003 Loglar yüklendi. Konuşmayı başlatmak için \0034!konuşma on\003"
}
}
proc pub_konusma {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set arg [string tolower [lindex $text 0]]
if {$arg eq "on"} {
set ::cycle(Konusma) "on"; _save_cycle
putserv "PRIVMSG $chan :\0033Log konuşma modu açıldı.\003"
# Aktif loglari baslat
foreach key [array names ::logdata] {
if {[string match "*,index" $key] || [string match "*,active" $key]} continue
if {![info exists ::logdata($key,active)] || !$::logdata($key,active)} {
if {[llength $::logdata($key)] > 0} {
set ::logdata($key,active) 1
set ::logdata($key,index) 0
_start_log_speak $key
}
}
}
} elseif {$arg eq "off"} {
set ::cycle(Konusma) "off"; _save_cycle
putserv "PRIVMSG $chan :\0034Log konuşma modu kapatıldı.\003"
foreach key [array names ::logdata] {
if {[string match "*,index" $key] || [string match "*,active" $key]} continue
set ::logdata($key,active) 0
}
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !konuşma <on|off> (Durum: [_durum Konusma])"
}
}
proc pub_ozelkonusma {nick uhost hand chan text} {
if {![_isadmin $nick]} return
set arg [string tolower [lindex $text 0]]
if {$arg eq "on"} {
set ::cycle(Cvp) "on"; _save_cycle; putserv "PRIVMSG $chan :\0033Özel konuşma modu açıldı.\003"
} elseif {$arg eq "off"} {
set ::cycle(Cvp) "off"; _save_cycle; putserv "PRIVMSG $chan :\0034Özel konuşma modu kapatıldı.\003"
} else {
putserv "PRIVMSG $chan :\0034Kullanım:\003 !özelkonuşma <on|off> (Durum: [_durum Cvp])"
}
}
# ----- TIMER VE BASLANGIC DONGUSU -----
catch {unbind time - * _cycle_time_trigger}
bind time - * _cycle_time_trigger
proc _cycle_time_trigger {min hour day month year} {
_cycle_kontrol
}
# Cycle rotasyonu - her 30-60 dk'da bir botlar cikis yapiyor
proc _start_cycle_rotation {} {
set dakika [expr {[_rand 30 60]}]
if {[info exists ::cycle(cycletime)] && [string is integer -strict $::cycle(cycletime)] && $::cycle(cycletime) >= 10} {
set dakika $::cycle(cycletime)
}
set ms [expr {$dakika * 60 * 1000}]
putlog "TRCycle: Sonraki cycle rotasyonu $dakika dakika sonra."
after $ms[list _cycle_rotate_and_reschedule]
}
proc _cycle_rotate_and_reschedule {} {
_cycle_rotate
_start_cycle_rotation
}
# Baslangicta calistir
_load_cycle
set ::cycle(durum) "on"
_cycle_kontrol
_start_cycle_rotation
putlog "TRCycle Eggdrop basariyla yuklendi." Hata veya kurulum yapamazsaniz, mesaj ve sunucuya gelerek iletebilirsiniz. |