Sign in to follow this  
Followers 0
Morphos

Problems

2 posts in this topic

Hi!

It seems that I still don't fully understand the logic behind while, variables etc. Although i am becoming more familiar but still get a little confused because of the lack of experience.

Heres my code:

Code:

#include <NomadMemory.au3>

SetPrivilege("SetDebugPrivilege", 1)

$iv_Pid = WinGetProcess("Warhammer: Age of Reckoning, Copyright 2001-2009 Electronic Arts, Inc.");Gets Proccess ID To Read FROM

$hp_Address= 0x39181798

$hpmax_Address= 0x3918179C

$ap_Address = 0x391817A8

$Istarget_Address = 0x6FA51F04

$OpenProccess = _MemoryOpen($iv_Pid,0x1F0FFF,1)

$MaxHP= _MemoryRead($hpmax_Address,$OpenProccess)

$HPRead = 0 ;

$APRead = 0;

$Istarget = 0

GetCurrentData()

While 1

if $Istarget > 0 Then

Combat()

Else

Target()

Endif

WEnd

func Target()

Sleep(300)

Send ("{TAB}")

EndFunc

func Combat()

Send("3")

Sleep(2150)

Send("1")

Sleep(2150)

Send("1")

Sleep(2150)

Send("1")

Sleep(2150)

Send("1")

Sleep(2150)

Send("1")

Endfunc

Func GetCurrentData()

$HPRead = _MemoryRead($hp_Address,$OpenProccess)

$APRead = _MemoryRead($ap_Address,$OpenProccess)

$Istarget = _MemoryRead($Istarget_address,$OpenProccess)

EndFunc

It only seems to spam the Target() function even when $Istarget is 1.

And sometimes when i start it, it just loops Combat() even when $Istarget is 0.

An advice would be greatly appreciated. Thanks in advance.

Share this post


Link to post
Share on other sites



Ive found out that the problem is in the memory reading stuff.

Although the memory addresses are correct according to cheat engine, autoit seems to mees up with them.

I tried Tooltip($HPRead) and the tooltip shows something like 123350400 when it should be about 1000.

And Tooltip($Istarget) showed 0 even when it should be 1. Why isnt my autoit reading the memory addresses correctly? it was fine yesterday :I

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