mIRC Home    About    Download    Register    News    Help

Print Thread
#167539 26/12/06 04:05 AM
Joined: Feb 2003
Posts: 3,412
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
I have this code:
Code:
alias highlight1 {
    var %n1 = 1
    while (%n1 <= $lines($mircdir/highlight.txt)) {
      if ($read($mircdir/highlight.txt,%n1) isin %matchtxt) {
        set %dll-event Highlight! $chr(4) %matchnick said $read($mircdir/highlight.txt,%n1) in %matchchan $chr(91) $+ $network $+ $chr(93) | balloon
        break
      }
      else {
    }
    inc %n1
  }
}

how ever it hang irc if i trigger it, someone that can point me at the problem in the code?

sparta #167540 26/12/06 04:26 AM
A
Aspectus
Aspectus
A
Code:
alias highlight1 {
  var %n1 = 1
  while (%n1 <= $lines(highlight.txt)) {
    if ($read(highlight.txt,%n1) isin %matchtxt) {
      set %dll-event Highlight! $chr(4) %matchnick said $ifmatch in %matchchan $chr(91) $+ $network $+ $chr(93) | balloon
      halt
    }
    inc %n1
  }
}


I dont know if it was the /break and /halt diffrence... but i edited some stuff so it looked better and it should work, only reason why it would kill your mIRC is if %n1 never stops... it always increases... so

Last edited by Aspectus; 26/12/06 04:26 AM.
sparta #167568 26/12/06 06:36 PM
S
schaefer31
schaefer31
S
Originally Posted By: sparta
I have this code:
Code:
alias highlight1 {
    var %n1 = 1
    while (%n1 <= $lines($mircdir/highlight.txt)) {
      if ($read($mircdir/highlight.txt,%n1) isin %matchtxt) {
        set %dll-event Highlight! $chr(4) %matchnick said $read($mircdir/highlight.txt,%n1) in %matchchan $chr(91) $+ $network $+ $chr(93) | balloon
        break
      }
      else {
    }
    inc %n1
  }
}

how ever it hang irc if i trigger it, someone that can point me at the problem in the code?


Your inc %n1 line is not inside the loop as it should be.


Link Copied to Clipboard