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 


search Array of byte
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
titomdma
Newbie cheater
Reputation: 0

Joined: 14 Jul 2024
Posts: 12

PostPosted: Tue Jul 23, 2024 11:25 am    Post subject: Reply with quote

I tried this script

Code:
-- Script de Cheat Engine modify multiple float addresses
 
-- Input addresses
local inputAddress = 0x19B5CD862C4  -- Dirección 1 (inputAddress)
local upAddress = 0x192891FCCA0 -- Dirección UP (upAddress)
local downAddress = 0x192891F4000  -- Dirección DOWN (downAddress)
local xValue = 100  -- Valor para calcular el porcentaje de aumento (Xvalue)
local yValue = 100  -- Valor para calcular el porcentaje de disminución (Yvalue)
 
-- Interval in miliseconds (1000 ms = 1 segundo)
local interval = 11
 
-- Function read value
local function readFloat(address)
  return readFloat(address)
end
 
-- Function write value
local function writeFloat(address, value)
  writeFloat(address, value)
end
 
-- Function calculate percentage
local function modifyValues()
  -- Lee los valores actuales
  local value1 = readFloat(inputAddress)
  local value2 = readFloat(inputAddress + 0x890)
  local value3 = readFloat(inputAddress + 0x1120)
  local value4 = readFloat(inputAddress + 0x19B0)
 
  -- Calculate new values
  if readFloat(upAddress) > 0 then
    value1 = value1 * (1 + xValue / 100)
    value2 = value2 * (1 + xValue / 100)
    value3 = value3 * (1 + xValue / 100)
    value4 = value4 * (1 + xValue / 100)
  elseif readFloat(downAddress) > 0 then
    value1 = value1 * (1 - yValue / 100)
    value2 = value2 * (1 - yValue / 100)
    value3 = value3 * (1 - yValue / 100)
    value4 = value4 * (1 - yValue / 100)
  end
 
  -- write new values
  writeFloat(inputAddress, value1)
  writeFloat(inputAddress + 0x890, value2)
  writeFloat(inputAddress + 0x1120, value3)
  writeFloat(inputAddress + 0x19B0, value4)
end
 
-- timer for `modifyValues`
local timer = createTimer(nil, true)
timer.Interval = 11
timer.OnTimer = function(timer)
  modifyValues()
end
timer.Enabled = true
 


After click execute CE freezed
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Tue Jul 23, 2024 11:56 am    Post subject: Reply with quote

titomdma wrote:
Code:
 local function readFloat(address)
  return readFloat(address)
end
Why did you write this? That's a recursive function call with no end condition. It's just going to cause a stack overflow.
Don't name your functions the same as CE's functions.

_________________
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
titomdma
Newbie cheater
Reputation: 0

Joined: 14 Jul 2024
Posts: 12

PostPosted: Wed Jul 24, 2024 8:08 am    Post subject: Reply with quote

ParkourPenguin wrote:
titomdma wrote:
Code:
 local function readFloat(address)
  return readFloat(address)
end
Why did you write this? That's a recursive function call with no end condition. It's just going to cause a stack overflow.
Don't name your functions the same as CE's functions.


Thanks I changed for customfunctionname & fixed
Have a nice day
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
Goto page Previous  1, 2
Page 2 of 2

 
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