mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Okay, quick question - if I have a script that goes -

Code:
/test {
  While $read("scripts\commands.txt", 1) != $null {
    $read(scripts\commands.txt, 1)
    /write -dl1 scripts\commands.txt
  }

}


- can I jam a bunch of separate commands into the first line and have them execute at {almost} once? I wrote the loop to eat one line at a time, but if I can skip the "read line one, execute it, eat line one, repeat" routine, it should speed up the execution of more complex responses quite a bit.

Putting in -

//echo Test | /echo Test | /echo Test | /echo Test | /echo Test | echo Test | echo Test | echo Test

- for example, only returned a single echo with all the other echo tests that I'd hoped to execute one after another.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Use the p switch to evaluate | as a command separator

Code:
$read(file.txt,p,1)


And if you're reading every line from the file, just execute all lines and /write -c after the loop.

Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Ah, awesome - I'm not sure how I managed to miss the "p" option in the helpfile. This should do great.


Link Copied to Clipboard