WipeoutFTW Posted August 20, 2006 Share Posted August 20, 2006 Hey guys, Im trying to give a small input box some function. I want to take an input and make it used as a variable. Also how can I make it so the window stays until I press the "Publish" button? Here is what I have so far: #include <GUIConstants.au3> GUICreate("Publishlisher", 200, 100) GUICtrlCreateLabel("Publish how many?", 30, 10) GUICtrlCreateInput("10", 30, 50, 60);I want this to be <Variable> GUICtrlCreateButton("Publish", 100, 47, 60) GUISetState(@SW_SHOW) Sleep(5000) For $i = <Variable> to 1 Step -1 MouseClick("left", 343, 616, 2); Link to the publish page Sleep(3000);three seconds MouseClick("left", 55, 307, 2);Publish Button Sleep(3000);three seconds MouseClick("left", 1260, 12, 2);Close Window Sleep(250);1/4 a second MouseClick("left", 1236, 406, 2);Next Button Sleep(3000);three seconds Next MsgBox(0,"", "Published!") Thanks a lot guys. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 20, 2006 Share Posted August 20, 2006 (edited) Hey guys, Im trying to give a small input box some function. I want to take an input and make it used as a variable. Also how can I make it so the window stays until I press the "Publish" button? Here is what I have so far: #include <GUIConstants.au3> GUICreate("Publishlisher", 200, 100) GUICtrlCreateLabel("Publish how many?", 30, 10)[autoit] GUICtrlCreateInput("10", 30, 50, 60);I want this to be <Variable> GUICtrlCreateButton("Publish", 100, 47, 60) GUISetState(@SW_SHOW) Sleep(5000) For $i = <Variable> to 1 Step -1 MouseClick("left", 343, 616, 2); Link to the publish page Sleep(3000);three seconds MouseClick("left", 55, 307, 2);Publish Button Sleep(3000);three seconds MouseClick("left", 1260, 12, 2);Close Window Sleep(250);1/4 a second MouseClick("left", 1236, 406, 2);Next Button Sleep(3000);three seconds Next MsgBox(0,"", "Published!") Thanks a lot guys. On the GUI: Your input and button each have a control ID number, generated when they were created. You should have saved those control IDs as variables: #include <GUIConstants.au3> $hMainGUI = GUICreate("Publishlisher", 200, 100) ; save handle to GUI $Label_1 = GUICtrlCreateLabel("Publish how many?", 30, 10) ; save control ID of label (in case you want to change it later) $Label_1 = GUICtrlCreateInput("10", 30, 50, 60) ; save control ID of input (for reading it later) $Button_1 = GUICtrlCreateButton("Publish", 100, 47, 60) ; save control ID of button (to see if it's pushed) GUISetState(@SW_SHOW)oÝ÷ Øéíéh¢hÃ*.q©æjGZ¥zZ(¦ØZ¶°eë,j¬¶z'íæî¶Ú'Ên²¢»axeÁ«u«¢+Ù]¡¥±Ä(ÀÌØí5ÍôÕ¥Ñ5Í ¤(MÝ¥Ñ ÀÌØí5Í( ÍÀÌØíU%}Y9Q} 1=M(á¥Ñ1½½Àìá¥Ð±½½À¥U$Ṉ̃½Í(( ÍÀÌØí ÕÑѽ¹|Ä(ÀÌØí%¹ÁÕÑÑôÕ¥ ÑɱI ÀÌØí%¹ÁÕÑ|ĤìÉÑ¡¥¹ÁÕн¹Ñɽ°(5Í ½à ØаÅÕ½ÐíQÍÐÅÕ½Ðì°ÅÕ½Ðí ÕÉɹÐ%¹ÁÕн¹Ñ¹ÑÌèÅÕ½ÐìµÀìÀÌØí%¹ÁÕÑѤì¥ÍÁ±äÉÍÕ±Ð(á¥Ñ1½½Àìá¥Ð±½½ÀÝ¡¸½¹(( ͱÍ(M±À ÄÀÀ¤ì±äѼÀ ATÕͽݸ(¹MÝ¥Ñ )]¹ Of course you can change the contents of the While loop to do whatever you need done when the button gets pressed. Hope that helps. Edited August 20, 2006 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 More sharing options...
WipeoutFTW Posted August 20, 2006 Author Share Posted August 20, 2006 Ok thank you so much, Also, when it is doing the For loop, is there a way to make a window on top that displays how many more time the loop will execute and the time left? Thanks a lot. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 21, 2006 Share Posted August 21, 2006 Ok thank you so much, Also, when it is doing the For loop, is there a way to make a window on top that displays how many more time the loop will execute and the time left? Thanks a lot. For $t = 10 To 1 Step -1 SplashTextOn("Timer", "You have " & $t & " seconds left to panic!") Sleep(1000) Next MsgBox(16, "Timer", "PANIC!") 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 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