Script Disable Reset

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
User avatar
arlight1
Fearless Donors
Fearless Donors
Posts: 41
Joined: Tue Apr 25, 2017 12:04 am
Reputation: 5

Script Disable Reset

Post by arlight1 » Mon May 01, 2017 3:41 am

Hi everyone.

I've got a script that edits a game's weapon fire rates. I made it a multiplier where a value of 2 assigned to a symbol to my table means my weapons fire 2 times as fast. I'd like to make it so that when I disable the script, the symbol changes back to the default, a value of 1, without deallocating the memory assigned to it. So essentially when I enable a script, some [testNum] becomes 2, and when i disable the script, the [testNum] becomes 1, and toggles back and forth like that.

User avatar
++METHOS
Administration
Administration
Posts: 204
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 27

Re: Script Disable Reset

Post by ++METHOS » Mon May 01, 2017 4:27 am

[ENABLE]
globalalloc(testnum,8)

testnum:
db 2

[DISABLE]
testnum:
db 1

User avatar
arlight1
Fearless Donors
Fearless Donors
Posts: 41
Joined: Tue Apr 25, 2017 12:04 am
Reputation: 5

Re: Script Disable Reset

Post by arlight1 » Mon May 01, 2017 5:25 pm

++METHOS wrote:
Mon May 01, 2017 4:27 am
[ENABLE]
globalalloc(testnum,8)

testnum:
db 2

[DISABLE]
testnum:
db 1
Thanks! :D
So the globalalloc will prevent it from being allocated each time it's enabled right? And won't eat up memory when you continuously enable/disable like a regular alloc would?

User avatar
++METHOS
Administration
Administration
Posts: 204
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 27

Re: Script Disable Reset

Post by ++METHOS » Mon May 01, 2017 6:46 pm

The globally-allocated data does not get deallocated in this example, so yes to your first question. With regard to consuming memory, do not think that this would be an issue, either way, since the data will be placed inside the target's memory region that exists with or without your allocation and would be negligible anyways.

Post Reply

Who is online

Users browsing this forum: No registered users