I'm trying to make a auto-preform script for multiple servers through a dialog. I can't find the chr code for the return key. I hope anyone can help me with this. I've tried $replace($did(1), $chr(13), |) but $chr(13) doesn't seem to work. I've tried the other chr codes but nothing. $cr and $lf didn't work either.
As you can guess $did(1) is a multi line, return supported edit box.
$did does not return multiple lines. In fact, mIRC can't assign the newline value to variables because of the way the language works; so you'll rarely ever see $cr/$lf/$crlf from any builtin identifier within mIRC.
/help $did should show you how to access each individual line of a multi line control. You would have to loop over each line and add them all to a big string with | separating each line.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
var %lines = $did(1).lines
writeini -n test.ini $readini(es.ini,options,preform) preforms %lines
var %cur = 1
while (%cur <= %lines) {
if ($did(1,%cur)) {
writeini -n test.ini $readini(es.ini,options,preform) preform $+ %cur $did(1,%cur)
}
inc %cur
}
Sadly I just found out that I can't just execute a readini. I'm wondering how to bypass this problem. I hope once again you guys can help. Never had to script these things but hey I do feature requests lol
Code:
alias test {
var %lines = $readini(test.ini, $readini(es.ini,options,preform), preforms)
var %cur = 0
while (%cur <= %lines) {
$readini(test.ini, $readini(es.ini,options,preform), preform $+ %cur
inc %cur
}
}
Even if you already fixed this part with the loop, the point is that with $didtok, mirc does the loop by itself so it's much faster if you have a lot of lines.And you can use $readini the way you're using it to execute command, but your code miss a ')' to close the first $readini(
#mircscripting @ irc.swiftirc.net == the best mIRC help channel