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 


Problem with script engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
helmiex
How do I cheat?
Reputation: 0

Joined: 15 Mar 2011
Posts: 3

PostPosted: Tue Mar 15, 2011 7:40 am    Post subject: Problem with script engine Reply with quote

i have been trying to change value by using script engine but still no luck, sorry if im a bit dummy about this im new in cheat engine.

the address is 00D03FC4 and the value 96

i want change it to 100 if the value decreasing

here the script i use

#define addresstochange 0x00D03FC4

if (0x00D03FC4 < 100) {
*(int *)addresstochange=100;
}

but when click execute there's nothing happen, can you guy point me to the correct direction.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Mar 15, 2011 7:46 am    Post subject: Reply with quote

The line:
Code:
if (0x00D03FC4 < 100) {


Will always fail. This isn't reading the value from the address, this is just comparing the address itself to 100. Basically, think of it as:
if( 2 < 1 )

This will never be true since 2 is greater then 1. Your address will never be less then 100 since nothing is changing it. (Written that way it is static.)

Instead, read the value from the pointer using *(int*) again.

Code:
#define addresstochange 0x00D03FC4
int nValue = *(int*)addresstochange;
if(nValue < 100 ) {
    *(int*)addresstochange = 100;
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
helmiex
How do I cheat?
Reputation: 0

Joined: 15 Mar 2011
Posts: 3

PostPosted: Tue Mar 15, 2011 8:44 am    Post subject: Reply with quote

Wiccaan wrote:
The line:
Code:
if (0x00D03FC4 < 100) {


Will always fail. This isn't reading the value from the address, this is just comparing the address itself to 100. Basically, think of it as:
if( 2 < 1 )

This will never be true since 2 is greater then 1. Your address will never be less then 100 since nothing is changing it. (Written that way it is static.)

Instead, read the value from the pointer using *(int*) again.

Code:
#define addresstochange 0x00D03FC4
int nValue = *(int*)addresstochange;
if(nValue < 100 ) {
    *(int*)addresstochange = 100;
}



thank you very² much, you are my life saver Very Happy
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