Hello,
I am trying to write a script to capture all XDCC pack lines in any channel window.
However, I am getting the message displayed in the channel window: "IF( Unknown command"
Does anyone know what is wrong with my if statement at the bottom of the code?
I searched this error and only found one related post, but no solution.

Thanks in advance,


Code:
 
on *:TEXT:*#*:#: { 

  ;------------- DECLARE LOCAL VARIABLES
  /var %TEXT_TO_REPLACE = @@
  /var %stripped_text
  /var %temp
  /var %text_line = $1-

  ;------------ STRIP ALL EXTRA CHARACTERS FROM THE TEXT

  ; Strip all codes from the line of text
  %stripped_text = $strip(%text_line)

  ; replace ASCII 93 = ']' AND ASCII 91 = '['
  %temp = $replace(%stripped_text,$chr(93),%TEXT_TO_REPLACE) 
  %temp = $replace(%temp,$chr(91),%TEXT_TO_REPLACE)

  ; replace ASCII 40 '(' and ASCII 41 ')'
  %temp = $replace(%temp,$chr(40),%TEXT_TO_REPLACE)
  %temp = $replace(%temp,$chr(41),%TEXT_TO_REPLACE)

  ; replace ASCII 124 '|'
  %temp = $replace(%temp,$chr(124),%TEXT_TO_REPLACE)

  ; replace '«' AND '»'
  %temp = $replace(%temp,»,%TEXT_TO_REPLACE)
  %temp = $replace(%temp,«,%TEXT_TO_REPLACE)

  %temp = $replace(%temp,@@,)

  ;------------- WRITE THE PROCESSED TEXT TO FILE

  /var %left_text = $left(%temp,1)
  /var %ascii_val = $asc(%left_text)

  if( $asc(#) == %left_text){
  /write $mircdir $+ \z_output.txt %temp
  /echo true
}
else{
/write $mircdir $+ \z_skipped_output.txt %temp
/echo false
}

 
crazy