If I recall, DSTIP is a 32bit word, so you need to send just that.
$longip(127.0.0.1) will do the trick, but you can't just send these values as plain text... they have to be sent in binary form, using a &binvar. (because you have to handle NUL, CR, LF, etc characters)

This example basically shows you how to fill the first 4 values.
Code:
		+----+----+----+----+----+----+----+----+
		| VN | CD | DSTPORT |      DSTIP        |
		+----+----+----+----+----+----+----+----+
 # of bytes:	   1    1      2              4


/bset &bvar 8 0 <- first we create our 8 byte binvar, this step isn't important but it helps understand &binvars easier.

/bset &bvar 1 4 <- VN == 4
/bset &bvar 2 1 <- CD == 1

Now here's the tricky part, because mIRC doesn't have any built-in functions to simply drop 2-byte and 4-byte "words" and "longs" into &binvars, so we have to do it byte for byte.

/bset &bvar 3 $calc(6667 % 256)
/bset &bvar 4 $int($calc(6667 / 256))

You can also do $longip(6667) and use $gettok() to extract the last two tokens.

/bset &bvar 5 1
/bset &bvar 6 0
/bset &bvar 7 0
/bset &bvar 8 127

That fills your &bvar with the needed data. I haven't written a SOCKS4 proxy, only started on one, so I'm not sure if the USERID and NUL fields are required.

As for SOCKS5, that's getting pretty complicated with authentication methods, and you'll rarely find a proxy that uses it.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!