Jump to content

trouble with making the buttons do something


Recommended Posts

here is this script I'm working on, it's supposed to run in the background, but when a msgbox pops up and I click on the ok button, I want the clicking of that ok to end the script

here is the coding

CODE
While 1

; test

If @MON=04 And @MDAY=17 And @HOUR=06 And @MIN=27 And @Sec=35 Then MsgBox(262144, "Reminder", "This popup is working", 1)

Sleep(400)

WEnd

I have tried everything I can think of, adding a second then after the msg saying then exit doesn't work, have also tried some other things, so if anyone can help I will be grateful

Link to comment
Share on other sites

Use the Exit or ExitLoop keyword or do some checking at beginning of the while loop :D

; Example 1
While 1
; test
If @MON=04 And @MDAY=17 And @HOUR=06 And @MIN=27 And @Sec=35 Then
MsgBox(262144, "Reminder", "This popup is working", 1)
Exit
EndIf
Sleep(400)
WEndoÝ÷ Ù«­¢+ØìáµÁ±È)]¡¥±Ä(ìÑÍÐ)%5=8ôÀй5dôÄܹ!=UHôÀع5%8ôÈܹMôÌÔQ¡¸)5Í  ½à ÈØÈÄÐаÅÕ½ÐíIµ¥¹ÈÅÕ½Ðì°ÅÕ½ÐíQ¡¥ÌÁ½ÁÕÀ¥Ìݽɭ¥¹ÅÕ½Ðì°Ä¤)á¥Ñ1½½À)¹%)M±À ÐÀÀ¤)]¹oÝ÷ Ù«­¢+ØìáµÁ±Ì(ÀÌØí½½°õ±Í)]¡¥±9½ÐÀÌØí½½°(ìÑÍÐ)%5=8ôÀй5dôÄܹ!=UHôÀع5%8ôÈܹMôÌÔQ¡¸)5Í  ½à ÈØÈÄÐаÅÕ½ÐíIµ¥¹ÈÅÕ½Ðì°ÅÕ½ÐíQ¡¥ÌÁ½ÁÕÀ¥Ìݽɭ¥¹ÅÕ½Ðì°Ä¤(ÀÌØí½½°õQÉÕ)¹%)M±À ÐÀÀ¤)]¹

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

legend :D so simple and yet never occured to me

well I did put then exit under it, but not exit just byitself, anyway, cheers

Just for giggles, you can make that conditional on which button gets clicked by checking the numeric return value from MsgBox():

While 1
    If @MON = 04 And @MDAY = 17 And @HOUR = 06 And @MIN = 27 And @SEC = 35 Then
        If MsgBox(32 + 4, Default, "Do you want to exit?") = 6 Then Exit
    EndIf
    Sleep(400)
WEnd

:D

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...