Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how do I use cmp the right way.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
Faxonation
Cheater
Reputation: 0

Joined: 18 Oct 2014
Posts: 25

PostPosted: Sat Oct 31, 2015 2:24 pm    Post subject: how do I use cmp the right way. Reply with quote

I am trying to make my AA script that will only exicute when certain conditions are met.

I dont want lua code cause i cant run more then one script at a time.

Example:

Read these addresses
(Address1, Address2, Address3, Address4)

If addresses =
1,6,7,12A4335B
Then change the value at
Address5 to
FFFFFFFF.

I know how to do it in lua but i want to do it in normal AA script

Example 2:

cmp address to 1
je code
cmp address to 0
je code2

code:
Address:
db FF FF FF FF

code2:
Address:
Wait 2 secs
db B0 64 3A 00
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Oct 31, 2015 3:21 pm    Post subject: Reply with quote

What you want is Lua. Not sure why you think you can only run one script at a time.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Sat Oct 31, 2015 4:46 pm    Post subject: Reply with quote

Here a demo for 1), it is 64-bit, try attach cheatengine-x86_64.exe.
Hopefully not misunderstood the problem.

Go to __+80 and enter 1 to simulate matched condition.

Code:
[ENABLE]
globalalloc(__,$4000)

__:
dq __

__+10:
dq __+80,1,__+90,2,__+A0,3,__+b0,4,0,0 // addresses 1-4

__+e0: // address 5 to set
dq 0

__+f0: // thread end flag
dq 1

// ^ test set up

__+100:
push rax
push rcx
push rdx
push rdi

nextLoop:
mov  rcx,#50
sub  rsp,20
call Sleep
add  rsp,20
mov  rdi,__+10
testAddr:
inc  dword ptr [__+d0]// test of alive

mov  rdx,[rdi]        // load addres and matching value
mov  rax,[rdi+08]
test rdx,rdx          // test if end of address list
je   short doneOneLoop
cmp  [rdx],rax        // test if match
jne  short nextAddr

inc  dword ptr [__+e0]// action on match

nextAddr:
add  rdi,10
jmp short testAddr



doneOneLoop:
mov  rax,[__+f0]
test rax,rax
jne  short nextLoop

pop  rdi
pop  rdx
pop  rcx
pop  rax

ret

createThread(__+100)

[DISABLE]
__+f0:
dq 0

_________________
- Retarded.
Back to top
View user's profile Send private message
Faxonation
Cheater
Reputation: 0

Joined: 18 Oct 2014
Posts: 25

PostPosted: Sat Oct 31, 2015 10:09 pm    Post subject: Reply with quote

Dang i dont understand most of that. Thank you though. I will give it a try.


Zanzer wrote:
What you want is Lua. Not sure why you think you can only run one script at a time.


Because i wrote a bunch of scripts and only the first one I activate works. You think it might be because i didnt write anything under Disable? Cause i have to shut off cheat engine to turn off the script.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Sun Nov 01, 2015 1:50 am    Post subject: Reply with quote

Is it something like AA command Assert ?
ce help:
Code:
ASSERT(address, array of byte) :
Will check the memory address for the given address.
If the memory is not what is defined by the array of
byte given, the auto assemble script will not execute.


If yes, there is possible to make custom AA command to fit you need.
bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Nov 01, 2015 6:17 am    Post subject: Reply with quote

I think only one of your scripts is working because you named the function the same thing in each one.
If you show us two of your scripts, we can help you make them both work.
And we can help you with the DISABLE so you don't have to restart CE each time.
Code:
timer1 = createTimer(nil)
function execute1()
  -- do function one
end
timer1.OnTimer = execute1

Code:
timer2 = createTimer(nil)
function execute2()
  -- do function two
end
timer2.OnTimer = execute2
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites