mIRC Homepage
ok im getting null bytes from a socket, issue is i need them... so i can the replace them in an alias whitch i must use!, but mirc dont proccess nullbytes, and im not a binvar pro, so if you could help or understand what im asking please post an examplre of a sockread sending binvar data with null bytes to an alias to be replaced in and only in that alias, not before it in the sockread
Posted By: Online Re: Null Bytes, Sockets and binvars, oh god - 28/12/04 07:43 PM
This code is untested, but you'll get the idea:

On *:sockread:socket_name:{
  • [color:blue];
    ; Read the data into a binary variable,
    ; 950 bytes (characters) at a time
    ; to avoid a "line too long" error with /echo.
    ;
    sockread 950 &var
    while $sockbr {
    ;
    ; Replace zeroes with $chr(64) which is @.
    ;

    breplace &var 0 64
    echo -s Sockread: $bvar(&var, 1-).text
    ;
    ; Since we fetch the data in 950-byte chunks,
    ; there still may be something left in the buffer.
    ;
    ; The job of this loop is to read the data
    ; until the buffer is emptied.
    ;

    sockread 950 &var
    }
}[/color]
© mIRC Discussion Forums