Question: Read value then Speak

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
Blackrosemmt
Noobzor
Noobzor
Posts: 14
Joined: Wed Jul 17, 2019 8:07 pm
Reputation: 0

Question: Read value then Speak

Post by Blackrosemmt »

Hi all

I need lua script to read value from address then speak it once it reach the value I specify.
for example once money in game reach 100 then speak "hundred"

Can anyone please help.

imjustmaxie
Expert Cheater
Expert Cheater
Posts: 222
Joined: Mon Aug 06, 2018 6:00 pm
Reputation: 186

Re: Question: Read value then Speak

Post by imjustmaxie »

Assuming money is 4 bytes type:

if readInteger(address) == 100 then speak(“hundred”) end

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Question: Read value then Speak

Post by S1N74X »

Blackrosemmt wrote:
Sun Mar 17, 2024 2:49 pm
Hi all

I need lua script to read value from address then speak it once it reach the value I specify.
for example once money in game reach 100 then speak "hundred"

Can anyone please help.
Hope that helps
Spoiler

Code: Select all

{$lua}
if syntaxcheck then return end
[ENABLE]

runTimer = true

local interval = 5000
local addressToRead = 0xDEADBEEF -- replace with your Money Address
local valToCheck = 100

local function ReadAddress()
local addressResult = readInteger(addressToRead)
if type(addressResult) == 'number' and addressResult >= valToCheck then
speakEnglish(tostring(addressResult),true)
end
end


local timer = createTimer(GetMainForm(true))
timer.Interval = interval
timer.OnTimer = function()
if runTimer ~= true then
timer.Destroy()
timer = nil
end
ReadAddress()
end


[DISABLE]
runTimer = nil

Post Reply

Who is online

Users browsing this forum: xXLashkeXx