Sign in to follow this  
Followers 0
timeisticking

simple open and run script

4 posts in this topic

I have a program that once a number in a textbox reaches zero needs to be closed then opened and initiated and run again.

The overall steps are when a timer starting at 60 in a textbox reaches zero the program stops.

My goal is to have the program run continuously, however i cannot change the amount of time the program runs each session therefore i need to close the program and reopen it to run a new session.

I want to run the program once then run a script that will keep it going continously.

I think my script is simpler this way because only one conditional is needed to keep it going rather than two if i were to use the script to open it for the first session.

To get the program to run it has to be opened. I haven't found a good function that can simply open up an executable yet. Once this program ("timer window") is opened it needs to just have one button pushed in its window, next a button pushed in another window that will stay open on its own, then a start button pused in the ("timer window") will start the program.

Then after the program ends it 60 mintues session i need to use an if statement that will read the textbox for the timer and then close and reopen the process.

Here is the script i have so far.

The only things i need help with are opening a executable.

and having autoit read the textbox from the window.

Opt("MouseCoordMode", 0)

While 1

If Playtextbox in timer window is = 0 Then

WinActivate("timerwindow", "") ; activate timer window executable

WinClose ("timerwindow" , ""); close timer window executable

????; open timer window executable

WinMove("timerwindow", "", 0, 0, 200, 200); move timer window so it is not interfering with other open window

MouseClick("left", 0, 500, 2); click initiate botton in timer window

MouseClick("left", 0, 500, 2); click on external window that always stays open and works with timer window to initiate relationship

MouseClick("left", 0, 500, 2); click start button in timer window

Endif

WEnd

I think a simple loop like this will keep checking to see if playtextbox is = 0 then close and reopen timer window.

I only need it to check everyminute or so though.

Share this post


Link to post
Share on other sites



While 1

WinActivate("timerwindow", "") ; activate timer window executable

WinClose ("timerwindow" , ""); close timer window executable

????; open timer window executable

WinMove("timerwindow", "", 0, 0, 200, 200); move timer window so it is not interfering with other open window

MouseClick("left", 0, 500, 2); click initiate botton in timer window

MouseClick("left", 0, 500, 2); click on external window that always stays open and works with timer window to initiate relationship

MouseClick("left", 0, 500, 2); click start button in timer window

Endif

WEnd

do 
$a=input(); or what your input method
until $a<>"0" 
;the rest code goes here

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

can someone tell me how to read the combo box of a window. The control is a textbox and i need to have my script read values of the non auto it window with a textbox in it.

Also how do you run an executable from the desktop throught a script?

Share this post


Link to post
Share on other sites

can someone tell me how to read the combo box of a window. The control is a textbox and i need to have my script read values of the non auto it window with a textbox in it.

Also how do you run an executable from the desktop throught a script?

Not sure if this is what you need or not, if you can get the co-ordinates of the window to serach and do the following.

the $result will not be = to 0 if the quoted text is found in the clipboard.

I found it somewhat tricky to figure out what the window co-ordinates are to read but once I did I can read almost any non window (text windows, terminal emulation products and such) window.

MouseClickDrag("Left",10,90,770,600,5)

Send("{LCTRL V}")

$READ = ClipGet()

$RESULT = StringInStr($READ , "whatever text you expect in the window")

Sleep(1000)

If $RESULT <> 0 Then

do whatever means text was found in string

endif

Hope this helps

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