Jump to content

Decimal to Float Hex Oo


Recommended Posts

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 ;(

Link to comment
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]

Link to comment
Share on other sites

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...