the script does not change the value of the address

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
coroco
Noobzor
Noobzor
Posts: 10
Joined: Wed Jul 28, 2021 4:01 pm
Reputation: 0

the script does not change the value of the address

Post by coroco »

Again me and another problem, why when I do not have an address added in the address table, the script does not change the address value? The script finds the address and displays its correct value, but as long as I do not have this address in the address table, the script does not change the value although it works.

Code: Select all

{$lua}
------------------------------ ENABLE ------------------------------
[ENABLE]
local function luaThread(thread)
    while RunLuaThread do


mod = getAddress('Gam248c.tmp+1ACAC4')
mod = readInteger(mod)
if mod == nil or mod == 0 then return
else
adr = readInteger(mod+0x14)
adr = readInteger(adr +0x10)
adr = getAddress(adr +0xa0-0x4)

if isKeyPressed(104) then
y = getAddress(adr+0x8)
fy = readFloat(y)
xd=writeFloat(fy+50)
print(y)
print(fy)
end

end
        sleep(100)
    end
    thread.terminate()
end
----------------------------------
if syntaxcheck then return end
RunLuaThread = true
createThread(luaThread)
------------------------------ DISABLE ------------------------------
[DISABLE]
if syntaxcheck then return end
RunLuaThread = false
Image

User avatar
YoucefHam
Expert Cheater
Expert Cheater
Posts: 92
Joined: Sun Jan 21, 2018 10:21 pm
Reputation: 209

Re: the script does not change the value of the address

Post by YoucefHam »

coroco wrote:
Thu Sep 16, 2021 8:06 pm
Again me and another problem, why when I do not have an address added in the address table, the script does not change the address value? The script finds the address and displays its correct value, but as long as I do not have this address in the address table, the script does not change the value although it works.
.............................
Hi there, I think the problem that you are reading an address with readInteger (4 Bytes), unstead use readQword (8 Bytes)
[Link]

ohh sorry, and you are missing something in this line

Code: Select all

xd=writeFloat(y,fy+50)
[Link]

ShyTwig16
Expert Cheater
Expert Cheater
Posts: 335
Joined: Thu Apr 06, 2017 7:14 pm
Reputation: 20

Re: the script does not change the value of the address

Post by ShyTwig16 »

coroco wrote:
Thu Sep 16, 2021 8:06 pm
Again me and another problem, why when I do not have an address added in the address table, the script does not change the address value? The script finds the address and displays its correct value, but as long as I do not have this address in the address table, the script does not change the value although it works.

Code: Select all

{$lua}
------------------------------ ENABLE ------------------------------
[ENABLE]
local function luaThread(thread)
    while RunLuaThread do


mod = getAddress('Gam248c.tmp+1ACAC4')
mod = readInteger(mod)
if mod == nil or mod == 0 then return
else
adr = readInteger(mod+0x14)
adr = readInteger(adr +0x10)
adr = getAddress(adr +0xa0-0x4)

if isKeyPressed(104) then
y = getAddress(adr+0x8)
fy = readFloat(y)
xd=writeFloat(fy+50)
print(y)
print(fy)
end

end
        sleep(100)
    end
    thread.terminate()
end
----------------------------------
if syntaxcheck then return end
RunLuaThread = true
createThread(luaThread)
------------------------------ DISABLE ------------------------------
[DISABLE]
if syntaxcheck then return end
RunLuaThread = false
Image
YoucefHam wrote:
Wed Jan 12, 2022 1:58 pm
coroco wrote:
Thu Sep 16, 2021 8:06 pm
Again me and another problem, why when I do not have an address added in the address table, the script does not change the address value? The script finds the address and displays its correct value, but as long as I do not have this address in the address table, the script does not change the value although it works.
.............................
Hi there, I think the problem that you are reading an address with readInteger (4 Bytes), unstead use readQword (8 Bytes)
[Link]

ohh sorry, and you are missing something in this line

Code: Select all

xd=writeFloat(y,fy+50)
[Link]
Like the wiki shows "writeFloat" takes two parameters, "address" and "value" in that order.
writeFloat(Address, Value) : Boolean - Returns true on success.
And it's better to use "readPointer" when reading pointers as it will read the correct size based on if the process is 64 bit or 32 bit.
[Link]

Post Reply

Who is online

Users browsing this forum: No registered users