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 


Freeze value

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

Joined: 11 Apr 2022
Posts: 5

PostPosted: Tue Apr 12, 2022 1:05 am    Post subject: Freeze value Reply with quote

Hello, I do have a quick question. I have successfully played with the AS code. However, the value defaults to 0 overtime (maybe 10-15 seconds after clicking the level buttons). How do I freeze the value of the 'AS' so it won't be a hassle clicking the buttons time and time again?

Listed below is the code used for the 'AS' scan.

Code:
-- AS --

CETrainer.CEButton5.OnClick=function() --AS LEVEL 1 ..
  local mr2 = AddressList.getMemoryRecordByDescription('AS')
  mr2.value = 0.4
  print("Level 1 AS Active!")
end

CETrainer.CEButton6.OnClick=function() --AS LEVEL 2.
  local mr2 = AddressList.getMemoryRecordByDescription('AS')
  mr2.value = 0.8
  print("Level 2 AS Active!")
end

CETrainer.CEButton7.OnClick=function() --AS LEVEL 3.
  local mr2 = AddressList.getMemoryRecordByDescription('AS')
  mr2.value = 1
  print("Level 3 AS Active!")
end

CETrainer.CEButton8.OnClick=function() --AS OFF.
  local mr2 = AddressList.getMemoryRecordByDescription('AS')
  mr2.value = 0.18
  print("AS turned off.")
end
[/img][/code]
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1251

PostPosted: Tue Apr 12, 2022 2:58 am    Post subject: Reply with quote

You can edit the timer value for the pressure calculation.

Here is an example:

Code:
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=10 frzTim1.Enabled=false

local adrr1=""
local val1=0
local frzIndex=0

frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
 if frzIndex==150 then --15=1500 msec, 1.5 sec .. 150=15.000 msec, 15 sec
  frzTim1.Enabled=false
  else
  adrr1.Value = val1
 end
end

CETrainer.CEButton5.OnClick=function() --AS LEVEL 1 ..
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.4
  frzIndex=0
  frzTim1.Enabled=true
  print("Level 1 AS Active!")
end

CETrainer.CEButton6.OnClick=function() --AS LEVEL 2.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.8
  frzIndex=0
  frzTim1.Enabled=true
  print("Level 2 AS Active!")
end

CETrainer.CEButton7.OnClick=function() --AS LEVEL 3.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 1
  frzIndex=0
  frzTim1.Enabled=true
  print("Level 3 AS Active!")
end

CETrainer.CEButton8.OnClick=function() --AS OFF.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.18
  frzIndex=0
  frzTim1.Enabled=true
  print("AS turned off.")
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
moon1
How do I cheat?
Reputation: 0

Joined: 11 Apr 2022
Posts: 5

PostPosted: Tue Apr 12, 2022 3:20 am    Post subject: Reply with quote

Thank you for this code again AylinCE!


I tried it using in 'AS' however, whenever I use a single skill in-game, the 'AS' value returns to its default value which is "0". Is there any workaround with this one?
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1251

PostPosted: Tue Apr 12, 2022 5:29 am    Post subject: Reply with quote

I'm sorry, it's my fault.
Replace the existing code with the code below.
(Address active true)

Code:
frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
 if frzIndex==150 then --15=1500 msec, 1.5 sec .. 150=15.000 msec, 15 sec
  adrr1.Active = false
  frzTim1.Enabled=false
  else
  adrr1.Value = val1
  adrr1.Active = true
 end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
moon1
How do I cheat?
Reputation: 0

Joined: 11 Apr 2022
Posts: 5

PostPosted: Tue Apr 12, 2022 6:22 am    Post subject: Reply with quote

Thank you again for this fix AylinCE! I have tried it and it's the same. Whenever that I get/drop an item, the 'AS' goes back to where it was initially.

Here's the full code that I am using with this 'AS'

Code:
-- AS --
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=1 frzTim1.Enabled=false

local adrr1=""
local val1=0
local frzIndex=0

frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
 if frzIndex==150 then --15=1500 msec, 1.5 sec .. 150=15.000 msec, 15 sec
  adrr1.Active = false
  frzTim1.Enabled=false
  else
  adrr1.Value = val1
  adrr1.Active = true
 end
end

CETrainer.CEButton5.OnClick=function() --AS LEVEL 1 ..
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.4
  frzIndex=0
  frzTim1.Enabled=true
  CETrainer.CELabel3.caption="Level 1 AS Active!"
end

CETrainer.CEButton6.OnClick=function() --AS LEVEL 2.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.8
  frzIndex=0
  frzTim1.Enabled=true
  CETrainer.CELabel3.caption="Level 2 AS Active!"
end

CETrainer.CEButton7.OnClick=function() --AS LEVEL 3.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 1
  frzIndex=0
  frzTim1.Enabled=true
  CETrainer.CELabel3.caption="Level 3 AS Active!"
end

CETrainer.CEButton8.OnClick=function() --AS OFF.
  adrr1 = AddressList.getMemoryRecordByDescription('AS')
  val1 = 0.18
  frzIndex=0
  frzTim1.Enabled=true
  CETrainer.CELabel3.caption="AS is turned off!"
end
[/code]
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1251

PostPosted: Tue Apr 12, 2022 7:03 am    Post subject: Reply with quote

Code:
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=1 frzTim1.Enabled=false

local adrr1=""
local val1=0
local frzIndex=0

frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
 if frzIndex==150 then --15=1500 msec, 1.5 sec .. 150=15.000 msec, 15 sec
  adrr1.Active = false
  frzTim1.Enabled=false
  else
  adrr1.Value = val1
  adrr1.Active = true
 end
end


Interval 1 * 150 = 0.150 seconds.

Look at the code below;
Code:
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=1 frzTim1.Enabled=false

local adrr1=""
local val1=0
local frzIndex=0

frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
 if frzIndex==15000 then --1000=1 sec
  adrr1.Active = false
  frzTim1.Enabled=false
  else
  adrr1.Value = val1
  adrr1.Active = true
 end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
moon1
How do I cheat?
Reputation: 0

Joined: 11 Apr 2022
Posts: 5

PostPosted: Tue Apr 12, 2022 11:07 pm    Post subject: Reply with quote

thank you for this one AylinCE! I somehow managed to make it work by playing with the values of the freeze timer. Thank you very much!
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 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