Sign in to follow this  
Followers 0
Macaronie

code error

7 posts in this topic

#1 ·  Posted (edited)

hello, i just downloaded AutoIT and been messing around with it, and i got a problem.

MsgBox(3, "v0.01", "Continue" [30, timeout] )

doesn't work. I am trying to make it close after 30 secs if you don't click continue.

thanks for your help.:graduated:

Edited by Macaronie

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

MsgBox(3, "v0.01", "Continue" ,30)

so there is no need to put [, timeout]

for example [30, timeout]?

also i got another issue. how can i make it possible that instead of closing after 9 secs it only closes when you click exit? heres the code

GUICreate("v 0.0.1", 1024, 800)

GUISetState(@SW_SHOW)

Sleep (900)

is there such thing as

Sleep(infinity)

or something? Edited by Macaronie

Share this post


Link to post
Share on other sites

Hi and Welcome to the forums!

The brackets mean the parameter is optional.

how can i make it possible that instead of closing after 9 secs it only closes when you click exit?

Open the helpfile and read "GUI Reference" to get the basics of creating and using a gui.

Share this post


Link to post
Share on other sites

Sleep(infinity)

Sure "Sleep(int(-2^69))", But why would you like to do something like that. :graduated:

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Hi and Welcome to the forums!

The brackets mean the parameter is optional.

Open the helpfile and read "GUI Reference" to get the basics of creating and using a gui.

yes, i did but now i get this error.

C:\Users\Antonio\biginner.au3 (21) : ==> Variable used without being declared.:

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = ^ ERROR

>Exit code: 1 Time: 1.121

here is my code

$var = MsgBox( 4, "v 0.1", "Start Game")

if $var = 6 Then GUICreate ( "SunShine" ,1240 ,800)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

GUIDelete()

EndFunc

Share this post


Link to post
Share on other sites

Add

#Include<GuiConstantsEx.au3>

to the top of your script.

For Constants, you always have to #include the *Constants.au3 file that contains the constant. You only have to include it once, preferably at the top of your script.


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

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  
Followers 0