Jump to content
Sign in to follow this  
virus4141

Please help a beginner with this

Recommended Posts

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 :(

Share this post


Link to post
Share on other sites

$test = msgbox(4,"test","test")

if $test = 6 then

msgbox(0,"test","the answer was yes")

;do some more stuff here

endif

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!")

Share this post


Link to post
Share on other sites

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 by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

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

Exit

In your code, even if your dad pressed "NO", the script would

do the MouseClick() as well as the second MsgBox()..

That would be a little bit strange, or what ?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...