View previous topic :: View next topic |
Author |
Message |
TheRunner How do I cheat? Reputation: 0
Joined: 14 Apr 2018 Posts: 8
|
Posted: Sat Jun 23, 2018 8:55 pm Post subject: Need help with running Wav files under conditions |
|
|
I would if it's possible to create a script to where if an address or two get a certain value (condition), Cheat Engine would play a sound from a file I have.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Jun 23, 2018 9:32 pm Post subject: |
|
|
sure, there's various ways but something like this may be the most generic
Code: | soundCheckMemrecs = {
AddressList.getMemoryRecordByID('name/desc of memory record with address'),
}
soundCheckValues = {
'100', -- strings because that's how memrec exposes the values
}
local thewav = ... -- tablefile from findTableFile or a stream containing wav data
function doCheck()
if #soundCheckMemrecs ~= #soundCheckValues then error('num memrecs do not match num values!') end
for i,mr in ipairs(soundCheckMemrecs) do
if mr.Value ~= soundCheckValues[i] then
return false -- quit checking
end
end
-- otherwise we did not leave the function so everything matched
playSound(thewav)
-- potentially change interval to delay next check
end
-- create timer to continuously check
soundTimer = createTimer()
soundTimer.Interval = getUpdateTimer().Interval
soundTimer.OnTimer = doCheck |
_________________
|
|
Back to top |
|
|
TheRunner How do I cheat? Reputation: 0
Joined: 14 Apr 2018 Posts: 8
|
Posted: Sun Jun 24, 2018 12:51 pm Post subject: |
|
|
I am really new to this. I hope you could help me by putting an example for this to work. For example I want it to be turned on when the address 209A80EF gets the value 73. Could you please built the script with this? It could help me know where do I insert these addresses and values for this to work. Thanks in advance for the help.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sun Jun 24, 2018 1:24 pm Post subject: |
|
|
Then add the address 209A80EF to the address list and name it "name/desc of memory record with address" without quotes (or change that in the code to whatever you name it), and change the 100 in the values table to 73.
set thewav to findTableFile('Activate') for testing, CE automatically adds Activate and Deactivate sounds
Then run the lua code
_________________
|
|
Back to top |
|
|
|