יוצר: Ohad
גירסא: 1.02
תיאור: הקוד מחפש ניקים בערוץ האקטיבי בו אתם נמצאים
הפעלה: מפורט בתחילת הקוד (ועוד מספר פרטים)
תמונה:
קוד: בחר הכל
; ——————————————————————————————————————————————— ;
; Find nick by Ohad v1.03
; This Snippets allows you to search for nicks in the channel
; Syntax: /find [-n] <searchstring>
;
; /fnick @+o* ---> finding all the nicks staring with o and has op or voice
; /fnick -n =+*a* ---> finding all the nicks except the regular, voiced, and doesn't have 'a' wildcard in thier nick
;
; After opening the window you can search again in the same window
; When you double click on any nick it will be copied to the clipboard
; ——————————————————————————————————————————————— ;
alias fnick {
noop $regsubex($iif($1 == -n,$2,$1),/([ $prefix $+ = ]*)(.*)/g,)
if ($mid($1,1,1) isin $prefix $+ =) { var %find.pre $replace($regml(1),=,r) }
elseif ($1 == -n) { var %find.pre $+(a,$chr(44),$replace($regml(1),=,r)) }
if ($1 == $null || ($1 == -n && !$2)) { $iif($window(@fnick),find.clear) | unset %find.nicklist | return }
if ($active ischan) || (%find.nicklist.channel) {
if (!%find.nicklist.channel) { set %find.nicklist.channel $chan }
var %x 1,%y 1,%# %find.nicklist.channel,%find.text $regml(2)
if (!$window(@fnick)) { window -dhklne +L @fnick $calc($window(%#).dx +4) $calc(($window(%#).dy + $window(%#).dh) -138) 120 154 }
else { find.clear }
titlebar @fnick in %find.nicklist.channel
editbox @fnick $iif($1 == -n,$1-2,$1)
window -a @fnick
if (%find.pre) {
while ($nick(%#,%x,[ $+ [ %find.pre ] ])) {
var %nick $v1
if (%find.text iswm %nick && $1 != -n) || (%find.text !iswm %nick && $1 == -n) || (!%find.text) { find.aline %nick %find.text | inc %y }
inc %x
}
if (%y == 1) { find.notmatch $1- | return }
}
elseif (!$fline(%#,$1,0,1).text) { find.notmatch $1 | return }
else { while ($fline(%#,$1,%x,1).text) { find.aline $fline(%#,$1,%x,1).text %find.text | inc %x } }
aline @fnick $cr $cr
aline 14 @fnick $+($chr(31),Found $calc($iif(%y > 1,%y,%x) -1) nicks,$chr(31))
}
}
alias -l find.getnick {
var %x 1,%p
while ($line(@fnick,$sline(@fnick,%x).ln)) {
var %v1 $v1
if ($numtok($v1,32) == 1) %p = $addtok(%p,$mid(%v1,$iif($left(%v1,1) isin $prefix,2,1)),44)
inc %x
}
return %p
}
alias -l find.close { unset %find.nicklist* | window -c @fnick }
alias -l find.notmatch { dline -d @fnick 1- | aline -l @fnick No match for: $iif($2,$2,$1) }
alias -l find.clear { dline @fnick 1- }
alias -l find.aline {
var %prefix $iif($left($nick(%find.nicklist.channel,$1).pnick,1) != $left($1,1),$v1),%n $iif($1 == $me,14,$replace(%prefix,*,01,~,01,&,01,@,01,%,01,+,12))
aline $iif(%n,%n,02) @fnick $+(%prefix,$replace($1,$remove($2,*,?,&),$+(,$remove($2,*,?,&),)))
}
menu @fnick {
dclick:if ($numtok($find.getnick,32) == 1) { query $strip($find.getnick) | if ($line(@fnick,0) <= 3) { find.close } }
$style(2) $+ %find.nicklist.channel:noop
-
$iif($numtok($find.getnick,32) == 1,say) :{ msg %find.nicklist.channel $find.getnick }
$iif($numtok($find.getnick,32) == 1,copy) :clipboard $strip($find.getnick)
-
close:{ find.close }
}
on *:close:@fnick:{ unset %find.nicklist* }
on *:active:*:if ($window(@fnick) && $active != @fnick) { find.close }
on *:input:@fnick:{ fnick $1- | beep }