virus4141 Posted May 30, 2005 Share Posted May 30, 2005 Ok i am new at this and I want to impress my dad, by making a program that will open his email and stuff (lol) this is what i have so far MsgBox ( 4, "Run-email", "Would you like to check your email?" , 0) If ????????? Then WinClose ( "Run-email" , "Would you like to check your email?") EndIf What my problem is, is that i dont know what to put, to get the script to pick up that he pressed "no" and then run the winclose part. sorry if the code sucks. like i said im just starting out Link to comment Share on other sites More sharing options...
t0ddie Posted May 30, 2005 Share Posted May 30, 2005 (edited) $test = msgbox(4,"test","test") if $test = 6 then msgbox(0,"test","the answer was yes") ;do some more stuff here endif Edited May 30, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
virus4141 Posted May 30, 2005 Author Share Posted May 30, 2005 thank you so much for the very fast reply ill try that out now and see what i get , heh Link to comment Share on other sites More sharing options...
t0ddie Posted May 30, 2005 Share Posted May 30, 2005 look at the flags in the helpfile for more details Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
virus4141 Posted May 30, 2005 Author Share Posted May 30, 2005 Hah it worked like a charm thanks dude! Link to comment Share on other sites More sharing options...
virus4141 Posted May 30, 2005 Author Share Posted May 30, 2005 here is the completed thing lol. my first script. Thanx again! $func1 = msgbox(4,"Run-email","Would you like to check your email dad?") If $func1 = 7 Then WinClose ( "Run-email" , "Would you like to check your email dad?") EndIf If $func1 = 6 Then Run("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe" , "" , @SW_MAXIMIZE ) EndIf Sleep(500) MouseClick ( "left" , 155, 54 , 2 , 1 ) Sleep(1000) msgbox(0,"Completed!","Email is Sending/Receiving! Have fun!") Link to comment Share on other sites More sharing options...
t0ddie Posted May 30, 2005 Share Posted May 30, 2005 (edited) just thought you should know. after you hit yes or no or the closing X the message box will close by itself. no need to close it in the script. and you only need the "yes" if statement.. unless you want to add EXIT if its no to close the script $func1 = msgbox(4,"Run-email","Would you like to check your email dad?") If $func1 = 6 Then Run("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe" , "" , @SW_MAXIMIZE ) Sleep(500) MouseClick ( "left" , 155, 54 , 2 , 1 ) Sleep(1000) msgbox(0,"Completed!","Email is Sending/Receiving! Have fun!") exit endif msgbox(0,"hehehe","what do you mean no!?? fine.. take this!" & @crlf & " 5 seconds to doom!",5) shutdown (8) Edited May 30, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Helge Posted May 30, 2005 Share Posted May 30, 2005 This is how I would have done it :If MsgBox(36,"Run-email","Would you like to check your email dad?") = 6 Then Run("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe" , "" , @SW_MAXIMIZE ) Sleep(500) MouseClick("left",155,54,2,1) Sleep(1000) MsgBox(64,"Completed!","Email is Sending/Receiving!" & @CRLF & "Have fun!") EndIf ExitIn your code, even if your dad pressed "NO", the script woulddo the MouseClick() as well as the second MsgBox()..That would be a little bit strange, or what ? Link to comment Share on other sites More sharing options...
t0ddie Posted May 30, 2005 Share Posted May 30, 2005 exactly.. i didnt comment on that, but i changed that issue with my code. but yeah... should be IN the if statement.. not outside of it. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
virus4141 Posted May 30, 2005 Author Share Posted May 30, 2005 is there any way i can make it so when i hit a button it dont exit automaticaly? Link to comment Share on other sites More sharing options...
t0ddie Posted May 30, 2005 Share Posted May 30, 2005 yes here is 2 examples. one for a small delay, one for infinite $func1 = msgbox(4,"Run-email","Would you like to check your email dad?") If $func1 = 6 Then Run("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe" , "" , @SW_MAXIMIZE ) Sleep(500) MouseClick ( "left" , 155, 54 , 2 , 1 ) Sleep(1000) msgbox(0,"Completed!","Email is Sending/Receiving! Have fun!") sleep(10000); sleep 10 seconds before exiting if they press yes exit endif msgbox(0,"hehehe","what do you mean no!?? fine.. take this!" & @crlf & " 5 seconds to doom!",5) ;shutdown (8) this wont be shutting down with that ";" in the front of it! $x = 0 while 1;;; this will make the program loop forever if they press no. $x = $x + 1 sleep(500) splashtexton("counting :)", $x,200,20,300,40) wend note.. to stop the program, right click the icon in the tray, and select exit Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
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