Jump to content

How can read value from Memory address


 Share

Recommended Posts

when i play the game have 2 value HP/MP

and i used Art money to find 2 address of memory

01420088 : 418 (HP capital)

0142071C : 2880 (MP capital)

So, in Auto it, how can read the value in memory address like ArtMoney

I want to write the program like this:

Func AutoHealing ()

$HP=....<= read value from memory

$MP=....<= read value from memory

If $HP < 100 Then

Send ($Key_Healing_HP)

EndIf

If $MP < 500 Then

Send ($Key_Healing_MP)

EndIf

EndFunc

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

when i play the game have 2 value HP/MP

and i used Art money to find 2 address of memory

01420088 : 418 (HP capital)

0142071C : 2880 (MP capital)

So, in Auto it, how can read the value in memory address like ArtMoney

I want to write the program like this:

Func AutoHealing ()

$HP=....<= read value from memory

$MP=....<= read value from memory

If $HP < 100 Then

Send ($Key_Healing_HP)

EndIf

If $MP < 500 Then

Send ($Key_Healing_MP)

EndIf

EndFunc

Welcome to the forums. :)

You need a memory udf such as Memory.au3. I use NomadMemory from here. because I found it easier to understand.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Welcome to the forums. :)

You need a memory udf such as Memory.au3. I use NomadMemory from here. because I found it easier to understand.

I got it, really thank you!!!

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

Well, the script just read the exacly memory address, but when reload game, the address will be change...so anyone have idea about this?

Maybe i need find the pointer point to address, is that correct?

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

I got it and will try now, so thx.

Anyone know, some game like Hero online, 9 Dragon... AutoIt Window Info can't detect the color, what is the problem?

I try in game and got nothing, but when i move the mouse to desktop it run normal >.<

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

NomadMemory can read value at the Memory address

Cheatengine can find the address and pointer

But how can read the value in memory address by past the pointer

Ex:

Func RefillMoney()

$ID=_MemoryOpen(0x00000848)

$Address=0x09E2A194

$CurrentGold=_MemoryRead($Address,$ID)

If $CurrentGold< 100000 Then

_MemoryWrite($Address, $ID, 100000)

EndIf

_MemoryClose($ID)

EndFunc

This function work as well now, it can refill the money everytime it slower than 100k, but that is read from exact address. When i reset the game it will run incorrect. I use Cheatengine and found the pointer 0x00a1e0c4 offset 0x00000024C will point to 0x09E2A194 (current address save the Gold value) , and evrytime i reset game it still correct (alway the pointer point to the value in game and ofcause the memory has changed)

So, in Autoit how to read the value by use pointer, pls help me!

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

With DMA (Dynamic Memory Allocation) values get loaded into ram in the order they request (very rarely the same value twice). The Pointer address' value IS the other "actual" address. Does this help?

I THINK it would be something like this, but not positive:

_MemoryRead(_MemoryRead($Address,$ID), $ID)

EDIT: Please correct me if I am wrong

Edited by danwilli
Link to comment
Share on other sites

With DMA (Dynamic Memory Allocation) values get loaded into ram in the order they request (very rarely the same value twice). The Pointer address' value IS the other "actual" address. Does this help?

I THINK it would be something like this, but not positive:

_MemoryRead(_MemoryRead($Address,$ID), $ID)

EDIT: Please correct me if I am wrong

Thx you for your idea. It run as well now

My code :

Global $Pointer=0x00a1e0c4

Global $Offset=0x0000024c

Func _FindNewAddress(ByRef $P,ByRef $OSet)

$ID=_MemoryOpen(0x00000848)

$New_Address=_MemoryRead($P,$ID) +$OSet

_MemoryClose($ID)

Return $New_Address

EndFunc

Func _RefillMoney()

$ID=_MemoryOpen(0x00000848)

$Address=_FindNewAddress($Pointer,$Offset)

$MaxMoney=_MemoryRead($Address,$ID)

If $MaxMoney < 100000 Then

_MemoryWrite($Address, $ID, 100000)

EndIf

_MemoryClose($ID)

EndFunc

While 1

_RefillMoney()

Sleep(1000)

WEnd

_MemoryClose($ID)

BTW:

When i code:

$ID=_MemoryOpen(0x00000848)

It will run correct, but if i code:

$ID=_MemoryOpen("game.exe")

It not work...?!?

Edited by meokhung

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

NomadMemory can read value at the Memory address

Cheatengine can find the address and pointer

But how can read the value in memory address by past the pointer

Ex:

Func RefillMoney()

$ID=_MemoryOpen(0x00000848)

$Address=0x09E2A194

$CurrentGold=_MemoryRead($Address,$ID)

If $CurrentGold< 100000 Then

_MemoryWrite($Address, $ID, 100000)

EndIf

_MemoryClose($ID)

EndFunc

This function work as well now, it can refill the money everytime it slower than 100k, but that is read from exact address. When i reset the game it will run incorrect. I use Cheatengine and found the pointer 0x00a1e0c4 offset 0x00000024C will point to 0x09E2A194 (current address save the Gold value) , and evrytime i reset game it still correct (alway the pointer point to the value in game and ofcause the memory has changed)

So, in Autoit how to read the value by use pointer, pls help me!

I think, The reason when you restart the game, the gold is different. Because gold is server side, Not client side.

Just a guess.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

I think, The reason when you restart the game, the gold is different. Because gold is server side, Not client side.

Just a guess.

Oop... this is the sample i write to learn how to read/write process value

And i write the program to auto train lv, not hack gold or something else :)

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

  • 4 weeks later...

Global $Game_ID=WinGetProcess("Element Client - Duong Van Truong")

;Global $Game_ID=WinGetProcess("Element Client")

I have problem:

My program working now, but when i play 2 windows (same game) and each window will have diffiren name

so i try use func WinGetProcess(window title) to get ProcessID like this

Global $Game_ID=WinGetProcess("Element Client - Duong Van Truong")

;Global $Game_ID=WinGetProcess("Element Client")

But both of them alway point to the first window (the first windows game i opened)

How can write to play with 2 or more window (more process and same program)

Thx you!

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Thank you, it work so good now.

and onemore question

Why some game i cant detect color by window info

like: Hero Online, Cabal, 9 Dragon...

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

  • 2 months later...

Thank you, it work so good now.

and onemore question

Why some game i cant detect color by window info

like: Hero Online, Cabal, 9 Dragon...

Hi!

I think that the problem is the ingame cursor.

It can be a hardware-cursor or a software-cursor.

In games with softwarecursors you will always get the colorvalue of the

cursor itself and not of the pixel underneath the cursor.

In some games you can change the cursor in the options menu.

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...