mIRC Home    About    Download    Register    News    Help

Print Thread
#183560 20/08/07 11:41 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
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.
Garou #183570 21/08/07 02:23 AM
Joined: May 2005
Posts: 74
D
Babel fish
Offline
Babel fish
D
Joined: May 2005
Posts: 74

Dracoz #183647 21/08/07 01:31 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
I dont need a clone scanner.

Garou #183684 21/08/07 08:24 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Indeed. You need a clone scanner and an on hotlink event smile

Code:
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 smile

Horstl #183716 22/08/07 02:27 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
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.
Garou #183720 22/08/07 03:38 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
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.

Code:
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) laugh [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 smile

Horstl #183721 22/08/07 03:48 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Thx mate...everyone will want to use this code....great scripting thx again.

Garou #183782 22/08/07 03:49 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
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...
Code:
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 smile
Code:
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:
Code:
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.
Horstl #183784 22/08/07 04:42 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
The second one you prefer is not working ??

Garou #183785 22/08/07 04:52 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
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...

Horstl #183786 22/08/07 04:59 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes i did and its enable but nothing happens.

Horstl #183789 22/08/07 05:06 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Ok found the problem....it works in 6.3 but not in 6.21 frown
Any ideal why?

Last edited by Garou; 22/08/07 05:08 PM.
Garou #183791 22/08/07 05:17 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
$tip is a new feature of 6.3

Last edited by Horstl; 22/08/07 05:18 PM.
Garou #183792 22/08/07 05:18 PM
Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
$tip feature was only added in v6.3


LonDart
Horstl #183793 22/08/07 05:19 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes it finds and popup in 6.3 only but not working at all in 6.21

Garou #183795 22/08/07 05:38 PM
Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
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.

Code:
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
L
Fjord artisan
Offline
Fjord artisan
L
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
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Ok thx guys both works fine for each version.


Link Copied to Clipboard