mIRC Home    About    Download    Register    News    Help

Print Thread
#139910 19/01/06 08:32 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I trying to make a "log viewer" for mirc, the problem i have now is that i need mirc to identify how many "logs" i have marked in the window, then how to remove every highlighted log name..



I guess i need to do it with a loop, but i cant figure out how to identify how many logs are highlighted.. :tongue:


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139911 19/01/06 09:06 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
$sline(@window,0) = total slected lines, $sline(@window,N) = contents of Nth selected line, $sline(@window,N).ln = line number of Nth selected line

PLEASE NOTE: if your going to cycle through all of them deleting them, then start from the LAST one and move backwards towards 1,
OR repeatedly delete the 1st one, untill no more exist.
BECAUSE as you delete the 6th selected line, then the 7th selected line becomes the 6th one.

* Im sure i just wrote something about this just before? maybe i amagined it.

#139912 19/01/06 09:08 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#139913 19/01/06 09:27 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
to early in the moring here for me, i remebered that, then thought, maybe it just dreamed it up, while writing this. :-<

#139914 19/01/06 10:57 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Now i have solved that problem, now to next.
[/code]
alias rlog {
var %xi = 1
:start
.remove " $+ $dirlog $+ $sline(@Logviewer,%xi) $+ .log $+ "
inc %xi
if (%ix > %xi) { goto start }
else {
unset %xi
}
}
[/code]
when i have highlighted 5 logs, then it removes only 4 of them, not all 5, how do i solve that? :tongue:

;------------------- EDIT

Never mind, solver it.. thnx for the help on the things abow smile

Last edited by sparta; 19/01/06 11:11 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139915 20/01/06 03:34 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
New question..
i use this line:

dclick { set %tmp.log $wildtok($sline(@window,1), *, 1, 32) $+ .log | command }

working just fine if i dclick in the left part of the @window.. "window created with /window -akSl16 @window". that means i get two windows in one.. or how i should say, the code i have working just great on the right window part, but cant solve how it also should work on the left part of the @window, any ideas?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139916 20/01/06 04:14 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
The left side of the @window does NOT have that same functionality (built in). You may be able to use some 3rd party DLL to wield 2 listbox windows together. But a single window is very difficult to create the same effect on left and right side. I have done it (or close to it) using hotkeys, and manually inverting selected and unselected lines, Not a pleasent job.

#139917 20/01/06 06:54 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
one more question.. how the h*ll do i search true X amount of files in one folder after a word? lets say i have 50 *.txt files in one folder, now i want to search true all this 50 files for a word, how do i do that? been trying to solve it, but no go so far.. smirk and when i have been asking around on help channels, then i get reply to use filter, didnt work for me.. i also got the advice to use $read, still no go for me.. :tongue: "and give me the file name(s) the word exist in" confused


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139918 20/01/06 10:07 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 alias word.search {
var %a = 1, %b = $findfile(&lt;directory&gt;,*.txt,0)
while %a &lt;= %b {
var %file = $findfile(&lt;directory&gt;,*.txt,%a)
if $read(%file,w,$+(*,$chr(32),$1,$chr(32),*)) {
echo -a %file
}
inc %a
}
}
 


Usage: /word.search <word to be searched for>

There are other ways of doiing this, but this is what I was able to think of at 5:10 am

#139919 20/01/06 07:29 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Nope, no go at that code.. dosent return me anything :tongue: and i changed the path, even tryed to change $1 to a %var instead..

;---------- EDIT

if $read(%file,w,$+(*,$chr(32),$1,$chr(32),*)) {

was replaced with:

if $read(%file,w,$+(* $+ $1 $+ *)) {

then it working.. smile

Last edited by sparta; 20/01/06 08:11 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139920 20/01/06 10:03 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
your problem is with your failure to define everything well enough, your 50 plus files, sound like they have one word per line maybe, in which case "* <word> *" wouldnt have found them, but then russel wasnt to know your files had one word a line was he, you never said.

Now using "*<word>*" it well find "and" in "candle".

If u need to find exact words, please let us know of the exact formating of the files.

#139921 21/01/06 01:43 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
the format of the files is "*.log", when i was searching for a word i didnt look for the exact match, just if the word was in any of the files, and * $+ $1 $+ * did the trick, and i guess your code should have done something simulare, but didnt return anything, due to a full match or if the match was a part of the word.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard