mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2009
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2009
Posts: 8
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.

I hope someone can help.

Last edited by ChaosKiller; 18/08/09 08:21 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$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"
argv0 #214892 18/08/09 07:47 PM
Joined: Jun 2009
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2009
Posts: 8
Damn never new that. Thanks will adjust script now.

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
But $didtok does, use for exemple :
Code:
//echo -a $replace($didtok(dialog,id,13),$cr,$+($chr(32),$(|),$chr(32)))


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #214895 18/08/09 08:16 PM
Joined: Jun 2009
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2009
Posts: 8
Actually fixed that part like this:
Code:
    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
  }
}


Many thanks

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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
Wims #214898 18/08/09 08:31 PM
Joined: Jun 2009
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2009
Posts: 8
Indeed it was my sloppy coding -_- I will look into $didtok. Again thanks for the help and quick responses.


Link Copied to Clipboard