]olayın daha stabil çalışan 2. versiyonu
tüm bunlarla; geliştirici, mIRC dağıtıcı ve kullanıcı arkadaşlara eğlenceli kullanımlar dilerim.
Kod: Kodu kopyalamak için üzerine çift tıklayın!
/*
##### LANG & TRANSLATION #####
add another type [LANG=xx-XX] iso-codes
default Translation EN->TR
*/
[LANG=tr-TR]
Quote=Alıntı
Ban=Banla
Follow=Takip
Query=Özel
Whois=KimLik
[LANG=en-US]
Quote=Quote
Ban=Block
Follow=Follow
Query=PMsg
Whois=Who?
[LANG&]
alias trans {
; <iso-code> <string|defval>
; using $trans($lang,Banx) [ISO-CODE,Traslation_Words]
; if not set return default "Traslation_Word"
if (!%lang~) lang
else {
if (!$readini($script,$+(lang=,$1),$2)) return $2
return $readini($script,$+(lang=,$1),$2)
}
}
alias add:icon {
;<drawtext|switch><win-name><color|$rgb(x,x,x)|0-15><"font"><font size> <coord: x|y> <text-icon>
set %i~ 20
var %t~ 48, %tcolor $rgb(0,0,0), %icolor $rgb(0,0,0)
drawtext -rf $win(name) %icolor Wingdings 48 10 %i~ ~
drawtext -rf $win(name) %tcolor verdana 10 8 48 $trans($lang,quote)
drawtext -rf $win(name) $iif(!$notify(%nick) ,%icolor,$rgb(210,210,210)) $qt(Webdings) 32 43 %i~ `
drawtext -r $win(name) %tcolor verdana 10 43 %t~ $trans($lang,Follow)
drawtext -r $win(name) $iif(!$query(%nick) ,%icolor,$rgb(210,210,210)) Webdings 28 80 %i~ ^
drawtext -r $win(name) %tcolor verdana 9 80 %t~ $trans($lang,query)
drawtext -r $win(name) %icolor Webdings 28 116 %i~ i
drawtext -r $win(name) %tcolor verdana 10 116 %t~ $trans($lang,whois)
drawtext -r $win(name) $iif($me isop %h:win,%icolor,$rgb(210,210,210)) Webdings 28 158 %i~ x
drawtext -r $win(name) %tcolor verdana 10 162 %t~ $trans($lang,Ban)
drawline -r $win(name) $rgb(0,0,0) 10 10 100
; Close icon
;drawtext -r $win(name) $rgb(255,0,0) $qt(Wingdings 2) 16 205 0 T
}
menu @cc:hover:tooltipop:menu {
; coordinates <button x|y> <command |%nick[%1~ = raw text-line hover]>
sclick: {
set %cl~ 1
if ($mouse.x >= 207 && $mouse.x <= 217 && $mouse.y > 0 && $mouse.y <= 14 ) { win -c }
elseif ( $mouse.x >= 0 && $mouse.x <= 32 && $mouse.y >= %i~ && $mouse.y <= %wh~) {
drawtext -r $win(name) $rgb(190,0,0) Wingdings 48 10 20 ~
editbox $noqt(%h:win) $qt(%1~)
}
elseif ($mouse.x >= 45 && $mouse.x <= 70 && $mouse.y >= %i~ && $mouse.y <= %wh~ ) {
drawtext -r $win(name) $rgb(190,0,0) $qt(Webdings) 32 43 $calc(%i~ -1) `
$iif($notify(%nick),notify -r %nick,notify %nick)
}
elseif ($mouse.x >= 80 && $mouse.x <= 106 && $mouse.y >= %i~ && $mouse.y <= %wh~) {
if !$query(%nick) {
drawtext -r $win(name) $rgb(190,0,0) Webdings 28 80 %i~ ^
query %nick | win -c
}
}
elseif ($mouse.x >= 116 && $mouse.x <= 150 && $mouse.y >= %i~ && $mouse.y <= %wh~ ) whois %nick
elseif ($mouse.x >= 158 && $mouse.x <= 183 && $mouse.y >= %i~ && $mouse.y <= %wh~ && $me isop %h:win) { ban $address(%nick,1) }
}
mouse: {
/*
" The mouse hover effect will be included in the next version. "
if ( ($mouse.x >= 0 && $mouse.x <= 32) && ($mouse.y >= %i~ && $mouse.y <= %wh~) ) drawtext -r $win(name) $rgb(255,255,0) Wingdings 48 10 20 ~
*/
}
leave: { if (%cl~) { win -c } | unset %cl~ }
rclick: {
win -c
}
uclick: { add:icon }
}
on 1:HOTLINK:*:#:{
set %hwin $qt($active)
if ($hotlink(match).type == nick ) && (%apa~) {
if ($regsubex($1,/([\<\>\[\]\{\}\(\)\{\}\\\/\\\"\*\!\@\+\%\&\.])/gui,) ison $chan) set %nick $v1
var %c~ $chan
if (%nick ison $chan && %nick != $me) {
var %i = 1 | while . {
if ($nick($chan, %i) == %nick) {
.timer_snick -m 1 100 sline -m %c~ %i
.clear -c %wn~
break
}
inc %i
}
sline -r %c~ | set %1~ $hotline | set %h:win #
noop $win($win(name),$calc($window(#).x + $width($regsubex($replace($hotline,$chr(32),_), /^(.*?) $+ %nick $+ .*/, \1),$window(#).font,$window(#).fontsize,bipt) $win(left)),$calc($mouse.dy - %wh~ -5),$hotline).mkwin
}
}
else .timer_winc -m 1 90 win -c
halt
}
on 1:OPEN:*:*: win -c
on 1:APPACTIVE: if (!$appactive) win -c %wn~ | set %apa~ $appactive
on 1:ACTIVE:*: {
if ($active == $win(name)) add:icon
if ($lactive == $win(name)) || (!$lactive) || (%hwin == $qt(lactive)) || ($active != %wn~) { win -c }
}
alias win {
if (!%lang~) { lang | .timer_rehashwin 1 1 win }
if (%lang~) {
set %wn~ @cc:hover:tooltipop:menu
set %ww~ 220
set %wh~ 60
set %transp~ 10
if ($isid) {
if ($prop == mkwin) {
window -aodbvDHf0pBw0g0 +bLex $1 $2 $3 %ww~ %wh~
; if you need transparent window set to top var.: %transp~ 20 (20%)
setlayer $int($calc(255 / $+(1.,%transp~))) $1
drawrect -rf %wn~ $rgb(255,255,255) 0 0 -2 $calc(%ww~ - 1) 20
drawline -rf %wn~ $rgb(124,127,127) 1 1 17 $calc(%ww~ - 1) 17 %ww~
drawtext -rf %wn~ $rgb(0,0,0) Verdana 12 5 0 $iif($width($address(%nick,5), $window($1).font, $window($1).fontsize) > %ww~, $s:address(%nick, %wn~, %ww~), $s:address(%nick,5))
drawtext -rf %wn~ $rgb(200,0,0) Verdana 12 5 0 %nick
}
}
if ($1 == name) { clear -c %wn~ | return %wn~ }
if ($1 == -c) { $iif($window(%wn~), window -c %wn~) }
if ($1 == top) { return + 10 }
if ($1 == left) { return 0 }
}
}
alias s:address {
var %addr $remove($address($1, 5),~),%width $width(%addr,$window($2).font,$window($2).fontsize),%maxw $calc($3 -20)
if (%width > %maxw) return $left(%addr, $calc($len(%addr) * %maxw / %width)) $+ ...
else return %addr
}
alias lang {
if ($isid && %lang~) { return %lang~ }
else {
var %tempBatFile = C:\Windows\Temp\getlang.bat
var %tempResultFile = C:\Windows\Temp\langresult.txt
.write -c %tempBatFile powershell -Command "(Get-UICulture).Name" > %tempResultFile
.run -h cmd.exe /c start /b %tempBatFile
.timer_getl 0 1 read:LanguageResult %tempResultFile %tempBatFile
}
}
alias read:LanguageResult {
if $file($1) {
if $read($1, n, 1) {
set %lang~ $read($1, n, 1)
.timer_getl off
.timer 1 1 .remove -fo $1
.timer 1 1 .remove -fo $2
}
}
}