mIRC Home    About    Download    Register    News    Help

Print Thread
#120055 13/05/05 03:12 AM
Joined: Jul 2004
Posts: 2
R
Rixxon Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Jul 2004
Posts: 2
Code:
alias modtest {
  sockclose modtest
  sockopen modtest www.weebl00.nl 80
}

on *:sockopen:modtest:{
  sockwrite -n $sockname GET /rixxon/modules/modules.txt HTTP/1.1
  sockwrite -n $sockname Host: www.weebl00.nl
  sockwrite -n $sockname
}

on *:sockread:modtest:{
  set -l %read
  sockread %read
  echo -s . %read
}


Yes, the code is not perfect, but it is just an example of what I think is a bug. Test the script (/modtest) and it echos the HTTP headers and the first line of the text document. Not the last line. First I had only one line and then I got only the headers.

I solved the problem by reading to a &binvar and bwrite it to a file, and read it on sockclose.

I think maybe mIRC isn't reading the line breaks correctly when reading to a %variable. /sockread -f doesn't solve the problem, though...

Or is something wrong with my code?

#120056 13/05/05 03:37 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:
on *:sockread:modtest:{
  var %read
  while 1 {
    sockread %read
    if (!$sockbr) return
    echo -si . %read
  }
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard