|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
hello again,
i was just wondering, if it's possible to do some kind of command on a bot for the bot to display infos of a folder in $mircdir, wha'ts in the folder, and what are the exact names of the files in the folder, size of files into $chan or $nick?
|
|
|
|
Joined: Nov 2005
Posts: 105
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 105 |
look in the helpfile under $findfile and $file. For example, to display the files in a folder you can use //echo 1 $findfile($mircdir,*,0,echo $1-) to display the size look at Everything you're wanting to do is very possible with the use of those commands. I'm sure there's a dll that could probably speed the task up, just search the boards.
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
could you be more specific? i already did read the help $file and $findfile it don't seem to help much i wanted to msg or notice my $mircdir Logs only to nick or channel with what's in Logs folder what are the names how many lines per log file, not echo
|
|
|
|
Joined: Nov 2005
Posts: 105
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 105 |
I'm not sure I understand everything you're wanting to do. But something like this may be what you're wanting.
on *:TEXT:!logs:?:{
echo 1 $findfile($mircdirlogs,*.*,0,msg $nick log name: $nopath($1-) - number of lines: $lines($1-) )
}
The usage would be someone messaging you with !logs and in return it would show them the name of all the logs in your logs folder, and how many lines are in each file. I used $nopath() so that if only shows the name of the file itself, and not the entire directory. Hope this is what you're asking for, if not, please explain in further detail. Thanks.
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
thank you kindly, it works great but now when i try to put colors on it it stops working and starts saying * Invalid parameters: $findfile this is how i had it on *:TEXT:!logs:#:{ echo -l $findfile($mircdirlogs,*.*,0,msg $chan 1,1 1,14 Log name 1,1 $nopath($1-) - 1,1 1,14 Number of lines 1,1 $lines($1-) )
}
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Well, $findfile takes at most 5 parameters and you have 10. Think commas.
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
does that mean that i can't use colors and use default code instead? or is it possible if i try to write all those into a txt file with colors and display them instead?
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
No, it doesn't mean you can't use colors. It just needs to be done in a different way.
Edit: Code shortened in next post
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
I shortened the code. on *:TEXT:!logs:#:{
var %c1 = $+($chr(3),01,$chr(44),01,$chr(32))
var %c2 = $+($chr(3),01,$chr(44),14,$chr(32))
echo -l $findfile($mircdirlogs,*.*,0,msg $chan %c1 %c2 Log name %c1 $nopath($1-) - %c1 %c2 Number of lines %c1 $lines($1-))
} $+($chr(3),01,$chr(44),01,$chr(32)) Is the same as writing Except it doesn't get treated as a paramter as the latter would. You should also use double digits when using colors. See my post from this other thread about why: https://forums.mirc.com/s...p;page=0#146664
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
If you put the string with commas in a variable or $N param, and pass this, then all will be fine.
//var %foo = ,,,,,,, | echo -a $mid(%foo,1)
vs
//echo -a $mid(,,,,,,,,1)
Gone.
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
interesting,
thank you learned something new today that $char() confuses me that's why i never use em but thank you again
|
|
|
|
|