mIRC Home    About    Download    Register    News    Help

Print Thread
#202135 16/07/08 05:00 AM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
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?

Joe_Dean #202145 16/07/08 08:17 AM
Joined: Jul 2008
Posts: 24
W
Ameglian cow
Offline
Ameglian cow
W
Joined: Jul 2008
Posts: 24
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.


=======================
Count WhipLash
Services Administrator
KnightNet
=======================
WhipLash #202158 16/07/08 02:22 PM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
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.

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

Joe_Dean #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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard