mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2014
Posts: 1
I
Impala Offline OP
Mostly harmless
OP Offline
Mostly harmless
I
Joined: Dec 2014
Posts: 1
Small java code I was hoping to turn into a script with an alias.

Code:
String hexValue = "0A064156";
String ip = "";

for(int i = 0; i < hexValue.length(); i = i + 2) {
  ip = ip + Integer.valueOf(hexValue.subString(i, i+2), 16) + ".";
}

System.out.println("Ip = " + ip);


alias hexip {

basically want it to

/hexip 0A064156
echo -a %convertedip

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
alias quad.dotted { return $regsubex($1-,/(..)/g,$base(\t,16,10) $+ $iif(\n != \0,.)) }

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Or just $longip($base($1,16,10))


Saturn, QuakeNet staff

Link Copied to Clipboard