;;open a socket
/sockopen socktest www.mirc.co.uk 80
;;when the socket opens, request the file from the server
on *:sockopen:socktest: sockwrite socktest GET http://www.mirc.co.uk/whatsnew.txt $+ $crlf
;; when the socket has data, read the data and do something with it
;; in this case color it red and echo to status
on 1:sockread:socktest:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
echo 4 -s %temp
goto nextread
}