Well as you can see there is a limit (4150 bytes) in mIRC in general.
You are using /sockread &name, which will read by default 4096 bytes into the binary variable, so if you were to try to use the text inside that binary like in a iswm comparison, it would work:

Code:
sockread &read
if (dragon iswm $bvar(&read,1-).text) echo -a ALL $v2
instead of writting to a file.

You're writting everything to a file and then you are reading line by line, and apparently you end up with a line being too long. It is possible to read line by line into a binary variable using the -n switch in /sockread. That would basically be the same as what you have, except that this time you have the line (possibly too long) into a binary variable (no fail on $read). You can then use $bfind to try to match manually something in the line, you can also try this little alias, which will remove all <tag> from a binary variable ($nohtml for binvar), hopefully this can be used in your situation to reduce the length of the line and, if you're not looking for some <tag> (in your while loop, you're looking for 'dragon'), it can be used to make a match using the usual tool like the iswm operator etc:
Code:
alias nohtml& {
  var %pos
  while ($bfind($1,1,<).text) {
    %pos = $v1
    if ($bfind($1,$calc(1+%pos),>).text) bcopy -c $1 %pos $1 $iif($v1 != $bvar($1,0),$calc(1+$v1) -1,$v1 0)
    else bcopy -c $1 1 $1 1 $calc(%pos -1)
  }
  while ($bfind($1,1,>).text) bcopy -c $1 1 $1 $calc(1+$v1) -1 
}
You would use that in something like
Code:
if ($sock($sockname).mark) {
    sockread -fn &read
    noop $nohtml&(&read)
    if ($bvar(&read,0) < 4096) echo -a >  $bvar(&read,1-).text
    else echo -a > $bvar(&read,1,4096)
    ; and eventually you can do here if (dragon iswm $bvar(&read,1,4096).text) echo -a ALL $v2
}



#mircscripting @ irc.swiftirc.net == the best mIRC help channel