mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
(0x0E79A9C1 * temp) % 0x7FFFFFFF;

where temp is a decimal number (example 706169324)

How could I possibly do that in mirc and get a hexadecimal result?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
convert using $base
Code:
//echo -a $base($calc((0x0E79A9C1 * temp) % 0x7FFFFFFF),10,16)

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
you need to $base the hex into base-10 before using $calc.

//echo -a $base($calc(($base(0E79A9C1,16,10) * temp) % $base(7FFFFFFF,16,10)),10,16)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
had the right idea.

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
The answers should all be in his head by now. He either doesn't want to learn, or he's not thinking/reading as much as accurately as he needs to be. If you're willing to practically write an entire MSNP11 implementation in mIRC, go for it, but I'd advise letting him do it himself, because otherwise he's not learning.

pouncer: convert base 16 to base 10 the same way that you convert base 10 to base 16.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
thanks guys


Link Copied to Clipboard