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 


Script that sets, and then freezes a value

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

Joined: 02 Oct 2017
Posts: 39

PostPosted: Thu Oct 05, 2017 3:25 pm    Post subject: Script that sets, and then freezes a value Reply with quote

Hello guys!
So i've been experimenting with CE and PCSX2 lately.
I want to make a script that will set a value in an address, and freeze it until the script is disabled. The issue is that the value is getting refreshed constantly.
After some googling, i found a CE forum thread, that looked like what i want to do. So i used the code that somebody gave to the TS, and replaced the address and value with what i need(code in the pic below).
The script does work, but when i uncheck it doesnt go back to normal.
Any suggestions?

The address that i want to modify, contains the running speed of my character.
The default max speed of the game is (float) 0.1, and i am trying to increase it to 1. Until the scripted is disabled.



Capture.JPG
 Description:
 Filesize:  44.2 KB
 Viewed:  7533 Time(s)

Capture.JPG


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Thu Oct 05, 2017 4:02 pm    Post subject: Reply with quote

you can also use two hotkeys with the same key combination
first one freezes, second one sets the value

--
as for your script not sure how that would work, as _end is never initialized, so is 0
so when you check if _end is 0 it sees it is, so jne _freeze will not be taken

your disable section also ignores the address of _end, and just places a 0 at 2013f5e4

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 02 Oct 2017
Posts: 39

PostPosted: Thu Oct 05, 2017 4:35 pm    Post subject: Reply with quote

Yeah setting hotkeys works fine.
Although, i want a script, so i can use it in a trainer.
The script is not mine. I just copied it from this thread called "Simple script for freezing values?" (sorry, can't post url's yet)
and wrote my address and value.
Freezing the value works fine. The issue is that it stays frozen, even after restarting pcsx2. I have to restart both pcsx2 and CE(or just not run CE) in order to reset the movement speed back to normal.

I guess that by now, you already got that i dont have much CE or assembly experience, and as i understand, people always come here and ask for help, without doing any research. It must be annoying af Razz
I personally have been trying to find a tutorial that would help me, but i cant seem to find any. Everything seems to be about how to find addresses-pointers, and setting up hotkeys.
So, do you have a scripting tutorial(not lua) to suggest to me? Very Happy

And thanks for the reply!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Thu Oct 05, 2017 5:24 pm    Post subject: Reply with quote

hotkeys also work in trainers
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 02 Oct 2017
Posts: 39

PostPosted: Fri Oct 06, 2017 2:08 am    Post subject: Reply with quote

But can i used them in some kind of a button(checkbox, togglebox etc)?
Because i thought that i can only use them as hotkeys
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Oct 06, 2017 3:24 am    Post subject: Reply with quote

if in a button then:
Code:

local mr=AddressList.getMemoryRecordByDescription('bla')
mr.Active=true  --freezes it
mr.Value=1 --sets the value (and because it's frozen, freezes it to that)


or
Code:

local mr=AddressList.getMemoryRecordByDescription('bla')
mr.Hotkey[0].doHotkey() --hotkey you assigned for freeze
mr.Hotkey[1].doHotkey() --hotkey you assigned for set value


(I recommend the first method though)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 02 Oct 2017
Posts: 39

PostPosted: Fri Oct 06, 2017 6:32 am    Post subject: Reply with quote

Thanks!
I m not sure if i did something wrong, but when i reclick the button, it stays frozen on that value.
Is there something i can do, so it will revert back to normal when i reclick the button?
I using a togglebox

Code:

 function CEToggleBox1Change(sender)

   local mr=AddressList.getMemoryRecordByDescription('walkspeed')
   mr.Active=true  --freezes it
   mr.Value=0.5 --sets the value (and because it's frozen, freezes it to that)

 end
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Fri Oct 06, 2017 11:11 am    Post subject: Reply with quote

instead of mr.Active=true --freezes it use mr.Active=sender.Checked --freezes it if checked else unfreezes
Back to top
View user's profile Send private message
Gou
Cheater
Reputation: 0

Joined: 02 Oct 2017
Posts: 39

PostPosted: Fri Oct 06, 2017 11:36 am    Post subject: Reply with quote

Oh!
I guess this makes sense.
Thanks a lot guys! Everything works like a charm!
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