# cycle.tcl - Sahte services kullanıcıları nick.txt üzerinden join/part/quit yapar
# Özellikler:
# ✅ Rastgele delay süresi
# ✅ Saat aralığı kontrolü (örn: 22:00 - 02:00)
set cycle(chan) "#genel" ;# Hedef kanal
set cycle(delaymin) 40 ;# Minimum bekleme süresi
set cycle(delaymax) 90 ;# Maksimum bekleme süresi
set cycle(nickfile) "nick.txt" ;# Kullanıcı nicklerinin bulunduğu dosya
set cycle(start_hour) 22 ;# Başlangıç saati (örnek: 22:00)
set cycle(end_hour) 2 ;# Bitiş saati (örnek: 02:00)
bind evnt - init-server cycle:init
proc cycle:init {} {
global cycle
set cycle(users) [cycle:loadnicks $cycle(nickfile)]
cycle:next 0
}
proc cycle:loadnicks {filename} {
if {[file exists $filename]} {
set fp [open $filename r]
set data [split [read $fp] "\n"]
close $fp
return [lsearch -inline -all $data *]
} else {
putlog "cycle.tcl: nick.txt bulunamadı!"
return {}
}
}
proc cycle:inTimeRange {} {
global cycle
set now_hour [clock format [clock seconds] -format %H]
set hour [expr {int($now_hour)}]
set start $cycle(start_hour)
set end $cycle(end_hour)
if {$start < $end} {
return [expr {($hour >= $start) && ($hour < $end)}]
} else {
# Gece geçişi (örn: 22:00 - 02:00 gibi)
return [expr {($hour >= $start) || ($hour < $end)}]
}
}
proc cycle:randdelay {} {
global cycle
return [expr {int(rand() * ($cycle(delaymax) - $cycle(delaymin) + 1)) + $cycle(delaymin)}]
}
proc cycle:next {index} {
global cycle
if {![cycle:inTimeRange]} {
putlog "cycle.tcl: Saat aralığı dışında. Kontrol 60s sonra tekrar edilecek."
utimer 60 [list cycle:next $index]
return
}
if {[llength $cycle(users)] == 0} {
putlog "cycle.tcl: Kullanıcı listesi boş!"
return
}
if {$index >= [llength $cycle(users)]} {
set index 0
}
set nick [lindex $cycle(users) $index]
set nextindex [expr {$index + 1}]
set chan $cycle(chan)
putquick "NICK $nick"
putquick "JOIN $chan"
set delay [cycle:randdelay]
putlog "cycle.tcl: $nick -> $chan (delay: $delay saniye)"
utimer $delay [list cycle:part $nick $chan $nextindex]
}
proc cycle:part {nick chan nextindex} {
putquick "PART $chan"
utimer 2 [list putquick "QUIT :Cycled out"]
utimer 4 [list cycle:next $nextindex]
}
# cycle.tcl - Eggdrop Sahte Services Bot Cycle Sistemi
# Kodlayan: OpenAI - 2025
# Ayarlar
set cycle_channel "#kanaladi"
set cycle_delay_min 30
set cycle_delay_max 60
set cycle_hour_start 22
set cycle_hour_end 2
set cycle_nickfile "nick.txt"
# Değişkenler
set cycle_users {}
set cycle_active 1
# Nick listesini yükle
proc load_cycle_nicks {} {
if {![file exists $::cycle_nickfile]} { return }
set f [open $::cycle_nickfile r]
set data [read -nonewline $f]
close $f
set ::cycle_users [split $data "\n"]
}
# Rastgele delay belirle
proc rand_cycle_delay {} {
return [expr {$::cycle_delay_min + int(rand() * ($::cycle_delay_max - $::cycle_delay_min + 1))}]
}
# Geçerli saat
proc get_hour {} {
return [clock format [clock seconds] -format "%H"]
}
# Saat kontrolü
proc cycle_check_time {} {
set hour [get_hour]
if {$::cycle_hour_end < $::cycle_hour_start} {
return [expr {$hour >= $::cycle_hour_start || $hour < $::cycle_hour_end}]
} else {
return [expr {$hour >= $::cycle_hour_start && $hour < $::cycle_hour_end}]
}
}
# Cycle işlemi
proc cycle_user {} {
if {!$::cycle_active} return
if {![cycle_check_time]} {
utimer 60 cycle_user
return
}
if {[llength $::cycle_users] == 0} {
load_cycle_nicks
}
set nick [lindex $::cycle_users [expr {int(rand() * [llength $::cycle_users])}]]
set delay [rand_cycle_delay]
# JOIN
putquick "PRIVMSG OperServ :RAW :NICK $nick"
utimer 1 [list putquick "PRIVMSG OperServ :RAW :USER $nick * * :Cycle Bot"]
utimer 2 [list putquick "PRIVMSG OperServ :RAW :JOIN $::cycle_channel"]
# PART (kanaldan çıkış)
utimer [expr {$delay - 2}] [list putquick "PRIVMSG OperServ :RAW :PART $::cycle_channel :Cycle Part"]
# QUIT (sunucudan çıkış)
utimer [expr {$delay}] [list putquick "PRIVMSG OperServ :RAW :QUIT :Cycle Out"]
# Tekrarla
utimer [expr {$delay + 5}] cycle_user
}
# Başlat / Durdur
proc cycle_start {} {
set ::cycle_active 1
load_cycle_nicks
cycle_user
}
proc cycle_stop {} {
set ::cycle_active 0
}
# Komutlar
bind pub o !cyclestart pub_cycle_start
bind pub o !cyclestop pub_cycle_stop
bind pub o !cyclereload pub_cycle_reload
proc pub_cycle_start {nick uhost hand chan arg} {
cycle_start
putserv "PRIVMSG $chan :Cycle bot başlatıldı."
}
proc pub_cycle_stop {nick uhost hand chan arg} {
cycle_stop
putserv "PRIVMSG $chan :Cycle bot durduruldu."
}
proc pub_cycle_reload {nick uhost hand chan arg} {
load_cycle_nicks
putserv "PRIVMSG $chan :nick.txt yeniden yüklendi."
}
# Otomatik başlat
load_cycle_nicks
cycle_user