mIRC Home    About    Download    Register    News    Help

Print Thread
#244771 27/03/14 11:43 PM
Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
Well, my problem is that I am making a feature for my tool, which will read through an mirc script, and look for anything that may be wrong with it, such as vague variable names or any variables that might clash with my tools variables. But whenever it is reading through the file, it tries to actually do the commands within the script when I'm searching, how can i stop this?
I tried /remote off everything it ran through the script, but didn't seem to work, still evaluated each line in scanned like it was part of the script itself.

Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
anyway this can be done laugh?

Code:
alias inspect {
  var %scanner = 1
  window -adC @Inspect_ $+ $1
  while (%scanner <= $lines($1)) {
    set %scriptLine $read($1,%scanner)
    if ($findtok(%scriptLine,test,1,32) != $null) {
      aline 7 @Inspect_ $+ $1 Script has word 'Test' in it - line %scanner
    }
   
    inc %scanner 1
  }
}



It seems to go through file just fine, but because it is a script file I am scanning through... it sometimes does the things that are in the script file, so if there is a $tip function within the script, it would pop up while im scanning through it looking for test, and of course i don't want it to do any of the functions inside the Script im scanning through.

Last edited by dominic_eddy; 28/03/14 05:35 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
$read by default evaluate the line as a script line, but won't execute the line as a command. see the 'n' switch of $read (and eventually the 'p' switch). So what you are seeing is normal, always use the 'n' switch if you do not want to evaluate the line when using $read/$readini


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
thanks laugh

Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
This is so easy to bypass it's not funny for example you can use $chr codes, or $+ and obfuscate it quite easily. The script could also load portions of its functionality from remote sites. It's best if you scan the script yourself and learn exactly what every part of it does. Use the mirc help it's quite detailed.


Link Copied to Clipboard