| View previous topic :: View next topic |
| Author |
Message |
helmiex How do I cheat?
Reputation: 0
Joined: 15 Mar 2011 Posts: 3
|
Posted: Tue Mar 15, 2011 7:40 am Post subject: Problem with script engine |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Mar 15, 2011 7:46 am Post subject: |
|
|
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 |
|
 |
helmiex How do I cheat?
Reputation: 0
Joined: 15 Mar 2011 Posts: 3
|
Posted: Tue Mar 15, 2011 8:44 am Post subject: |
|
|
| 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
|
|
| Back to top |
|
 |
|