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 


CT show value but not in lua script, can help check?

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

Joined: 09 Oct 2024
Posts: 4

PostPosted: Wed Oct 09, 2024 9:37 pm    Post subject: CT show value but not in lua script, can help check? Reply with quote

For e.g.: my staticAddress is BEBF90 while offset is 16. So I add address manually as 00BEBFA0 in address and pointer as 16. It show the value correctly in the CT so I try in LUA script but it did not capture the value. Anyone can help if I script it wrongly? It always return 0 value while CT there shown correct value as in 10 for example.

Code:

local baseAddress = 0x00BEBF90
local offset = 0x0016
local criteria = 5
local hotkey = VK_F1

local timer = createTimer(nil)
timer.Interval = 1000

function checkMemory()
    local address = baseAddress + offset
    local value = readInteger(address)

    if value >= criteria then
        send(hotkey)
    end
end

function startTimer()
    timer.OnTimer = checkMemory
    timer.Enabled = true   -- Start the timer
    print("Timer started.")
end

function stopTimer()
    timer.Enabled = false  -- Stop the timer
    print("Timer stopped.")
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Wed Oct 09, 2024 11:36 pm    Post subject: Reply with quote

use readPointer(baseAddress)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Gamers.F
How do I cheat?
Reputation: 0

Joined: 09 Oct 2024
Posts: 4

PostPosted: Thu Oct 10, 2024 6:57 pm    Post subject: Reply with quote

Dark Byte wrote:
use readPointer(baseAddress)


Thanks, its work for me.
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