mIRC Home    About    Download    Register    News    Help

Print Thread
strange script evaluation #205059
11/10/08 06:56 AM
11/10/08 06:56 AM
Joined: Oct 2008
Posts: 3
S
s3b Offline OP
Self-satisified door
s3b  Offline OP
Self-satisified door
S

Joined: Oct 2008
Posts: 3
The function (not identifier, lets get this shit right, it's a function) $read evaluates one too many times. For example, I have written a function to echo the filename and contents of each script loaded. If any of your scripts use a $identifier or %identifier these will be evaluated on output rather than the name of the $identifier/%identifier. This is extremely awkward for a scripting/programming language. Get your shit together, man.

Code:
alias ScriptStuff {
  var %a
  var %b
  var %l
  var %s
  var %x
  var %y = $script(0)
  echo -- scripts loaded: %y

  %x = 1
  while (%x <= %y) {
    %s = $script(%x)
    %b = $lines(%s)
    %a = 1
    echo $+(script[,%x,]) = %s
    echo ----------
    while (%a < %b) {
      echo $+(line[,%a,]) = $read(%s,%a)
      inc %a
    }
    echo ----------
    inc %x
  }
}

Re: strange script evaluation [Re: s3b] #205060
11/10/08 07:08 AM
11/10/08 07:08 AM
Joined: Jul 2006
Posts: 3,518
France
W
Wims Offline
Hoopy frood
Wims  Offline
Hoopy frood
W

Joined: Jul 2006
Posts: 3,518
France
Did you even read the help file about $read ?

Originally Posted By: /help $read
If the n switch is specified then the line read in will not be evaluated and will be treated as plain text.




Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net