xyz url capture

By nnaivee on Jun 01, 2011

Screenshots

this code opens an @window on the desktop with urls captured from chat and allows you to either open the link or close the window

doesnt require profontwindows but it looks better with it.. also dimensions are based on profontwindows

;google profontwindows, download and install

on *:text:*http*:*:{
  qq $matchtok($1-,http,1,32)
}

alias qq {
  set %xurl $1-
  window -c @xyz
  window -dap +d @xyz $calc($mouse.dx - 9) $calc($mouse.dy - 8) 333 16

;change profontwindows below to arial if you dont have the font installed

  drawtext @xyz 0 profontwindows 9 6 0 x   o
  drawtext @xyz 0 profontwindows 9 36 0 %xurl
}

menu @xyz {
  sclick:{
    if ($inrect($mouse.x,$mouse.y,0,0,18,18) == $true) {
      window -c @xyz
    }
    if ($inrect($mouse.x,$mouse.y,18,0,18,18) == $true) {
      run %xurl
      window -c @xyz
    }
  }
}

Comments

Sign in to comment.
Jethro   -  Jun 02, 2011

Wader, your regex pattern may need to be improved a tad more to reduce fallacy to the minimum as possible:

/(^|\s)(w{3}\.(?!\.)|https?\x3A\/\/(?!\/))[^\s]+(\.\w{2,6})(\s|$)/iS
More
 Respond  
Wader   -  Jun 02, 2011

This is what i have been using for quite some time.

on $*:TEXT:/(www\.|http\x3A\x2F\x2F)([^\s]+)/iS:#: {
  if (!$window(@links)) { .window -n @links }
  .window -g2 @links
  .aline @links $+($timestamp,) $+(14,$nick) $+(06,$chr(124),14) $chan $+(06,$chr(124),14) $1-
}

Its matches all links where they are prefixed with http://www. or just www.

More
 Respond  
Jethro   -  Jun 01, 2011

mIRC already has an inbuilt URL capture feature.

/help url catcher

You can then bring a URL window to focus (Alt+U) and see the urls captured.

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.