Page 1 of 1

the script does not change the value of the address

Posted: Thu Sep 16, 2021 8:06 pm
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

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

Posted: Wed Jan 12, 2022 1:58 pm
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]

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

Posted: Wed Jan 12, 2022 2:16 pm
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]