mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2005
Posts: 30
_
_DuDe_ Offline OP
Ameglian cow
OP Offline
Ameglian cow
_
Joined: Jun 2005
Posts: 30
Jesus, this game I made drives me crazy. I now want to have the script find all the .ini files that start with = signs (I have multi scripts that use .ini and thie was not the first, so I have it using = signs so that it dosn't use info from other files.) Anyways, I want it to find them all, make a list of them all, but remove the = signs before it messages the list to the user who does !battlefield.

I am sorry, but I don't have the script on this computer, and the computer that has the script on it is getting it's much needed monthly cleaning, so it will be out of service for the night and into tomorrow.

I remember most of the code if you need some peices from it.

Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Code:
on 1:text:!battlefield:#:{
.remove __temp
.echo -q $findfile(.,=*,0,write __temp $mid($1-,2))
play $chan __temp 1000
.remove __temp
}

Last edited by stefys99; 15/08/05 02:04 PM.
Joined: Jun 2005
Posts: 30
_
_DuDe_ Offline OP
Ameglian cow
OP Offline
Ameglian cow
_
Joined: Jun 2005
Posts: 30
What the hell? That looks to damn confusing for me (Yes I am pretty good at mIRC Scripting, but when crazy stuff like that is what I have to use, I just dunno, I like using a long code to make it easy for me to edit or even understand)

If that is the only way to make it work, I will try that once I can, but if there is a longer script that could do it, and it uses the basic scripting commands, that would rock.

~mike~

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Don't complain when you are given help or you may not get help from many people...

That script is actually not very complicated...

Code:
on 1:text:!battlefield:#:{

I assume you know what that line does.

Code:
.remove __temp

Removes the temp file by that name. Although, this is a duplicate with below and not needed.

Code:
.echo -q $findfile(.,=*,0,write __temp $mid($1-,2))

This is probably where you have questions...

echo -q will echo the total files found and allow the command to run.

$findfile is used to find files as the name implies. Within the ()'s, the first item is the directory. If you're searching your $mircdir, you can use "." there as shown above. Next, what are you looking for? Files beginning with =... so =* (wildcard) is used. Next, is the depth of subdirectories to search. 0 is used to show to only search in the $mircdir for files matching =*. Finally, what is done when a file is found... write to a temp file $mid($1-,2).

$mid($1-,2) would display the data without the first 2 characters. There IS a small problem with this... it should be $mid($nopath($1-),1) so that the path is gone and then it would display everything but the first character (=).

Code:
play $chan __temp 1000

This will play the temp file with 1 line per 1 second. If you want the data sent in some other fashion, just use the temp file however you want to.

Code:
.remove __temp

As above, this will remove the temp file now that the script is completed.

Code:
}

And, of course, this is needed at the end. laugh

Anyhow, here's an updated script for you:

Code:
on 1:text:!battlefield:#:{
  .echo -q $findfile(.,=*,0,write __temp $mid($nopath($1-),1))
  play $chan __temp 1000
  .remove __temp
}


Invision Support
#Invision on irc.irchighway.net
Joined: Jun 2005
Posts: 30
_
_DuDe_ Offline OP
Ameglian cow
OP Offline
Ameglian cow
_
Joined: Jun 2005
Posts: 30
I am very sorry if it felt like I was complaing. I did not mean it to be that way, in fact I would like to thank you for the script you made, but I was just asking if there was another way to do it. Thats all. Again,very sorry if you felt as if I was complaining.

~mike~

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It's striking how someone who claims to be "pretty good at scripting" has such a hard time following this very basic piece of code.

Look up in the mIRC help file what each of the commands does. I suppose the most confusing for you is the fact that the $findfile identifier has a command parameter, which will execute the command for each file name matched. Or is it perhaps the $mid that is confusing? Maybe the .echo -q ?

This is all in the help file, /help $findfile, /help $mid, /help /echo and look up the q flag.

As far as making the script "easier", there is really not much ways. $findfile is necessary, so we can't skip that. /play is suited very well here, or you'd need to loop manually through the text file, which is really not simpler, in fact it makes the script more complex, and not to mention less efficient. You're just going to have to do the effort to look up the things mentioned in the help file, and learn new things while you're at it.


Gone.
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Quote:
It's striking how someone who claims to be "pretty good at scripting" has such a hard time following this very basic piece of code.

Look up in the mIRC help file what each of the commands does. I suppose the most confusing for you is the fact that the $findfile identifier has a command parameter, which will execute the command for each file name matched. Or is it perhaps the $mid that is confusing? Maybe the .echo -q ?

This is all in the help file, /help $findfile, /help $mid, /help /echo and look up the q flag.

As far as making the script "easier", there is really not much ways. $findfile is necessary, so we can't skip that. /play is suited very well here, or you'd need to loop manually through the text file, which is really not simpler, in fact it makes the script more complex, and not to mention less efficient. You're just going to have to do the effort to look up the things mentioned in the help file, and learn new things while you're at it.

Omg, how the heck do u write so long lines ?
Well, when I don't know about an identifier or alias or other thing about mirc, I use /help before asking, but I usually don't need it smile


Link Copied to Clipboard