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 


Need help with freezing.

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

Joined: 28 May 2016
Posts: 51

PostPosted: Tue May 31, 2016 3:57 pm    Post subject: Need help with freezing. Reply with quote

Hello Ce Forum

My problem:
I got a checkbox for an pointer that i need to set a value for at the same time as i freeze the set value. But i cant come up with a way to freeze it at the same time. (Or unfreeze when =unchecked)
This is my code:

Code:
function CETrainerCheckbox4Change(sender)
  if (CETrainer.CECheckbox4.State==cbChecked)then
writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 20)
  else
writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 7)
  end
end


Thankful for all help i can get!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Tue May 31, 2016 5:05 pm    Post subject: Reply with quote

Code:
local ptrFreezeTimer = createTimer(CETrainer.CECheckbox4, false)
ptrFreezeTimer.OnTimer = function(sender)
  writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 20)
end
ptrFreezeTimer.Interval = 50

function CETrainerCheckbox4Change(sender)
  local b = CETrainer.CECheckbox4.State == cbChecked
  ptrFreezeTimer.Enabled = b
  if not b then
    writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 7)
  end
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Tue May 31, 2016 6:00 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
local ptrFreezeTimer = createTimer(CETrainer.CECheckbox4, false)
ptrFreezeTimer.OnTimer = function(sender)
  writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 20)
end
ptrFreezeTimer.Interval = 50

function CETrainerCheckbox4Change(sender)
  local b = CETrainer.CECheckbox4.State == cbChecked
  ptrFreezeTimer.Enabled = b
  if not b then
    writeInteger("[[[[[game.exe+000BA1FC]+b0]+504]+c]+c]+504", 7)
  end
end


This almost did the trick, but im faced with a problem. When i enable this and jump ingame, my charecter gets stuck floating in the air.

However it works when i add two hotkeys like in the top left corner of the image i added.

If it helps it is supposed to increase the jumpheight in the game.exe but if you dont freeze it the value goes back to normal when you jump.

I added a picture showing how the code looks in my lua and with the hotkeys i described earlier.



Description.jpg
 Description:
 Filesize:  151.08 KB
 Viewed:  4702 Time(s)

Description.jpg


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Tue May 31, 2016 6:18 pm    Post subject: Reply with quote

Unrelated, but aren't those values floats instead of integers?

I'm not sure what the difference is. The only thing I can think of is that the freeze interval isn't the same, but that shouldn't affect it that much.

If you want to, you can set the value of the memory record directly and freeze it.
Code:
function CETrainerCheckbox4Change(sender)
  local r = getAddressList().getMemoryRecordByDescription("something")
  local b = CETrainer.CECheckbox4.State == cbChecked
  r.Active = b
  r.Value = b and "3247909464" or "3237909464"
end


IMO a better (albeit harder) solution would be to hook the instruction that writes to it or reads from it and make it return whatever value you want instead.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Tue May 31, 2016 7:22 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Unrelated, but aren't those values floats instead of integers?

I'm not sure what the difference is. The only thing I can think of is that the freeze interval isn't the same, but that shouldn't affect it that much.

If you want to, you can set the value of the memory record directly and freeze it.
Code:
function CETrainerCheckbox4Change(sender)
  local r = getAddressList().getMemoryRecordByDescription("something")
  local b = CETrainer.CECheckbox4.State == cbChecked
  r.Active = b
  r.Value = b and "3247909464" or "3237909464"
end


IMO a better (albeit harder) solution would be to hook the instruction that writes to it or reads from it and make it return whatever value you want instead.


That fixed it, thank you very much Smile
Back to top
View user's profile Send private message
ll*-_-*ll
How do I cheat?
Reputation: 0

Joined: 30 May 2016
Posts: 2

PostPosted: Fri Jun 03, 2016 5:28 pm    Post subject: Reply with quote

ParkourPenguin ya conseguiste lo que necesito me podrías responder por pm o por aquí por favor ya que creo que borraron todos mis msjs de todos los foros
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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