mIRC Home    About    Download    Register    News    Help

Print Thread
#185551 10/09/07 11:38 PM
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
Does anyone know of an mIRC scripted GREP.....
Or could someone give me an idea of how I would go about scripting my own? Thanx.


mIRC Scripting: So easy a caveman could do it.
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Eh, I'm not quite sure what you want entirely. I know and use Grep pretty often (via cygwin).

However, you can use: /filter to perform grep like actions. It includes wildcards (or regular expressions), match excluding, and the like.


Code:
alias get_links_from_active {
  var %w = @test
  if ($window(%w)) { window -h %w }
  else { window -he %w }
  filter -wwgc $active %w /http:\S+/i
  window -aw3 %w
}


I also wrote a script quite some time back: /find

It's mainly meant to be like lastlog (or grep) for searching your buffer in mIRC. (Doesn't include file searching)

Basically there's two commands, one which is /find:
/find http .. which would perform a wildcard search for your active windows buffer, and outputs the matches to the @find window.

Then there's /ofind:
/ofind /(http:\S+)/ig .... useage is much more limited than the normal /find, but it will go through your buffer and output all links to the @find window, and just the links. Kind of like using: grep -iPho "http:\S+"


Anyway, good luck.

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Not sure if this is what you're looking for but...

Code:
/scan {
  /var %get.chan = $active
  /window -e @CheckChan
  //echo @CheckChan 10Checking %get.chan for the phrase3 $$1-
  //filter -wwpg %get.chan @CheckChan / $+ $$1- $+1 /i
  if $filtered = 0 { /echo @CheckChan No matches found! | /join %get.chan | halt }
  /echo @CheckChan $filtered entries found!
  /join %get.chan
}


//scan $me will go through the active window and find all instances of your nick. /scan \d{2}\/\d{2}\/\d{2} will fin all instances of dates in mm/dd/yy format (or dd/mm/yy for that matter). The uses are near endless.

Code:
/scanlog {
  /var %logfile = C:\Progra~1\mIRC\logs\ $+ $active $+ . $+ $network $+ .log
  /var %get.chan = $active
  /window -e @CheckChan
  //echo @CheckChan 10Checking %get.chan for the phrase3 $$1-
  //filter -fwpg %logfile @CheckChan / $+ $$1- $+1 /i
  if $filtered = 0 { /echo @CheckChan No matches found! | /join %get.chan | halt }
  /echo @CheckChan $filtered entries found!
  /join %get.chan
}


Same idea but it looks for the active channel's log in your mirc directory (though, you may have to adjust it if its elsewhere).

Very very handy scripts. I use them all the time.


Yar
Joined: Aug 2007
Posts: 72
P
Babel fish
OP Offline
Babel fish
P
Joined: Aug 2007
Posts: 72
Thx alot guys, that's exactly what i was looking for...
And yes they are very useful...


mIRC Scripting: So easy a caveman could do it.

Link Copied to Clipboard