Jump to content

sendkey on sound


Metti
 Share

Recommended Posts

sure Blizzard's Warden is present but used that script for long time...

i use that to find splash of bobber while fishing:

Func Find_Splash($float_x, $float_y)

$sear_left = $float_x - 32

$sear_righ = $sear_left + 52

$sear_top = $float_y - 32

$sear_bott = $sear_top + 64

While TimerDiff($star_time) < $wait_time

$pos = PixelSearch($sear_left, $sear_top, $sear_righ, $sear_bott, $spla_colo, $tolerance, $sear_step)

If @error Then

SetError(0)

Else

MouseClick("right", $pos[0], $pos[1], 1, 2)

Sleep(5500)

ExitLoop

EndIf

Sleep(100)

WEnd

Cast_Pole()

EndFunc

that is not bad he detects every 4th time when a fish is on bobber.

If it's possible to detect the use of certain soundfile I could send a rightklick after playing sound

Link to comment
Share on other sites

Yes there is a way. It is a matter of hooking api's though and that gets into reverse engineering. You'd need a program like ollydbg and then you'd need to find the right api to set a breakpoint on - the api that calls sounds to play. See games use windows apis to perform certain basic, low leveling programming tasks, like reading or writing to memory, moving the mouse, etc. etc. There are a different many bunch of .dll's that contain these functions. For example kernel32.dll contains the functions for reading and writing memory and user32.dll contains the functions for moving the mouse. What you should do is do some research to find the right api to hook that the game uses to run sounds. I'm assuming it'll use a windows api. And from there set a breakpoint on it with ollydbg then trace it back to where the call was made in the program. From that call to the api function you could change it to a call to your program and then return to it's called function of playing the sound. To do this you would need good knowledge of ASM and working with api's and good knowledge of debuggers. In my opinion, your best course of action is to think around this... think about what circumstances make that sounds play and try to find something else more concrete you can work this.... Don't get me wrong, it's possible, but it's a much harder method then there should be.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...