mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Did you update the file ?

I Changed %i to 4 smile
Originally Posted By: n=2
in 967 ms ($read)
in 2184 ms (/filter)
-
in 951 ms ($read)
in 2200 ms (/filter)
-
in 967 ms ($read)
in 2184 ms (/filter)
-
in 967 ms ($read)
in 2200 ms (/filter)
Originally Posted By: n=3
in 1529 ms ($read)
in 2184 ms (/filter)
-
in 1467 ms ($read)
in 2199 ms (/filter)
-
in 1467 ms ($read)
in 2199 ms (/filter)
-
in 1466 ms ($read)
in 2200 ms (/filter)
Originally Posted By: n=4
in 2106 ms ($read)
in 2199 ms (/filter)
-
in 2044 ms ($read)
in 2184 ms (/filter)
-
in 2059 ms ($read)
in 2199 ms (/filter)
-
in 2060 ms ($read)
in 2199 ms (/filter)
Originally Posted By: n=5
in 2777 ms ($read)
in 2200 ms (/filter)
-
in 2745 ms ($read)
in 2200 ms (/filter)
-
in 2730 ms ($read)
in 2215 ms (/filter)
-
in 2761 ms ($read)
in 2216 ms (/filter)
I get the same results as you with the old file.

Last edited by Wims; 23/02/11 01:06 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I see two guys try to beat down on one another...with a proud smile brimming with competitiveness. lol

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I was just curious about $read being slower everytime so I benchmarked it. No proud smile here, we're just talking about the results wink (and he should have the same as me, I hope he didn't update the file)

edit : just noticed
Quote:
if (%i > 1) { linesep -a }
-a deosn't exist afaik, what does it do ? -s does but isn't documented.

Last edited by Wims; 23/02/11 04:07 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
not at all, they seem to be entirely well spirited :P investigation and discussion, even if slightly tangential, is something that used to happen much more often on this board.


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I can easily see the -a being a typo for -s

Joined: Aug 2010
Posts: 8
E
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
Joined: Aug 2010
Posts: 8
Originally Posted By: explodedk
as far as i can see all the replies work the other way around...

i have text in the txt file like

prison.break;scripted;us
the.mentalist;scripted;us
uefa.champions.league;sports;n/a

and then my trigger (lets call it %y) is like:
var %y uefa.champions.league.2010.2011.arsenal.vs.barcelona

or

var %y uefa.champions.league.highlights

then i need it to set %x as uefa.champions.league and
if (%x isin %y) { echo -a * MATCH FOUND %x matches %y }



i still need answer to my question guys... smile

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Yeah you're right, I didn't realise you'd posted an updated file. $read is indeed faster with that one!

-a doesn't do anything (or it does the same as /linesep without switches), the reason I use it is for consistency with other commands; /echo -a echoes to the active window, /linesep -a adds a line separator to the active window.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
edit nvm, I was wrong

Last edited by FroggieDaFrog; 23/02/11 07:25 PM.

I am SReject
My Stuff
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
If you want to handle each match from the file in the specified text:
Code:
/findit this line of text would get searched
$findit(this line of text would get searched)

alias findit {
  if (!%findit:lookup) {
    set %findit:lookup $1-
    
    ;this assumes file.txt is in your mIRC dir
    filter -fk $qt($mircdirfile.txt) findit *
    
    var %c = %findit:count
    unset %findit:*

    ;This is after searching is done
    ; %c is the total number of matches found
    $iif($isid,return,echo -a Total Matches Found:) %c
  }
  elseif (!$2 && $isid && $gettok($1,1,59) isin %FindIt:lookup) { 
    inc %findit:count 

    ;this is where you would handle the matches
    ;  %FindIt:Count is the match number
    ;  %FindIt:Lookup is the text that is being searched
    ;  $1- is the match from the file

    echo 03 :: $1-
  }
}


I tested it using the contents of the file
Quote:
csi.miami;scripted;us
prison.break;scripted;us
the.mentalist;scripted;us
UEFA.CHAMPIONS.LEAGUE;SPORTS;SOCCER
...(repeated 10 times)


Calling:
Code:
/findit I am looking for csi.miami.2.522.02 and the.mentalist.457 in my file!



Ran it 25x, found 20 matches in each search(echo'd out), then total number of matches found echo'd out

Each search with echoing taking ~.25s(ticks being inaccurate and all)

Last edited by FroggieDaFrog; 23/02/11 08:06 PM.

I am SReject
My Stuff
Joined: Aug 2010
Posts: 8
E
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
Joined: Aug 2010
Posts: 8
Originally Posted By: FroggieDaFrog
If you want to handle each match from the file in the specified text:
Code:
/findit this line of text would get searched
$findit(this line of text would get searched)

alias findit {
  if (!%findit:lookup) {
    set %findit:lookup $1-
    
    ;this assumes file.txt is in your mIRC dir
    filter -fk $qt($mircdirfile.txt) findit *
    
    var %c = %findit:count
    unset %findit:*

    ;This is after searching is done
    ; %c is the total number of matches found
    $iif($isid,return,echo -a Total Matches Found:) %c
  }
  elseif (!$2 && $isid && $gettok($1,1,59) isin %FindIt:lookup) { 
    inc %findit:count 

    ;this is where you would handle the matches
    ;  %FindIt:Count is the match number
    ;  %FindIt:Lookup is the text that is being searched
    ;  $1- is the match from the file

    echo 03 :: $1-
  }
}


worked perfect as i described... thanks alot.

Page 2 of 2 1 2

Link Copied to Clipboard