mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2004
Posts: 15
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Feb 2004
Posts: 15
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

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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]


Link Copied to Clipboard