Toprak
Coder
- Katılım
- 28 Şub 2024
- Mesajlar
- 1
- Tepkime puanı
- 1
- Puanları
- 1
İtibar:
Merhaba,
Geçen ramazan trsohbet.net için yapmıştım belki birilerinin işine yarar.
Geçen ramazan trsohbet.net için yapmıştım belki birilerinin işine yarar.
Kod:
;==========================================================
; IFTAR BOTU
; Tarih: 22.03.2023 - Salı
;-
alias _ibot return IFtar
alias _pass return 4234fsd
alias _ident return IFTAR
alias _username return IFTAR Bot
alias _oper return Opernick Operpass
alias _sunucu return irc.TRSohbet.NET
alias _sunucuip return 185.244.147.53
alias _port return 6667
;- Botun gireceği kanallar
alias _if-kanallar return #Sohbet #Radyo #Oyun
;- iftar sorgulama
on *:sockopen:iftar*:{
if ($sockerr) { swibot privmsg $token($sock($sockname).mark,2,172) $+(:,$_qt3(HATA),:) Sorgu yapılan siteye şu an bağlanamıyor. | sockclose $sockname }
else {
sockwrite -nt $sockname GET $+(/iftar.php?il=,$token($sock($sockname).mark,1,172)) HTTP/1.1
sockwrite -nt $sockname Host: $sock($sockname).addr
sockwrite -nt $sockname Connection: keep-alive
sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
sockwrite -nt $sockname Upgrade-Insecure-Requests: 1
sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
sockwrite -nt $sockname Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4
sockwrite -nt $sockname $crlf
}
}
on *:sockread:iftar*:{
var %:iftar | sockread %:iftar | tokenize 32 %:iftar
if $regex($1-,/<durum>Hata<\/durum>/Si) { swibot privmsg $token($sock($sockname).mark,2,172) $+(:4,$token($sock($sockname).mark,1,172),) IL ismi hatalı! | sockclose $sockname }
elseif $regex(i,$1-,/ili için bilgiler/Si) {
swibot privmsg $token($sock($sockname).mark,2,172) :4———————–1<12 $upper($token($sock($sockname).mark,1,172)) 1>4———————
swibot privmsg $token($sock($sockname).mark,2,172) :
}
elseif $regex(i,$1-,/<durum>(.+)\= (.+)<\/durum>/Si) { swibot privmsg $token($sock($sockname).mark,2,172) $+(:,$regml(i,1)) : $regml(i,2) }
elseif $regex($1-,/<durum>Bitti!<\/durum>/Si) {
swibot privmsg $token($sock($sockname).mark,2,172) :
swibot privmsg $token($sock($sockname).mark,2,172) :4———————–1<12 $upper($token($sock($sockname).mark,1,172)) 1>4———————
sockclose $sockname
}
}
;- Iftar süresi gelince oto bildirme
alias _iftar { sockopen $+(ikontrol,$left($calc($ticks * $r(5,99)),$r(4,8))) igs.mirc.net.tr 80 }
on *:sockopen:ikontrol*:{
if ($sockerr) { sockclose $sockname }
else {
sockwrite -nt $sockname GET /saatler.php HTTP/1.1
sockwrite -nt $sockname Host: $sock($sockname).addr
sockwrite -nt $sockname Connection: keep-alive
sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
sockwrite -nt $sockname Upgrade-Insecure-Requests: 1
sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
sockwrite -nt $sockname Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4
sockwrite -nt $sockname $crlf
}
}
on *:sockread:ikontrol*:{
var %:ikontrol | sockread %:ikontrol | tokenize 32 %:ikontrol
if $regex(s,$1-,/<durum>Sehir: (.+) - Sure: (.+) \/ \((.+)\)<\/durum>/Si) {
if !$timer($+($lower($regml(s,1)),_iftar-s)) { $+(.timer,$lower($regml(s,1)),_iftar-s) 1 $regml(s,3) _iftar-s $regml(s,1) $regml(s,2) }
}
}
alias _iftar-s { _ame-iftar $+(4,$1) 2için iftar vakti $+([4,$2,2]) - ALLAH kabul etsin. }
alias _ame-iftar { swibot privmsg #Sohbet :ACTION $1- }
on *:start:$+(.timer,_saatkontrol) 0 10 _saatkontrol
alias _saat return $regsubex($replace($duration($1-),wks,hafta,days,gün,hrs,saat,mins,dakika,secs,saniye,wk,hafta,day,gün,hr,saat,min,dakika,sec,saniye),/(\d+)/gSi,\1 $chr(32))
;==========================================================
alias _nick return $remove($token($1,1,33),:)
alias swibot $iif($sock(ibot).status == active,sockwrite -nt ibot $1-)
alias _saatkontrol $iif(!$sock(ibot),sockopen ibot $_sunucuip $_port)
on *:sockclose:ibot:$+(.timer,_saatkontrol) 1 2 _saatkontrol
on *:sockopen:ibot:{
if ($sockerr) { sockclose $sockname | $+(.timer,_saatkontrol) 1 2 _saatkontrol }
else {
swibot NICK $+($_ibot,$left($calc($ticks * $r(5,99)),$r(4,8)))
swibot USER $_ident "" $+(",$_sunucuip) $+(:,$_username)
sockmark $sockname $_ibot
}
}
on *:sockread:ibot:{
sockread -nf &ibot | tokenize 32 $bvar(&ibot,1-).text
if $regex($1,/^PING$/) { swibot pong $remove($2,:) }
elseif $regex($1,/^ERROR$/i) { sockclose $sockname | $+(.timer,_saatkontrol) 1 2 _saatkontrol }
elseif $regex($2,/^(471|473|474|475)$/) { swibot sajoin $_ibot $4 }
elseif $regex($2,/^(411|481)$/) { swibot oper $_oper | swibot nick $_ibot | swibot nickserv identify $_pass }
elseif $regex($2,/^433$/) { swibot NICK $+($_ibot,$left($calc($ticks * $r(10,999)),$r(6,8))) }
elseif $regex($2,/^001$/) {
swibot oper $_oper
swibot ns ghost $_ibot $_pass
swibot ns release $_ibot $_pass
swibot join #0,0
.timer 1 3 swibot nick $_ibot
}
elseif $regex($2,/^NICK$/i) {
if ($_nick($1) == $_ibot) { swibot ns ghost $_ibot $_pass | swibot ns release $_ibot $_pass | .timer 1 3 swibot nick $_ibot }
elseif ($right($3,-1) == $_ibot) {
swibot ns identify $_pass
swibot oper $_oper
swibot join #0,0
$+(.timer,_saatkontrol) 0 20 _saatkontrol
$+(.timer,ibot-gir) 1 3 swibot sajoin $right($3,-1) $replace($_if-kanallar,$chr(32),$chr(44))
$+(.timer,_iftar) 0 30 _iftar
}
}
elseif $regex($2,/^PART$/i) && ($_nick($1) == $_ibot) && $istok($_if-kanallar,$3,32) { swibot sajoin $_nick($1) $3 }
elseif $regex($2,/^KICK$/i) && ($4 == $_ibot) && $istok($_if-kanallar,$3,32) { swibot sajoin $4 $3 }
elseif $regex($2,/^JOIN$/i) {
if ($_nick($1) == $_ibot) {
if $istok($_if-kanallar,$right($3,-1),32) { swibot mode $right($3,-1) -qao+h $str($+($_nick($1),$chr(32)),5) | swibot chghost $_nick($1) $_host }
else { swibot sapart $_nick($1) $right($3,-1) }
}
}
elseif $regex($2,/^MODE$/i) && $regex($3,/^#/) {
if $regex($4,^\+(\S+)?(b)(\S+)?) && $regex($5-,/(^|\s) $+ $_ibot $+ !\*@\*/i) { swibot mode $3 -b $_ibot }
elseif $regex($5-,/(^|\s) $+ $_ibot $+ (\s|$)/i) { swibot mode $3 -qao+h $str($+($_ibot,$chr(32)),5) }
}
elseif $regex($2,/^PRIVMSG$/Si) && $istok($_if-kanallar,$3,32) {
if $regex($remove($4,:),/^[!.-][ıiİ]ftar$/Si) {
if $hget(CHNiftar,$_nick($1)) { swibot notice $_nick($1) $+(:,$_qt3(Bilgi),:) $+(4,$remove($4,:),) komutunu kullanmanız için $_saat($hget(CHNiftar,$_nick($1)).unset) beklemeniz gerek. }
elseif !$5 { swibot privmsg $3 :2Lütfen 4!iftar 2<4IL2> olarak belirtiniz. }
else { .hinc -msu60 CHNiftar $_nick($1) | var %:i = $replace($lower($strip($5)),ç,c,ğ,g,ş,s,ı,i,ö,o,ü,u,Ç,c,Ğ,g,Ş,s,İ,i,I,i,Ö,o,Ü,u) | sockopen $+(iftar,$_nick($1)) igs.mirc.net.tr 80 | sockmark $+(iftar,$_nick($1)) $+(%:i,¬,$3) }
}
}
}