saio Posted June 26, 2012 Posted June 26, 2012 I wann'a play a sound on Yes clicked msgbox MsgBox(4100, "1", "gagaha") that gives yes or no and I wanna make it play a sound what shud I do ? maybe some examples????
JohnOne Posted June 26, 2012 Posted June 26, 2012 (edited) Get the return from your msgbox and conditionally use SoundPlay() Edited June 26, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators Melba23 Posted June 26, 2012 Moderators Posted June 26, 2012 saio,maybe some examplesMaybe some work on your part? Look at the MsgBox function in the Help file - you wil see that the return value varies according to the pressed button. So a simple Switch structure should be all you require - plus a SoundPlay of course. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
saio Posted June 26, 2012 Author Posted June 26, 2012 (edited) saio,Maybe some work on your part? Look at the MsgBox function in the Help file - you wil see that the return value varies according to the pressed button. So a simple Switch structure should be all you require - plus a SoundPlay of course. M23man that's all I have come up whit till nowvalue varies ????? what you meen exactlythe help file is a little messed up ..... Edited June 26, 2012 by saio
iamtheky Posted June 26, 2012 Posted June 26, 2012 (edited) the help file is a little messed up .....yeah its not your search skills at allthat and the big section in the help file under 'Return Value' Edited June 26, 2012 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
somdcomputerguy Posted June 26, 2012 Posted June 26, 2012 value varies ????? what you meen exactly Run this, press yes, run it again, press no. See the varying of the returned value? ConsoleWrite(MsgBox(4100, "1", "gagaha") & @LF) the help file is a little messed up ..... - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted June 26, 2012 Posted June 26, 2012 man that's all I have come up whit till nowvalue varies ????? what you meen exactlythe help file is a little messed up .....Ridiculous post. Robjong 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
saio Posted June 26, 2012 Author Posted June 26, 2012 am ok i feel stupid now .... but i have another question if the anser is no i need it to go to the question ask again...
somdcomputerguy Posted June 26, 2012 Posted June 26, 2012 Do...Until - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Venix Posted June 26, 2012 Posted June 26, 2012 (edited) If your still having trouble try this but you have been given more than enough information. Do ; Do until question returns yes. $Question = MsgBox(4, "Music", "Would You Like To Play The Sound?") ; Display a yes/no message. If $Question = 6 Then ; If Question returns 6 then play the sound. SoundPlay(@WindowsDir & "mediatada.wav", 1) EndIf Until $Question = 6 ;This process will repeat forcing the user to press yes, pointless but its what you asked for. Edited June 26, 2012 by Venix
saio Posted June 26, 2012 Author Posted June 26, 2012 If your still having trouble try this but you have been given more than enough information. Do ; Do until question returns yes. $Question = MsgBox(4, "Music", "Would You Like To Play The Sound?") ; Display a yes/no message. If $Question = 6 Then ; If Question returns 6 then play the sound. SoundPlay(@WindowsDir & "mediatada.wav", 1) EndIf Until $Question = 6 ;This process will repeat forcing the user to press yes, pointless but its what you asked for. 10x that worked Perfectly for me!
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