mIRC Home    About    Download    Register    News    Help

Print Thread
#202135 16/07/08 05:00 AM
J
Joe_Dean
Joe_Dean
J
I have a script that writes about 70 items to an INI file via /writeini when someone types a command in the channel. Is there a way I could clean the script up a bit and somehow have all the writeini commands in a text file, and include that text file in the actual script?

#202145 16/07/08 08:17 AM
W
WhipLash
WhipLash
W
I quite sure one can do this. The only think im not sure of (mainly cause i just woke up and havent given anything much thought yet) is how one would go about running the command.

The code would have to be something like:
Code:
If (v1 isin v2) { $read(cat.txt,1) }


Where cat.txt would be the file you have all the writeini's in. You'd just have to ensure that the $read is calling the right command from the correct line.

I can't really tell if this will clean the script up much, but why don't you give it a try.

#202158 16/07/08 02:22 PM
J
Joe_Dean
Joe_Dean
J
As I said there are about 70 writeini commands, hence 70 lines. Using what you said, I would have to write it out like this:

$read(file.txt,1)
$read(file.txt,2)
$read(file.txt,3)
etc
etc
$read(file.txt,69)
$read(file.txt,70)

Doing that defeats the purpose of me wanting to "include". Either way, the script would be long.

#202166 16/07/08 03:45 PM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
You can /play a file (list of commands) using the -c switch. This may decrease performance, of course.

#202223 18/07/08 01:33 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
How about you post the script and we will see the routine you have and see how we can clean it up cool


Link Copied to Clipboard