Jump to content

Block Buttonclicks Till Soundplay("file.wav",1)


Recommended Posts

hi folks...

SORRY.. The Threadheader must be "Block Buttonclicks ""DURING"" Soundplay("file.wav",1)".. but i dont can change it anymore...

..i got a new prob... and no idea how i can easy clear that.. maybe u can give a helpin mind...

prob:

i play different .wav files in my script.. its a speakin voice, so if there are different words or phrases i use flag 1 that the next .wav dont kill the curent.. somethng like this:

soundplay("a.wav",1)

soundplay("b.wav",1)

soundplay("c.wav",0)

..the problem is, during the script plays (for Example) "a.wav", i can click buttons on my gui and the script execute this button function after playin "c.wav"... Thats the problem..

It should work that the user clicks "1" time on "1" button.. and the script execute the function of this "1" button after playin "c.wav"... In my case the script collects all clicks and after playin "c.wav" it executes "ALL" clicks... Thats shit...

ive tried to work with _IsPressed but it cant solve my prob cause i need to block the mouseclicks DURING the sound plays and pauses the script.. :)

..the only solution i found was BlockInput like this:

BlockInput (1)

soundplay("a.wav",1)

soundplay("b.wav",1)

soundplay("c.wav",0)

BlockInput (0)

..or hold mouse in a mousetrap during soundplay... but this looks like trash too for me, because i dont want to get a fixed mousecursor durin soundplay... so is there a chance to block the buttons (not with DISABLE or HIDE.. geyout buttons look like shit and buttons must be visible..) or block more than 1 mouseclick (or all mouseclicks) on the buttons during soundplay?...

Thanks for input....

Edited by duketrapp
Link to comment
Share on other sites

Hi,

what about Soundplay( ..., 0) script goes on and then build a loop where _ispreesed() left mouse and right mouse is goning to do nothing. after a specific time, the loop breaks and the script goes on.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

?.. u didnt read that i use different sounds?...

i need flag 1 for all sounds exep the last..like this:

soundplay("a.wav",1)

soundplay("b.wav",1)

soundplay("c.wav",0)

..If u use all flags 0 than only the last sound will be played.. :)

so long..

HI,

I don't think so. Because the next sound will start, when the _isPressed() loop breaks. :(

That's why I thought you could use ,0 at every sound.

It is not a very smooth solution, but it should work. Give it a try. All you have to do is putting a loop between the sounds in which _isPressed() avoids clicking.

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Because the next sound will start, when the _isPressed() loop breaks. :)

...putting a loop between the sounds in which _isPressed() avoids clicking.

..hm... but the sounds have different length values and i dont can get the length cause they r importet automatic by the script... so how i can tell the _isPressed() loop to stop exactly when the soundfile before ends, and play the next file? :D

i dont know any function that can check the lenght of an .wav file in autoit... :(

so long

...maybe somethng like this would work?:

Do

; _isPressed() function

Until soundplay("a.wav",1)

Edited by duketrapp
Link to comment
Share on other sites

WinSetState ( "title", "text", flag )

..its a simple way.. just what im searchin for.. :) .. BUT.. 1 button click should be possible for the user :( ... but its a good hint ... maybe i can use this in a different way...

..btw.. if u use the WinSetState solution u get an error beep when u try to click the window... is there a way to kill this sound?.. (not wave volume = 0 ... i need to hear the text wav... :D )..

Edited by duketrapp
Link to comment
Share on other sites

maybe you could create an invisable gui to overlay your GUI... no buttons and no sound if clicked on

8)

That sounds like the best idea. A transparent GUI overlayed to block user interaction.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

That sounds like the best idea. A transparent GUI overlayed to block user interaction.

..y.. i thought about somethng like that .. but... still the same problem..like the solution with the DISABLED gui... 1 click on 1button = impossible... :)

... maybe i dont need the 1 click user interaction during soundplay.... ...until someone got another small simple good solution.. :(

..thks for ur help til now..

Edited by duketrapp
Link to comment
Share on other sites

8)

Valuater ur da man.. :)

BUT.. :( ive changed just 1 line in ur code for a better result :D

in ur script:

$SAFE = GUICreate('')
GUISetState( $WS_EX_TRANSPARENT, $SAFE)
$VAULT = GUICreate(" *VAULTER*", @DesktopWidth, @DesktopHeight, -1, -1, -1, -1, $SAFE)
GUISetState()
ToolTip("Protected by,   *VAULTER*   v" & $VER, 5, 5)
WinSetOnTop(" *VAULTER*", "", 1)
WinSetTrans(" *VAULTER*", "", 1)

..this result is near perfect cause it blocks all input like we all wish :( ..but when u look exactly u can see a millisecond of the trans window when its created.. when u change it to this:

$SAFE = GUICreate('')
GUISetState( $WS_EX_TRANSPARENT, $SAFE)
$VAULT = GUICreate(" *VAULTER*", @DesktopWidth, @DesktopHeight, -1, -1, -1, -1, $SAFE)
ToolTip("Protected by,   *VAULTER*   v" & $VER, 5, 5)
WinSetOnTop(" *VAULTER*", "", 1)
WinSetTrans(" *VAULTER*", "", 1)
GUISetState()                                ; <----just set this at the end and works perfect

..u see nothng when the trans window is created :oops:

so .. thanks a lot.. this works realy perfect for me ... i just put this code in my soundplay function and it work awsome... :bike: .. thnks again.. and thnks to all other users too for brainstorming...

for all who are interested in "USER INPUT BLOCKED SOUNDPLAY" here is the workin code for the sound funktion:

Func playwav($val,$duration)

$winpos = WinGetPos ( $scriptname );<- $scriptname is  ur main gui
$SAFE = GUICreate('')
GUISetState( $WS_EX_TRANSPARENT, $SAFE)
$VAULT = GUICreate("avoider", $winpos[2], $winpos[3], $winpos[0], $winpos[1], -1, -1, $SAFE)
WinSetOnTop("avoider", "", 1)
WinSetTrans("avoider", "", 1)
GUISetState()
    
SoundPlay ( $wavsspath & $val & ".wav", $duration)
    
GUIDelete($VAULT)
GUIDelete($SAFE)
    
Return
EndFunc
Edited by duketrapp
Link to comment
Share on other sites

yeeha...

but.. :) .. i tested a bit now.. it runs fine but i noticed that when i hammer a sequence of near 10 clicks on the blocking trans window, sometimes i see ~10 milliseconds a non trans window with the phrase "no reply" in the header ( the message u get in window title when a program is freezed).. than after the milliseconds all runs normal and nothng to see...

i dont know if its an error by the blocking script or a general overflow on input when u clicking verrrry fast on an window when a wav plays... but.. i dont thnk that someone will give the script clicks in that speed and duration when hes not stoned :(

..or maybe someone knows why this happends...

salute...

Edited by duketrapp
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...