Jump to content

msgbox yes/no 10 sec then no?


Recommended Posts

Switch MsgBox(4, "Title!", "Run it?", 10)
if Case 6 Then
Exit
EndIf
;Yes was pressed
if Case 7 Then
Exit
EndIf
;No was pressed
Case -1
;Timed out
EndSwitch

switch that to this:

Switch MsgBox(4, "Title!", "Run it?", 10)
Case 6 Then
Exit
EndIf
;Yes was pressed
Case 7 Then
Exit
EndIf
;No was pressed
Case -1
;Timed out
EndSwitch
You have a flaw in your code as well as the other code. It was said "how can i make a msgbox which asks for yes & no and if i click no , it does smth.. if nothing happens after 10 secs it will automatically press yes". So you need to just select the "Yes" which is 6 and write code for it but then you need to also allow for the timeout, the only way I know how to do that without writing two of the same thing would be to only allow the 7, "No" to exit the script and either the 6 or -1 for Timeout to proceed

Also your following the case statement with rements of the If which is incorrect all Case statement should be just worried about the statement on the switch, read the help file on Switch (do note that switch is the fastest because you could do it in a Select or If ElseIf Else statement

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Link to comment
Share on other sites

You have a flaw in your code as well as the other code. It was said "how can i make a msgbox which asks for yes & no and if i click no , it does smth.. if nothing happens after 10 secs it will automatically press yes". So you need to just select the "Yes" which is 6 and write code for it but then you need to also allow for the timeout, the only way I know how to do that without writing two of the same thing would be to only allow the 7, "No" to exit the script and either the 6 or -1 for Timeout to proceed

Also your following the case statement with rements of the If which is incorrect all Case statement should be just worried about the statement on the switch, read the help file on Switch (do note that switch is the fastest because you could do it in a Select or If ElseIf Else statement

There sure is. You don't use Then in a Case statement

Case 6 Then
should be
Case 6
The same applies to the others. Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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...