|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I think maybe am asking to much here but we never know what scripters can do so hehe. Is it possible to make a script that when I place my mouse over a nick in the channel it will tell me if he has another clone in the channel?
Last edited by Garou; 20/08/07 11:46 PM.
|
|
|
|
Joined: May 2005
Posts: 74
Babel fish
|
Babel fish
Joined: May 2005
Posts: 74 |
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I dont need a clone scanner.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
Indeed. You need a clone scanner and an on hotlink event on ^*:HOTLINK:*:#: {
; set a comma separated string of all nick prefixes to remove these chars in the
; hotlink evaluation (that is: hotlink will also trigger when hovering over pnicks)
var %nr = 1, %prefix
while ($mid($prefix,%nr,1)) { var %prefix = $addtok(%prefix,$v1,44) | inc %nr }
; if the mouse hovers over a nick or pnick (thus the prefix thing above),
; make it a hotlink that executes the clonescan for that nick
; you might change/remove that prefix thing,
; and/or add a custom remove string,
; e.g. all chars that cannot be part of a nick.
; some regsub for this removal would be nice, too :)
if ($remove($1, [ %prefix ,<,> ] ) ison $chan) { clonescanwindow $v1 $chan }
halt
}
; the clonescan-and-show alias
alias -l clonescanwindow {
; make window or switch name of window
var %w = $+(@clonecheck,$chr(160),$2)
$iif(($window($+(@clonecheck,$chr(160),*),1)),renwin $v1 %w,window -doCk0w0 +L %w -1 -1 280 55)
; clear window content
clear %w
; no clones
if ($ialchan($+(*!*@,$ial($1).host),$2,0) == 1) { aline 9 %w $chr(2) no clones $+ $chr(15) of $1 }
; clones
else {
var %c = $calc($v1 -1)
aline 4 %w $chr(2) %c $iif((%c == 1),clone,clones) $+ $chr(15) of $1
}
}
; menu definition to close the clonecheck-window
menu @clonecheck* {
close window "clonecheck" : window -c $active
} Please note that all "hotlink scripts" make comparatively heavy use of your system ressources
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Very cool script...when i find clones can it show the nicks of found clones also in the window?
Last edited by Garou; 22/08/07 02:54 AM.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
This one is hiding if you hover the mouse over another word. I added comments for the new parts only, but there are some other minor changes - better grab the code again. on ^*:HOTLINK:*:#: {
var %nr = 1, %prefix
while ($mid($prefix,%nr,1)) { var %prefix = $addtok(%prefix,$v1,44) | inc %nr }
if ($remove($1, [ %prefix ,<,> ] ) ison $chan) { clonescanwindow $v1 $chan }
; mouse moving over another word in the channel window: hide clonecheck-window
elseif ($window($+(@clonecheck,$chr(160),*),1)) { window -h $v1 }
halt
}
; the clonescan-and-show alias
alias -l clonescanwindow {
; store active window to a var
var %a = $active, %w = $+(@clonecheck,$chr(160),$2)
; create a new- or restore and rename the old clonecheck-window
if ($window($+(@clonecheck,$chr(160),*),1)) {
renwin $v1 %w
window -o %w
}
else { window -doCk0w0 +L %w -1 -1 280 55 }
clear %w
if ($ialchan($+(*!*@,$ial($1).host),$2,0) == 1) { aline 9 %w $chr(2) no clones $+ $chr(15) of $1 }
else { aline 4 %w $chr(2) $calc($v1 -1) $iif(($v1 == 2),clone,clones) $+ $chr(15) of $1 }
; refocus stored active window
window -a %a
}
menu @clonecheck* {
close window "clonecheck" : window -c $active
} ... not that cunning, but I think it's ok. Ah: it makes it quite... tricky to "grab" the window's title bar (to move it arround etc) [hint: hold down left mouse button until you reach the window] EDIT: now you edited your request *grin* - tomorow I'll have a look at it again
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Thx mate...everyone will want to use this code....great scripting thx again.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
Now it will show the clone nicks as well. Personally, I dont like that little popup window. Window height should change according to the length of text (that is: the number of clones found and the font you are currently using) - that would be a mess! See below for an alternative... on ^*:HOTLINK:*:#: {
var %nr = 1, %prefix
while ($mid($prefix,%nr,1)) { var %prefix = $addtok(%prefix,$v1,44) | inc %nr }
if ($remove($1, [ %prefix ,<,> ] ) ison $chan) { clonescanwindow $v1 $chan }
; mouse moving over another word in the channel window: hide clonecheck-window
elseif ($window($+(@clonecheck,$chr(160),*),1)) { window -h $v1 }
halt
}
; the clonescan-and-show alias
alias -l clonescanwindow {
; store active window to a var
var %a = $active, %w = $+(@clonecheck,$chr(160),$2)
; create a new- or restore and rename the old clonecheck-window
if ($window($+(@clonecheck,$chr(160),*),1)) {
renwin $v1 %w
window -o %w
}
else { window -doCk0w0 +L %w -1 -1 300 80 }
clear %w
if ($ialchan($+(*!*@,$ial($1).host),$2,0) == 1) { aline 9 %w $chr(2) no clones $+ $chr(15) of $1 }
else {
; clones found: list the clones
var %c.num = $calc($v1 -1), %nr = 1, %clones
while ($ialchan($+(*!*@,$ial($1).host),$2,%nr).nick) {
if ($v1 != $1) { var %clones = $addtok(%clones,$v1,32) }
inc %nr
}
aline 4 %w $chr(2) %c.num $iif((%c.num == 1),clone,clones) $+ $chr(15) of $1
aline -p %w %clones
sline %w 2
}
; refocus stored active window
window -a %a
}
menu @clonecheck* {
close window "clonecheck" : window -c $active
} ...I prefer this one, using the new $tip feature menu channel {
-
$iif(($group(#mousepointerclones) == on),$style(1)) Mousepointer Clonescan...
.$iif(($group(#mousepointerclones) == on),$style(1)) enable : .enable #mousepointerclones
.$iif(($group(#mousepointerclones) == off),$style(1)) disable : .disable #mousepointerclones
}
#mousepointerclones off
on ^*:hotlink:*:#: {
; cycle possible nick prefixes to allow hotlink on pnicks
var %nr = 1, %prefix
while ($mid($prefix,%nr,1)) { var %prefix = $addtok(%prefix,$v1,44) | inc %nr }
if ($remove($1, [ %prefix ,<,> ] ) ison $chan) {
var %nick = $v1
; if no clone hotlink for that nick active
if ((!$($+(%,clonetip.queued.,%nick),2)) && (!$tip($+(clonetip.,%nick)))) {
set -u5 $+(%,clonetip.queued.,%nick) 1
var %host = $+(*!*@,$ial(%nick).host)
; if clones of that user present
if ($ialchan(%host,$chan,0) > 1 ) {
var %c.num = $calc($v1 -1), %nr = 1, %clones
; make a list of all clones
while ($ialchan(%host,$chan,%nr).nick) {
if ($v1 != %nick) { var %clones = $addtok(%clones,$+(•,$chr(160),$v1),32) }
inc %nr
}
; set tip layout
var %title = Clones found on $chan
var %line1 = $+($chr(2),%nick,$chr(2),:) %c.num $iif((%c.num == 1),Clone,Clones) $crlf
var %line2 = %host $crlf $+ $chr(160) $crlf
var %linex = $replace(%clones,$chr(32),$crlf) $crlf $+ $chr(160)
; show tip
noop $tip($+(clonetip.,%nick),%title,%line1 $+ %line2 $+ %linex,3,$null,$null,$null,$activewid)
}
}
}
halt
}
#mousepointerclones end EDIT: An alternative regsub suggestion (I'm not that good with regex) instead of the "remove prefix" part: on ^*:hotlink:*:#: {
if ($regsubex($1,/[^\w\-\]\\_^[{}|`]/g,$null) ison $chan) {
var %nick = $v1
...rest of hotlink... 2nd EDIT: $tip(name) will return $true if (quote) "it was successfully created", not if the tip was triggered and thus "queued". So I added a little "set -u" to prevent "text flooding" in the same window if you move the mouse over multiple clones quickly.
Last edited by Horstl; 22/08/07 06:18 PM.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
The second one you prefer is not working ??
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
Did you replace the old script and enable the new one (switch in menu)? It's working fine for me...
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Yes i did and its enable but nothing happens.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Ok found the problem....it works in 6.3 but not in 6.21 Any ideal why?
Last edited by Garou; 22/08/07 05:08 PM.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
$tip is a new feature of 6.3
Last edited by Horstl; 22/08/07 05:18 PM.
|
|
|
|
Joined: Jul 2006
Posts: 107
Vogon poet
|
Vogon poet
Joined: Jul 2006
Posts: 107 |
$tip feature was only added in v6.3
LonDart
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Yes it finds and popup in 6.3 only but not working at all in 6.21
|
|
|
|
Joined: Jan 2004
Posts: 509
Fjord artisan
|
Fjord artisan
Joined: Jan 2004
Posts: 509 |
Found this to be better in my liking. Just made it so if I mouse over (and wait), the window pops up. Otherwise it doesn't.
on ^*:HOTLINK:*:#: {
var %nr = 1, %prefix
while ($mid($prefix,%nr,1)) { var %prefix = $addtok(%prefix,$v1,44) | inc %nr }
edited line --> if ($remove($1, [ %prefix ,<,> ] ) ison $chan) { .timercs -m 1 700 clonescanwindow $v1 $chan $mouse.dx $mouse.dy $line($active,0) }
; mouse moving over another word in the channel window: hide clonecheck-window
elseif ($window($+(@clonecheck,$chr(160),*),1)) { window -h $v1 }
halt
}
; the clonescan-and-show alias
alias -l clonescanwindow {
new line--> if (($3 == $mouse.dx) && ($4 == $mouse.dy) && ($5 == $line($active,0))) {
; store active window to a var
var %a = $active, %w = $+(@clonecheck,$chr(160),$2)
; create a new- or restore and rename the old clonecheck-window
if ($window($+(@clonecheck,$chr(160),*),1)) {
renwin $v1 %w
window -o %w
}
else { window -doCk0w0 +L %w -1 -1 300 80 }
clear %w
if ($ialchan($+(*!*@,$ial($1).host),$2,0) == 1) { aline 9 %w $chr(2) No clones $+ $chr(15) of $1 }
else {
; clones found: list the clones
var %c.num = $calc($v1 -1), %nr = 1, %clones
while ($ialchan($+(*!*@,$ial($1).host),$2,%nr).nick) {
if ($v1 != $1) { var %clones = $addtok(%clones,$v1,32) }
inc %nr
}
aline 4 %w $chr(2) %c.num $iif((%c.num == 1),Clone,Clones) $+ $chr(15) of $1
aline -p %w %clones
sline %w 2
}
; refocus stored active window
window -a %a
new line--> }
}
menu @clonecheck* {
close window "clonecheck" : window -c $active
}
|
|
|
|
Joined: Jan 2004
Posts: 509
Fjord artisan
|
Fjord artisan
Joined: Jan 2004
Posts: 509 |
Btw, I have 2 on ^*:hotlink:*:#: events.
Was trying to combine the 2.
But can't.
The other 1 is:
if (($getnick($1) ison $chan) || ($getnick($1).checktheme ison $chan)) { /.timernickinfo -m 1 600 /nickinfo $v1 $mouse.dx $mouse.dy $line($chan,0) }
(Followed by halt)
But only need 2 halt at the end.
Any reason why I can't paste that in at the top and only get the clonescanner to work?
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Ok thx guys both works fine for each version.
|
|
|
|
|