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 the float values?

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

Joined: 30 Dec 2023
Posts: 26

PostPosted: Mon Feb 12, 2024 3:26 pm    Post subject: Freeze the float values? Reply with quote

Is it possible to freeze the change float values of the trackbar like the cheat engine freezes the values when I check the script? Cause due to external factors on the game it resets the floats when i trigger something.

here's my code.

Code:
CETrainer.CETrackBar19.Max= 320
CETrainer.CETrackBar19.Min= -320
CETrainer.CETrackBar20.Max= 320
CETrainer.CETrackBar20.Min= -320
CETrainer.CETrackBar21.Max= 320
CETrainer.CETrackBar21.Min= -320


function CETrainer_CETrackBar19Change(sender)
local ValRotXRShoulder = readFloat(RotXRShoulder)
local value=trackbar_getPosition(CETrainer_CETrackBar19)
local finalvalue = value * 0.01
writeFloat(RotXRShoulder, finalvalue)
control_setCaption(CETrainer_CEEdit22,finalvalue)
end

function CETrainer_CETrackBar20Change(sender)
local ValRotYRShoulder = readFloat(RotYRShoulder)
local value=trackbar_getPosition(CETrainer_CETrackBar20)
local finalvalue = value * 0.01
writeFloat(RotYRShoulder, finalvalue)
control_setCaption(CETrainer_CEEdit23,finalvalue)
end

function CETrainer_CETrackBar21Change(sender)
local ValRotZRShoulder = readFloat(RotZRShoulder)
local value=trackbar_getPosition(CETrainer_CETrackBar21)
local finalvalue = value * 0.01
writeFloat(RotZRShoulder, finalvalue)
control_setCaption(CETrainer_CEEdit24,finalvalue)
end

function CETrainer_CEEdit22EditingDone(sender)
  local inputText = sender.Text
  local parsedValue = tonumber(inputText)
  local multiplier = 0.01
    if parsedValue then
        CETrainer.CETrackBar19.Position = parsedValue / multiplier
        writeFloat(RotXRShoulder, parsedValue)
    end
end

function CETrainer_CEEdit23EditingDone(sender)
  local inputText = sender.Text
  local parsedValue = tonumber(inputText)
  local multiplier = 0.01
    if parsedValue then
        CETrainer.CETrackBar20.Position = parsedValue / multiplier
        writeFloat(RotYRShoulder, parsedValue)
    end
end


function CETrainer_CEEdit24EditingDone(sender)
  local inputText = sender.Text
  local parsedValue = tonumber(inputText)
  local multiplier = 0.01
    if parsedValue then
        CETrainer.CETrackBar21.Position = parsedValue / multiplier
        writeFloat(RotZRShoulder, parsedValue)
    end
end


Hope someone can help me. Thanks
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