ChatGPT'den fikir almak için kodun daha hızlı çalışan bir versiyonunu istedim güzel ve farklı bir çalışma yaptı
Kod: Kodu kopyalamak için üzerine çift tıklayın!
##### Proxy Koruması ßy Proxy (Optimize Edilmiş) #####
on *:start: {
echo -a 7[Proxy] 2Proxy koruması başlatılıyor...
.timeripal 0 1800 ipal
}
#proxy off
; Proxy kontrol alias (hash tabanlı)
alias isProxyFast {
var %ip = $1
if (!$hget(proxies,0)) loadProxyHash
if ($hget(proxies,%ip)) return 1
var %n = $hget(proxies_wild,0), %i = 1
while (%i <= %n) {
var %w = $hget(proxies_wild,%i)
if (%w && (%ip iswm %w)) return 1
inc %i
}
return 0
}
; proxy.txt dosyasını hash tablosuna yükle
alias loadProxyHash {
if (!$file(proxy.txt)) { echo -a 7[Proxy] proxy.txt bulunamadı! | return }
if ($hget(proxies)) { hfree proxies }
if ($hget(proxies_wild)) { hfree proxies_wild }
hmake proxies 50000
hmake proxies_wild 10000
var %i = 1, %l
while (%l = $read(proxy.txt, %i)) {
%l = $remove(%l, $chr(13), $chr(10), $chr(9), $chr(32))
if (* iswm %l) { hadd proxies_wild %l 1 }
else { hadd proxies %l 1 }
inc %i
}
echo -a 7[Proxy] 3Proxy veritabanı yüklendi — $hget(proxies,0) IP, $hget(proxies_wild,0) wildcard.
}
; Raw WHO (352) eventinde proxy kontrolü
raw 352:*: {
var %nick = $3, %ip = $gettok($4,1,46)
if ($isProxyFast(%ip)) {
if (!$read(proxylast.txt,w,$+(*,%ip,*))) {
gzline $+(*@,%ip) 1h 4Proxy/Anon giriş tespit edildi: %nick (%ip)
write proxylast.txt %ip $ctime
}
}
}
; Proxy listesi kaynaklarından çekim (ipal)
alias ipal {
echo -a 7[Proxy] 2Proxy listesi güncelleniyor...
.remove proxy.txt
sockopen ipcek1 multiproxy.org 80
}
on *:sockopen:ipcek1: {
sockwrite -n $sockname GET /txt_all/proxy.txt HTTP/1.1
sockwrite -n $sockname Host: multiproxy.org
sockwrite -n $sockname $crlf
}
on *:sockread:ipcek1: {
var %l
sockread %l
if (*.*.*:* iswm %l) && (*a* !iswm %l) { write proxy.txt %l }
}
on *:sockclose:ipcek1: {
sockopen ipcek2 proxylists.net 80
}
on *:sockopen:ipcek2: {
sockwrite -n $sockname GET /socks4.txt HTTP/1.1
sockwrite -n $sockname Host: proxylists.net
sockwrite -n $sockname $crlf
}
on *:sockread:ipcek2: {
var %l
sockread %l
if (*.*.*:* iswm %l) && (*a* !iswm %l) { write proxy.txt %l }
}
on *:sockclose:ipcek2: {
echo -a 7[Proxy] 3Proxy listesi güncellendi. ($lines(proxy.txt) kayıt)
loadProxyHash
}
; Menü kontrolü
menu channel,menubar {
» Proxy Koruması
.» Aç:.enable #proxy | echo -a 7[Proxy] 2Koruma açıldı.
.» Kapat:.disable #proxy | echo -a 7[Proxy] 4Koruma kapatıldı.
.-
.» Proxy Listesini Güncelle:.ipal
}
#proxy end