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 


Really weird situation

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
seajist
Cheater
Reputation: 0

Joined: 24 Apr 2007
Posts: 39

PostPosted: Mon Jul 23, 2007 8:16 am    Post subject: Really weird situation Reply with quote

I have 6 addresses that need their value changed right when I want them to, hopefully via a macro, but, 3 of the addresses need to change their value to one thing, and the other 3 of the addresses need to change to something else, is it possible to have 3 addresses change their value using only one macro??
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25982
Location: The netherlands

PostPosted: Mon Jul 23, 2007 8:55 am    Post subject: Reply with quote

if hotkeys weren't screwed up you could do that...

For now, try it with a autoassembler script on a often called routine.
In there call getasynckeystate with the key you want to press, check the result, and if pressed, set the values

Code:

yourcode:
pushad  //save all registers since I never know which registers get messed up by function calls
pushfd //might as well save the flags in case you are so stupid to place your hook right before a conditonal jump...
push 70  //F1   , f2=71, f3=73, ....
call getasynckeystate
shr eax,f   //bit 15 contains the pressed state
and eax,1 //cut off the high bits if it is somehow sign extended...
cmp eax,1 //check if that bit is 1
jne returntogame  //if not, go back to the game without editing

//key is pressed
mov [address1],value1
mov [address2],value1
mov [address3],value1
mov [address4],value2
mov [address5],value2
mov [address6],value2



returntogame:
popfd //restore the flags
popad  //and restore all registers back to normal
jmp return



_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
seajist
Cheater
Reputation: 0

Joined: 24 Apr 2007
Posts: 39

PostPosted: Mon Jul 23, 2007 9:18 am    Post subject: Reply with quote

I get an error
"Error in line 2 "yourcode"The address specifier is not valid
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 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