Problem with Funtion

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Problem with Funtion

Post by Aaron » Wed Apr 18, 2007 6:43 pm

I ran the Debugger up to this point:

Let>EvalMousePos={IF>(((%X% >= %t1%) AND (%X% = %t2%) AND (%Y% Within Bounds,MessageModal>Out of bounds)}

Can you let me know what is wrong, and better yet how to get a better idea of where to look within the problem area?

Thanks again.

Code: Select all

let>X1[1]=0
let>X1[2]=601
let>X1[3]=0
let>X1[4]=601

let>Y1[1]=0
let>Y1[2]=0
let>Y1[3]=0
let>Y1[4]=0

let>X2[1]=562
let>X2[2]=1024
let>X2[3]=562
let>X2[4]=1024

let>Y2[1]=768
let>Y2[2]=768
let>Y2[3]=768
let>Y2[4]=768

SRT>Start

 GetCursorPos>X,Y

let>i=0

let>i=i+1
if>i>4,finish
Let>t1=X1[%i%]
Let>t2=Y1[%i%]
Let>t3=X2[%i%]
Let>t4=Y2[%i%]
Goto>GotoTheFuntion
End>Start
  Goto>MainLoop
Label>GotoTheFuntion
Let>EvalMousePos={IF>(((%X% >= %t1%) AND (%X% <t3>= %t2%) AND (%Y% <t4>Within Bounds,MessageModal>Out of bounds)}

  Label>MainLoop
OnEvent>KEY_DOWN,VK1,0,Start

   Wait>0.2
  Goto>MainLoop

Aaron

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Not Posting correctly

Post by Aaron » Wed Apr 18, 2007 6:55 pm

Not Posting correctly

I will explain with word in case it dose not Posting correctly again




X is Greater than or Equal to t1 AND X is Less than or Equal to t3 AND Y is Greater than or Equal to t2 AND Y Less than or Equal to t4

Code: Select all

(((%X% >= %t1%) AND (%X% <t3>= %t2%) AND (%Y% <= %t4%))
I would appreciate the help, Thanks
Aaron

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Apr 18, 2007 7:11 pm

Code: Select all

(((%X% >= %t1%) AND (%X% <t3>= %t2%) AND (%Y% <= %t4%)) 
has mismatched "(" and missing condition

1. Disable HTML for your posting.
2. I think this will work, (untested)

Code: Select all

{(%X%>=%t1%)AND(%X%<=%t3%)AND(%Y%>=%t2%)AND(%Y%<=%t4%)}
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Still dose not work

Post by Aaron » Wed Apr 18, 2007 8:37 pm

Thanks for the help bob, My post has the code showing correctly now, maybe you can see the problem.

Still wont work. If you would, could I get you to paiste the code into Macro Scheduler and see if you could find the problem. Ive been stumped now for quite a while.

Thanks


Code: Select all

let>X1[1]=0
let>X1[2]=601
let>X1[3]=0
let>X1[4]=601

let>Y1[1]=0
let>Y1[2]=0
let>Y1[3]=0
let>Y1[4]=0

let>X2[1]=562
let>X2[2]=1024
let>X2[3]=562
let>X2[4]=1024

let>Y2[1]=768
let>Y2[2]=768
let>Y2[3]=768
let>Y2[4]=768

SRT>Start

 GetCursorPos>X,Y

let>i=0

let>i=i+1
if>i>4,finish
Let>t1=X1[%i%]
Let>t2=Y1[%i%]
Let>t3=X2[%i%]
Let>t4=Y2[%i%]
Goto>tryhere
End>Start
  Goto>MainLoop
Label>tryhere
Let>EvalMousePos={if((%X%>=%t1%)AND(%X%<=%t3%)AND(%Y%>=%t2%)AND(%Y%<=%t4%)),True,False}

  Label>MainLoop
OnEvent>KEY_DOWN,VK1,0,Start

   Wait>0.2
  Goto>MainLoop

SRT>True
  MessageModal>Within Bounds
End>True

SRT>False
  MessageModal>Out of bounds
End>False

Aaron

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

Post by JRL » Wed Apr 18, 2007 8:48 pm

Try this:

Code: Select all

let>X1[1]=0
let>X1[2]=601
let>X1[3]=0
let>X1[4]=601

let>Y1[1]=0
let>Y1[2]=0
let>Y1[3]=0
let>Y1[4]=0

let>X2[1]=562
let>X2[2]=1024
let>X2[3]=562
let>X2[4]=1024

let>Y2[1]=768
let>Y2[2]=768
let>Y2[3]=768
let>Y2[4]=768

SRT>Start

 GetCursorPos>X,Y

let>i=0

let>i=i+1
if>i>4,finish
Let>t1=X1[%i%]
Let>t2=Y1[%i%]
Let>t3=X2[%i%]
Let>t4=Y2[%i%]
Goto>tryhere
End>Start
  Goto>MainLoop
Label>tryhere
if>{((%X%>=%t1%)AND(%X%<=%t3%)AND(%Y%>=%t2%)AND(%Y%<=%t4%))},True,False

  Label>MainLoop
OnEvent>KEY_DOWN,VK1,0,Start

   Wait>0.2
  Goto>MainLoop

SRT>True
  MessageModal>Within Bounds
End>True

SRT>False
  MessageModal>Out of bounds
End>False

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Thank You, Works great

Post by Aaron » Wed Apr 18, 2007 9:11 pm

Thank you JRL, it works great,

After your fix I just needed to move the let>i=0 out of the SRT>Start.
Now it runs perfect.

Can someone tell me what language this is in so that I could do some more reading on the syntax and structure.
It looks like visual basics.
It would be great to find more samples.
The help file is nice but when I go back looking for something I read, Its sometime very difficult to find the answer.
An example would be if you wanted to find operators, it appears that they are not listed in the help topics.
You need to dig sometime pretty deep to find the answers.
Anyway Just wondering if there are some other sources available to help me pick this up quicker.

Thanks
Aaron

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Apr 18, 2007 11:47 pm

The language and syntax is unique to Macro Scheduler.

The Help file has plenty of good examples for every function.
This forum is full of examples of what can be done and how to do it. See the section on Scripts and Tips.

The Support Page, http://www.mjtnet.com/support.htm has many links, including samples of vbScript, Marcus' blog, Users manual, beginner's tutorial.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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