Muchuchu Posted December 25, 2007 Share Posted December 25, 2007 Alright, I have a program all scripted, and all i need is an interface with a start and stop button. When you hit the start it starts the script, and when you hit the stop it with end the script but keep the interface up as well. Maybe someone can help me out with where to start? I even have downloaded Koda's GUI program, but don't know how to implement it inmto my script very well. Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 Show us your code?????? FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
Muchuchu Posted December 25, 2007 Author Share Posted December 25, 2007 (edited) I got the GUI Password checker from Paulie. Edit- Also, are you a member of Triad? #include <GUIConstants.au3> hotkeyset("{BS}","quit") $Password = "blank101" Do $pass = InputBox("Password Required", "Please Input Your Password.", "", "*") If $pass == $Password Then MsgBox(0,"Correct", "Password Correct.") Else MsgBox(0,"Invalid", "Password Invalid. Try Again.") EndIf Until $Pass == $Password $i = 0 Dim $arr[2][1000] do msgbox(0 , "ChickenKiller" , "Click Ok to start the program") $i = $i + 1 Until $i = 1 do do sleep("3000") $coord = PixelSearch( 0, 0, 1279, 1023, 0x7B190F);cuts trees if @ERROR Then PixelSearch( 0, 0, 1279, 1023, 0x7B190F) endif until Not @ERROR $i = 1 if NOT @error then $arr[0][$i] = $coord[0] $arr[1][$i] = $coord[1] endif $i = 1 sleep("3000") MouseMove( $coord[0] , $coord[1]) sleep("700") mousedown("left") sleep("400") mouseup("left") sleep("8000") $i = $i + 1 Until $i = 1 $GUI =GUICreate("Your Program window", 200,300) GUICtrlCreateLabel("Press the X to Close", 50,135) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE $pass = InputBox("Password Required", "Please Input Your Password.", "", "*") If $pass = $Password Then MsgBox(0,"Correct", "Password Correct. Exiting...") Exit Else MsgBox(0,"Invalid", "Password Invalid. Continuing...") EndIf EndSwitch WEnd func quit() exit endfunc Edited December 25, 2007 by Muchuchu Link to comment Share on other sites More sharing options...
Zedna Posted December 25, 2007 Share Posted December 25, 2007 (edited) Look here for idea Edited December 25, 2007 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 First... Koda helps you build GUI's... then you have to do the logic. Second... "When you hit the start it starts the script"... exactly what part are you talking about? Is it this part? do do sleep("3000") $coord = PixelSearch( 0, 0, 1279, 1023, 0x7B190F);cuts trees if @ERROR Then PixelSearch( 0, 0, 1279, 1023, 0x7B190F) endif until Not @ERROR $i = 1 if NOT @error then $arr[0][$i] = $coord[0] $arr[1][$i] = $coord[1] endif $i = 1 sleep("3000") MouseMove( $coord[0] , $coord[1]) sleep("700") mousedown("left") sleep("400") mouseup("left") sleep("8000") $i = $i + 1 Until $i = 1 I think Zedna's suggestion might help (was posted while typing). And, yes... I am part of Triad. Why do you ask? FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
Muchuchu Posted December 25, 2007 Author Share Posted December 25, 2007 The artwork you guys created are amazing, I particularly like this piecehttp://www.triad-art.com/thumbs/y05_source_triptych_left.jpgBack on topic Yes that is what I want that script to run once start is pressed. I have the GUI set up but am having trouble with the logic. I tried using an if...then statement but it isn't working. Also, with the GUI, I want to make it so that if they press the "x" on the GUI with the start stop buttons, that it exits out, how do you tell it to do that? Thanks. Link to comment Share on other sites More sharing options...
dandymcgee Posted December 25, 2007 Share Posted December 25, 2007 (edited) Alright, as far as I can tell, you already have a GUI and I'm not sure what else you want to add. I did remove some of the redundant loops, and double error checking, so that it is slightly easier to read and understand. Let me know if there is something specific you need help with. expandcollapse popup#include <GUIConstants.au3> hotkeyset("{BS}","quit") $Password = "blank101" Do $pass = InputBox("Password Required", "Please Input Your Password.", "", "*") If $pass = $Password Then MsgBox(0,"Correct", "Password Correct.") Else MsgBox(0,"Invalid", "Password Invalid. Try Again.") EndIf Until $Pass = $Password Dim $arr[2][1000] msgbox(0 , "ChickenKiller" , "Click Ok to start the program") do sleep("3000") $coord = PixelSearch( 0, 0, 1279, 1023, 0x7B190F);cuts trees if @ERROR Then PixelSearch( 0, 0, 1279, 1023, 0x7B190F) endif until Not @ERROR $arr[0][$i] = $coord[0] $arr[1][$i] = $coord[1] sleep("3000") MouseMove( $coord[0] , $coord[1]) sleep("700") mousedown("left") sleep("400") mouseup("left") sleep("8000") $GUI = GUICreate("Your Program window", 200,300) GUICtrlCreateLabel("Press the X to Close", 50,135) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE $pass = InputBox("Password Required", "Please Input Your Password.", "", "*") If $pass = $Password Then MsgBox(0,"Correct", "Password Correct. Exiting...") Exit Else MsgBox(0,"Invalid", "Password Invalid. Continuing...") EndIf EndSwitch WEnd func quit() exit endfunc Edited December 25, 2007 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
The Ape Posted December 25, 2007 Share Posted December 25, 2007 If you can't implement Zedna's suggestions, I think you should try using Hotkeys. Look here for example.Also, thanks for the compliment.You should remove the link to that image... it will not work. Thanks anyway. FixJaw.comTriad-Art.com 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