Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.
Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
-
ime
- Posts: 8
- Joined: Mon May 11, 2009 11:51 am
#1
Post
by ime » Thu Jan 14, 2010 11:46 am
I'm having trouble with turning a 4byte number into its float equal. I guess I'm just missing something cause I can not find a straight answer really on google so thought I would try here.
I have a hex, 44 58 OC 92 so lets say:
Turning the hex into a the number, 1146621074, how would I get it into float form?
I see that memoryReadFloat is doing it, im guessing thats a custom function in c/c++ that you created. Will I need to do that and recompile or is there an a easier way?
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#2
Post
by Administrator » Thu Jan 14, 2010 4:53 pm
I have no idea how you would do this, or why you would need to. Where are you getting that hex notation from?
memoryReadInt()/memoryReadFloat() makes use of C type casting, so there really isn't any special code you would need to use to convert it. Lua numbers are 'typeless' in that they can represent both integers and floats or doubles, so I doubt there really is any built-in way to do this in Lua.
-
ime
- Posts: 8
- Joined: Mon May 11, 2009 11:51 am
#3
Post
by ime » Thu Jan 14, 2010 10:22 pm
I have micromacro receiving packet data, which is where the hex comes from. In game that hex is a float for x,y,z coordinates.
converting that Hex into a number, I get the number "1146621074", if I view it as a float it would be 864.196411132813, which is what I want, just not sure how to do this with lua
Who is online
Users browsing this forum: No registered users and 2 guests