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 


Can CE plays .wav files by AA script or Lua?

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

Joined: 20 Aug 2016
Posts: 2

PostPosted: Fri Mar 31, 2017 6:50 am    Post subject: Can CE plays .wav files by AA script or Lua? Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Mar 31, 2017 8:29 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Mar 31, 2017 9:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Mar 31, 2017 3:49 pm    Post subject: This post has 1 review(s) Reply with quote

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
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Mar 31, 2017 9:24 pm    Post subject: Reply with quote

There is still so much that I do not know about CE. Thanks, DB!
Back to top
View user's profile Send private message
elzee
How do I cheat?
Reputation: 0

Joined: 20 Aug 2016
Posts: 2

PostPosted: Sat Apr 01, 2017 10:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Apr 05, 2017 4:32 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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