merhaba arkadaşlar Selamun aleyküm ya bi siteden bi kod buldum mircime yükledim ama çalışmıyor acaba nerede hata var bi bakabilirmisiniz size zahmet
PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
alias trans {
var %trans.sockname = $+(trans,$chan,$nick,$right($time,2))
set %trans.nick $me
set %trans.chan $active
if (%trans.diag.chan) { set %trans.chan %trans.diag.chan }
unset %trans.diag.chan
set %trans.text $fixurl($3-)
set %trans.code $lower($replace($2,-,|,_,|))
set %trans.flag $1
sockclose %trans.sockname
set %transurl $+(/translate_t?langpair=,%trans.code,&text=,%trans.text)
set %transsite translate.google.com
sockopen %trans.sockname %transsite 80
.timer 1 10 sockclose %trans.sockname
.timer-trans 1 15 timeout
}
#TransTrigger on
On !*:Text:!trans*:#: {
if (%trans.inuse == 1) { .notice $nick Google çeviri kullandin! | trans.clear }
if (!$3) { .notice $nick Lütfen bir metin giriniz. !trans L1-L2 Metin | halt }
if (!$regex($left($2,3),/-|_/)) { .notice $nick $2- is Bilinmyen. Sözdizimi: !trans L1-L2 metin cevir | halt }
if (!$regex($left($2,2),/en|fr|nl|de|pt|it|es|sq|et|ca|hr|cs|da|et|tl|fi|gl|hu|id|lv|lt|mt|no|pl|ro|sk|sl|sv|tr/i)) {
.notice $nick $2- is Bilinmeyen. Sözdizimi: !trans L1-L2 metin cevir
halt
}
if (!$regex($right($2,2),/en|fr|nl|de|pt|it|es|sq|et|ca|hr|cs|da|et|tl|fi|gl|hu|id|lv|lt|mt|no|pl|ro|sk|sl|sv|tr/i)) {
.notice $nick $2- is Bilinmeyen. Sözdizimi: !trans L1-L2 metin cevir
halt
}
set %trans.inuse 1
set %trans.nick $nick
set %trans.chan $chan
set %trans.text $fixurl($3-)
set %trans.code $lower($replace($2,-,|,_,|))
set %trans.flag -a
sockclose trans
set %transurl $+(/translate_t?langpair=,%trans.code,&text=,%trans.text)
set %transsite translate.google.com
sockopen trans %transsite 80
.timer-trans 1 15 timeout
}
#TransTrigger end
on *:sockopen:trans*: {
sockwrite -n $sockname GET %transurl HTTP/1.1
sockwrite -n $sockname Host: %transsite $+ $CRLF $+ $CRLF
}
on *:sockread:trans*: {
if ($sockerr > 0) { echo -at Hata oluştu. Çeviri Olmayacaktir. Özür =D | trans.clear }
else {
sockread -fn &transvar
if ($bfind(&transvar, 1, <div id=result_box dir="ltr">).text) {
set %trans.mark1 $calc($bfind(&transvar, 1, <div id=result_box dir="ltr">).text + 28)
set %trans.mark2 $bfind(&transvar, $bfind(&transvar, 1, <div id=result_box dir="ltr">).text, </div>).text
if (%trans.flag == -a) { msg %trans.chan $fixhtml($bvar(&transvar, %trans.mark1, $calc(%trans.mark2 - %trans.mark1)).text) }
if (%trans.flag == -e) { echo -t %trans.chan 09 $+ $fixhtml($bvar(&transvar, %trans.mark1, $calc(%trans.mark2 - %trans.mark1)).text) }
if (%trans.flag == -d) { echo -t %trans.chan 09 $+ $fixhtml($bvar(&transvar, %trans.mark1, $calc(%trans.mark2 - %trans.mark1)).text) }
trans.clear
}
}
}
alias -l fixhtml {
var %fixmatch = $regex($1-,/(&#.*?;)/g), %fixtext = $1-
while (%fixmatch) {
%fixtext = $replace(%fixtext,$regml(%fixmatch),$chr($remove($regml(%fixmatch),&#,;)))
dec %fixmatch
}
return $remove(%fixtext,>,<,")
}
dialog Translate {
title "Kolay Çeviri Addon"
size -1 -1 152 137
option dbu
combo 1, 8 8 60 10, drop
combo 2, 84 8 60 10, drop
edit "", 3, 8 32 136 82, multi autovs
button "Çevir", 5, 56 115 38 12
combo 6, 84 21 60 10, drop
button "Kapat", 7, 104 115 38 12, cancel
button "Ekranı Sil", 8, 10 115 37 12
text "To", 9, 70 10 9 8, center
text "Bu yaziyi buraya gönder ------->", 10, 6 22 73 8, right
text "", 11, -2 128 153 8, center
}
On *:Dialog:Translate:Sclick:8: {
did -rf Translate 3
}
On *:Dialog:Translate:Sclick:5: {
if (!$did(translate,3).text) {
did -a Translate 11 Type some text in the box to translate
did -f Translate 3
.timer 1 3 did -a Translate 11
return
}
var %trans.text, %trans.lines = $did(translate,3).lines, %trans.count = 1
while (%trans.count <= %trans.lines) {
%trans.text = %trans.text $+ $did(Translate,3,%trans.count).text
inc %trans.count
}
if ($did(Translate,6).seltext == Echo Here) {
trans -d $langcode($+($did(Translate,1).seltext,_,$did(Translate,2).seltext)) %trans.text
}
else {
var %tlanguages = $langcode($+($did(Translate,1).seltext,|,$did(Translate,2).seltext))
set %trans.diag.chan $did(Translate,6).seltext
trans -a %tlanguages %trans.text
}
}
On *:Dialog:Translate:init:*: {
didtok Translate 1,2 44 English,German,Italian,Spanish,Portuguese,French,Dutch,Albanian,Estonian,Catalan,Croatian,Czech,Danish,Estonian,Filipino
didtok Translate 1,2 44 Galician,Hungarian,Indonesian,Latvian,Lithuanian,Maltese,Norwegian,Polish,Romanian,Slovak,Slovenian,Swedish,Turkish
did -c Translate 1 1
did -c Translate 2 2
did -ac Translate 6 Echo Here
if ($chan(0)) {
var %chan.count = $chan(0)
while %chan.count {
did -a Translate 6 $chan(%chan.count)
dec %chan.count
}
}
if ($query(0)) {
var %pm.count = $query(0)
while (%pm.count) {
did -a Translate 6 $query(%pm.count)
dec %pm.count
}
}
}
alias Trans_Chan {
if ($dialog(Trans_Chan)) { dialog -v Trans_Chan Trans_Chan }
else { dialog -m Trans_Chan Trans_Chan }
}
dialog Trans_Chan {
title "Çeviri Kanal & Özel"
size -1 -1 136 48
option dbu
combo 1, 0 0 60 10, drop
combo 2, 76 0 60 10, drop
text "To", 3, 64 2 9 8
edit "", 4, 0 15 135 10, autohs
button "Temizle", 5, 2 32 37 12
button "Gönder", 6, 50 32 37 12
button "Geri", 7, 96 32 37 12, cancel
}
On *:Dialog:Trans_Chan:Sclick:6: {
if (!$did(Trans_Chan,4).text) { did -f Trans_Chan 4 | return }
else {
var %tlanguages = $langcode($+($did(Trans_Chan,1).seltext,|,$did(Trans_Chan,2).seltext))
if ($active == status window) { trans -e %tlanguages $did(Trans_Chan,4).text }
else { trans -a %tlanguages $did(Trans_Chan,4).text }
}
}
On *:Dialog:Trans_Chan:Sclick:5: { did -rf Trans_Chan 4 }
On *:Dialog:Trans_Chan:init:*: {
didtok Trans_Chan 1,2 44 English,German,Italian,Spanish,Portuguese,French,Dutch,Albanian,Estonian,Catalan,Croatian,Czech,Danish,Estonian,Filipino
didtok Trans_Chan 1,2 44 Galician,Hungarian,Indonesian,Latvian,Lithuanian,Maltese,Norwegian,Polish,Romanian,Slovak,Slovenian,Swedish,Turkish
did -c Trans_Chan 1 1
did -c Trans_Chan 2 2
did -f Trans_Chan 4
}
dialog ClipTrans {
title "Google Çeviri"
size -1 -1 64 48
option dbu
combo 1, 1 0 63 10, drop
combo 2, 1 20 63 10, drop
text "To", 3, 24 11 9 8, center
button "Çevir", 4, 1 34 29 12
button "Kapat", 5, 34 34 29 12, cancel
}
alias ClipTrans {
if ($dialog(Cliptrans)) { dialog -v Cliptrans Cliptrans }
else { dialog -m Cliptrans Cliptrans }
}
On *:Dialog:ClipTrans:Sclick:4: {
var %tlanguages = $langcode($+($did(ClipTrans,1).seltext,|,$did(ClipTrans,2).seltext))
if ($cb(0)) { TransClip %tlanguages }
else { echo -a clipboard is empty }
}
On *:Dialog:ClipTrans:init:*: {
didtok ClipTrans 1,2 44 English,German,Italian,Spanish,Portuguese,French,Dutch,Albanian,Estonian,Catalan,Croatian,Czech,Danish,Estonian,Filipino
didtok ClipTrans 1,2 44 Galician,Hungarian,Indonesian,Latvian,Lithuanian,Maltese,Norwegian,Polish,Romanian,Slovak,Slovenian,Swedish,Turkish
did -c ClipTrans 1 2
did -c ClipTrans 2 1
}
alias -l httpstrip {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,',' ;)
return %x
}
alias -l fixurl return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2))
alias timeout {
echo -a Bağlantı zaman aşımına uğradı. Çeviri bulunamadi.
trans.clear
}
alias -l trans.clear {
unset %trans*
.timer-trans off
halt
}
alias transclip {
var %clip.count = $cb(0), %clip.counter = 1, %clip.time = 1, %trans.lang = $1
while (%clip.counter <= %clip.count) {
.timer 1 %clip.time trans -e %trans.lang $remove($strip($cb(%clip.counter)),$chr(124))
inc %clip.counter
inc %clip.time 2
}
}
alias Ford-Trans {
if (!$dialog(Translate)) { dialog -m translate translate }
else { dialog -v translate translate }
}
alias -l langcode {
var %langcode = $replace($1,english,en,german,de,italian,it,spanish,es,portuguese,pt,french,fr,dutch,nl,albanian,sq,estonian,et,catalan,ca,croatian,hr,czech,cs,$&
danish,da,estonian,et,filipino,tl,finnish,fi,galician,gl,hungarian,hu,indonesian,id,latvian,lv,lithuanian,lt,maltese,mt,norwegian,no,polish,pl,romanian,ro,slovak,sk,$&
slovenian,sl,swedish,sv,turkish,tr)
return %langcode
}
;****** End of Script....Start of Popups *******
menu * {
-
.Google Çeviri
..Kanala/Özele Gönder:Trans_Chan
..Pano Çeviri içeriği:ClipTrans
..DiaLogda Kullan:Ford-Trans
-
.$iif($group(#TransTrigger) == On,$style(1)) TransTrigger
..$iif($group(#TransTrigger) == On,$style(2)) On: .enable #TransTrigger
..$iif($group(#TransTrigger) == Off,$style(2)) Off: .disable #TransTrigger
-
}