Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
arcanig
Newbie


Joined: 21 Jun 2005
Posts: 2

PostPosted: Tue Jun 21, 2005 6:12 pm   

Binary string to integer conversion?
 
Is there any way to do binary to integer conversions in Zmud?

If I had a string list that was a bunch of binary info, like:
10001101 how could I convert that to an integer, in this case 177 ?

Is this possible and/or easy in Zmud?

Thanks in advance for your help.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 21, 2005 8:56 pm   
 
Definitely possible. Built into ZMud as a handy-dandy #command or %function()? Nope, you'll have to build your own (via #ALIAS or #FUNCTION). I don't recall the rules of binary conversion, though, so not much help from me on that front.
_________________
EDIT: I didn't like my old signature
Reply with quote
temper
Newbie


Joined: 06 Jun 2005
Posts: 6
Location: Ruston, La

PostPosted: Tue Jun 21, 2005 9:33 pm   
 
**thinks openly**
oh now thats cool to know. decoding binary is definately a cool idea for muds.

well, the trigger to do that would be really easy, just a set of divisions by 2 with a log of the remainder.
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Tue Jun 21, 2005 10:08 pm   
 
#echo %mss(parseInt(10001101,2),JScript)

btw, 10001101 binary is equal to 141 decimal
Reply with quote
arcanig
Newbie


Joined: 21 Jun 2005
Posts: 2

PostPosted: Wed Jun 22, 2005 4:56 pm   
 
hehe, I was counting it up backwards....low to high stead of high to low.

so, %mss(parseInt(<bin string>,2),JScript)

cool Ill try that!

(im trying to make alot of COM communications simpler by converting many pieces of binary data into a single integer data transfer)

Thanks for all the help!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net