View previous topic :: View next topic |
Author |
Message |
elzee How do I cheat? Reputation: 0
Joined: 20 Aug 2016 Posts: 2
|
Posted: Fri Mar 31, 2017 6:50 am Post subject: Can CE plays .wav files by AA script or Lua? |
|
|
Sorry my English is not good.
I hope to make a trainer that can play a sound every time when player's HP is damaged.
Is it possible to trigger a .wav sound by AA script or Lua?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Fri Mar 31, 2017 8:29 am Post subject: |
|
|
You can use playSound in lua to play a wav file
Quote: |
playSound(stream, waittilldone OPTIONAL): Plays the given memorystream containing a .WAV formatted memory object. If waittilldone is true the script will stop executing till the sound has stopped
playSound(tablefile, waittilldone OPTIONAL) : Takes the memorystream from the tablefile and plays it.
There are two tablefiles predeclared inside cheat engine "Activate" and "Deactivate" . You are free to use or override them
|
e.g:
Code: |
playSound('attachedwavfile')
|
_________________
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 |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Fri Mar 31, 2017 9:15 am Post subject: |
|
|
Presumably, if you wanted to incorporate this Lua code inside of an AA script, the Lua portion would get executed first? I am just curious if there would be a practical way to do something similar without having to write everything out in Lua.
Thanks.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Fri Mar 31, 2017 3:49 pm Post subject: |
|
|
use the call ce lua function template, and then in an aa script call playsound when it gets executed
_________________
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 |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Fri Mar 31, 2017 9:24 pm Post subject: |
|
|
There is still so much that I do not know about CE. Thanks, DB!
|
|
Back to top |
|
|
elzee How do I cheat? Reputation: 0
Joined: 20 Aug 2016 Posts: 2
|
Posted: Sat Apr 01, 2017 10:19 am Post subject: |
|
|
Dark Byte wrote: | use the call ce lua function template, and then in an aa script call playsound when it gets executed |
Thank you!
Can I write the aa like this?
movss [rbx+20],xmm6 // this is the original hp damage code
luacall(playSound(findTableFile('xxx.wav'))) // then play this sound
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Wed Apr 05, 2017 4:32 pm Post subject: |
|
|
no, check out the ce lua function template
you can do:
Code: |
alloc(script,48)
script:
db 'playSound(findTableFile("xxx.wav"))',0
...
movss [rbx+20],xmm6 // this is the original hp damage code
//store RCX, RDX, R8, R9, R10, R11
...
mov rcx,script
sub rsp,20
call CELUA_ExecuteFunction
add rsp,20
...
//restore RCX, RDX, R8, R9, R10, R11
...
|
_________________
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 |
|
|
|