Sign in to follow this  
Followers 0
Dralor

Decimal to Float Hex Oo

5 posts in this topic

I have one script:

#include <NomadMemory.au3>
#include <converter22.au3>

GUICreate ( "name", 150, 110 )
GUICtrlCreateInput ( "X", 20, 10, 50, -1, 0x08000000 )
GUICtrlCreateInput ( "Y", 80, 10, 50, -1, 0x08000000 )
$inputx=GUICtrlCreateInput ( "0", 20, 40, 50 )
$inputy=GUICtrlCreateInput ( "0", 80, 40, 50 )
$Teleportbutton=GUICtrlCreateButton ( "Teleportuj", 25, 70, 100, 30 )
GUISetState ()

$x = 0x02100474
$y = 0x0210047C
$proces = WinGetProcess ( "[Class:class name - this work]" )

While 1
    $msg=GUIGetMsg()
    If $msg=$Teleportbutton Then Teleportuj()
WEnd


Func Teleportuj()
    $dox=GUICtrlRead ( $inputx )
    $doy=GUICtrlRead ( $inputy )
    ;HERE I HAVE PROBLEM
    $Mem_Open = _MemoryOpen($proces)
    _MemoryWrite($x,$Mem_Open,$dox2)
    _MemoryWrite($y,$Mem_Open,$doy2)
    _MemoryClose($Mem_Open)

EndFunc

I can't crate one script. I want to convert value from decimal, to float hex. In the cheat engine to look like this:

Posted Image

PLEASE HELP ME ;(

Share this post


Link to post
Share on other sites



Hex()?


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

MassSPAMER: I don't understand >_

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

A quick search on how to convert a binary/hex (0x##) value to float/double brought up this link. Of course, you need to know what you are doing. Remember floats and doubles are 4 and 8 bytes respectively. AutoIT doesn't support extended or quadruple precision floats, and I don't know if any game would either *shrug*

Edited by Ascend4nt

Share this post


Link to post
Share on other sites

Thanx. I used this script:

Func _FloatToHex ( $floatval )
    $sF = DllStructCreate("float")
    $sB = DllStructCreate("ptr", DllStructGetPtr($sF))
    If $floatval = "" Then Exit
    DllStructSetData($sF, 1, $floatval)
    $return=DllStructGetData($sB, 1)
    Return $return
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0