piccaso Posted October 7, 2004 Posted October 7, 2004 I just played arount with DllCall ... func kernel32_Beep ($freq,$duration) ; Win95 ignores duration parameter ; freq : 37 -> 32767 [HZ] $r = dllcall("kernel32.dll","long","Beep","long",$freq,"long",$duration) if @error = 1 Then SetError(1) Return Else Return $r[0] EndIf EndFunc This function truly makes autoit powerfull (i mean dllcall not mine :"> ) if you miss something the api supports, you can just code it.... want to hear some funny noise? try this one for $i = 0 to 250 kernel32_Beep(Random(37,32767),1) Next CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
ezzetabi Posted October 7, 2004 Posted October 7, 2004 (edited) Or ever funnier, adding some silence and randomize duration even more: While 1 kernel32_Beep(Random(37,32767),Int(Random(1,6))) If Int(Random(0,60)) = 0 Then Sleep(Int(Random(10,1001))) If Int(Random(0,600)) = 0 Then ExitLoop Wend Edited October 7, 2004 by ezzetabi
Konan--M Posted October 9, 2004 Posted October 9, 2004 Do you have to do something special to do a dllcall, cause i'm getting an error: "unknown Funktion Name (dllcall)"
piccaso Posted October 9, 2004 Author Posted October 9, 2004 use the latest unstable version of autoit CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Konan--M Posted October 10, 2004 Posted October 10, 2004 (edited) use the latest unstable version of autoit<{POST_SNAPBACK}>I got ver: AutoIt v. 3.0.102.0Do i need the AutoItX Beta, cause i think this is newest version and i still get the error ( from Syntax check..)ERROR: DllCall(): undefined function. $r = DllCall("kernel32.dll","long","Beep","long",$freq,"long",$duration) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >Exit code: 2 Time: 0.380 Edited October 10, 2004 by Konan--M
Digetal Posted October 17, 2005 Posted October 17, 2005 (edited) yeah unstable enough to use. You guys could always just use something else. This has got to best compiler for scripts I've ever found, anyone got anything different. Edited October 17, 2005 by Digetal
Mikon Posted October 17, 2005 Posted October 17, 2005 if you have to use latest beta anyways, what about using the "Beep" function implemented in AutoIt take a look at the helpfile and look for the funtion "Beep" syntax: Beep ( [ Frequency [, Duration ]] ) Mikon
layer Posted October 17, 2005 Posted October 17, 2005 (edited) Doesn't matter, my function (Beep, in the latest BETA) was recognized ! Edited October 17, 2005 by layer FootbaG
gamerman2360 Posted October 17, 2005 Posted October 17, 2005 (edited) Never hurts to look a old threads, usually I get old threads when I search Google... Then when I post w/o looking at the date everyone kinda does that "wth?" thing. Anyway. I've never seen Beep() b4. How do you add functions to Autoit? Is it hard? If I knew how I would make a way to have BlockInput() accept hotkeys. Edit: Beep() dosn't use the default keyword . Beep(default) does nothing and returns 1. Edited October 17, 2005 by gamerman2360
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now