SRT Problem

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Carnivean
Newbie
Posts: 17
Joined: Fri Jun 10, 2011 8:04 am

SRT Problem

Post by Carnivean » Fri Sep 16, 2011 1:24 pm

Hi

I'm having problems with the following script. I call a SRT at the beginning of the script which works, the script then continues and a number of camera buttons are selected in this case for 30 seconds, at the end of the 30 seconds I again call the same SRT only this time it isn't found.

Does anybody have any ideas?

Code: Select all

VBStart
VBEND
GoSub>TaskManager
SRT>TaskManager
//Gets the list of processes for system status.exe from task manager and saves to a text file
SetFocus>Windows Task Manager
WaitWindowOpen>Windows Task Manager
WindowAction>1,Windows Task Manager
Wait>1
Send>system status.exe
SetFocus>Windows Task Manager
Wait>1
GetTextInRect>24,89,600,465,Taskmanager
TimeStamp>C:\Documents and Settings\Administrator\Desktop\Script Logging\Camera Test.txt,%Taskmanager%
Wait>0.5
//CloseWindow>Windows Task Manager
WindowAction>2,Windows Task Manager
End>TaskManager

VBEval>Timer,StartTime

Repeat>ElapsedTime
Random>9,rand
If>rand=0
    Add>rand,1
Endif
Wait>3
PushButton>LCS,Camera %rand%
Wait>2
VBEval>Timer-%StartTime%,ElapsedTime

Until>ElapsedTime>30
GoSub>TaskManager
MessageModal>End Test

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Sep 16, 2011 8:13 pm

My guess is you've created a variable that has the same name as your subroutine. Try renaming the variable "Taskmanager". Use, for example "Task_manager" instead.

Let us know if that helps.

Carnivean
Newbie
Posts: 17
Joined: Fri Jun 10, 2011 8:04 am

Post by Carnivean » Mon Sep 19, 2011 6:34 am

Thanks JRL

I changed the GoSub & SRT to Task_Manager and everything works now.

Cheers

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts