Image Recognition Library

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Sun Nov 05, 2006 9:39 pm

Just to clarify to everyone imgs_6 and imgs_7 are the values returned from the FindImgPos function.

guyash, use this code and run it again. Post the code, post the log.

iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
LibLoad>imglibDll,imglib
else>
mdl>the imglib.dll does not exist in this folder
goto>End
endif>
let>xpos=0
let>ypos=0
IfFileExists>d:\screen.bmp
DeleteFile>d:\screen.bmp
EndIf
ScreenCapture>0,0,1024,768,d:\screen.bmp
ife>d:\s.bmp

LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
If>imgs>0
Let>xpos=%imgs_5%+%xpos%
Let>ypos=%imgs_6%+%ypos%
MouseMove>%xpos%,%ypos%
LClick
Endif
else>
mdl>the file s.bmp not found
endif>

Label>End

guyash2
Junior Coder
Posts: 40
Joined: Thu May 05, 2005 2:45 pm

It works!!!

Post by guyash2 » Mon Nov 06, 2006 10:36 am

Thank you!! It finally works!!
Here is the code:

Code: Select all

iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
LibLoad>imglibDll,imglib
else>
mdl>the imglib.dll does not exist in this folder
goto>End
endif>
let>xpos=0
let>ypos=0
IfFileExists>d:\screen.bmp
DeleteFile>d:\screen.bmp
EndIf
ScreenCapture>0,0,1024,768,d:\screen.bmp
ife>d:\s.bmp

LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
If>imgs>0
Let>xpos=%imgs_5%+%xpos%
Let>ypos=%imgs_6%+%ypos%
MouseMove>%xpos%,%ypos%
Endif
else>
mdl>the file s.bmp not found
endif>

Label>End

Here is the log file:

Code: Select all

06/11/2006 12:14:27:812 - Started Macro : dsdf
06/11/2006 12:14:27:812 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:27:812 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:27:812 - LibLoad>imglibDll,imglib
06/11/2006 12:14:27:812 - else>
06/11/2006 12:14:27:828 - let>xpos=0
06/11/2006 12:14:27:828 - let>ypos=0
06/11/2006 12:14:27:828 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:27:828 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:27:828 - EndIf
06/11/2006 12:14:27:828 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:27:968 - ife>d:\s.bmp
06/11/2006 12:14:27:968 - 
06/11/2006 12:14:27:968 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:28:140 - If>imgs>0
06/11/2006 12:14:28:140 - Let>xpos=525+0
06/11/2006 12:14:28:140 - Let>ypos=353+0
06/11/2006 12:14:28:140 - MouseMove>525,353
06/11/2006 12:14:28:140 - Endif
06/11/2006 12:14:28:140 - else>
06/11/2006 12:14:28:140 - 
06/11/2006 12:14:28:140 - Label>End
06/11/2006 12:14:28:140 - Finished Macro : dsdf
06/11/2006 12:14:30:609 - Started Macro : dsdf
06/11/2006 12:14:30:609 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:30:609 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:30:609 - LibLoad>imglibDll,imglib
06/11/2006 12:14:30:609 - else>
06/11/2006 12:14:30:609 - let>xpos=0
06/11/2006 12:14:30:609 - let>ypos=0
06/11/2006 12:14:30:609 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:30:609 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:30:625 - EndIf
06/11/2006 12:14:30:625 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:30:781 - ife>d:\s.bmp
06/11/2006 12:14:30:781 - 
06/11/2006 12:14:30:781 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:30:953 - If>imgs>0
06/11/2006 12:14:30:953 - Let>xpos=525+0
06/11/2006 12:14:30:953 - Let>ypos=353+0
06/11/2006 12:14:30:953 - MouseMove>525,353
06/11/2006 12:14:30:953 - Endif
06/11/2006 12:14:30:953 - else>
06/11/2006 12:14:30:953 - 
06/11/2006 12:14:30:953 - Label>End
06/11/2006 12:14:30:953 - Finished Macro : dsdf
06/11/2006 12:14:39:015 - Started Macro : dsdf
06/11/2006 12:14:39:015 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:39:015 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:39:015 - LibLoad>imglibDll,imglib
06/11/2006 12:14:39:015 - else>
06/11/2006 12:14:39:015 - let>xpos=0
06/11/2006 12:14:39:015 - let>ypos=0
06/11/2006 12:14:39:015 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:39:015 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:39:015 - EndIf
06/11/2006 12:14:39:015 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:39:140 - ife>d:\s.bmp
06/11/2006 12:14:39:140 - 
06/11/2006 12:14:39:156 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:39:328 - If>imgs>0
06/11/2006 12:14:39:328 - Let>xpos=525+0
06/11/2006 12:14:39:328 - Let>ypos=353+0
06/11/2006 12:14:39:328 - MouseMove>525,353
06/11/2006 12:14:39:328 - Endif
06/11/2006 12:14:39:328 - else>
06/11/2006 12:14:39:328 - 
06/11/2006 12:14:39:328 - Label>End
06/11/2006 12:14:39:343 - Finished Macro : dsdf
06/11/2006 12:14:40:765 - Started Macro : dsdf
06/11/2006 12:14:40:765 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:40:765 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:40:765 - LibLoad>imglibDll,imglib
06/11/2006 12:14:40:765 - else>
06/11/2006 12:14:40:765 - let>xpos=0
06/11/2006 12:14:40:765 - let>ypos=0
06/11/2006 12:14:40:765 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:40:765 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:40:765 - EndIf
06/11/2006 12:14:40:765 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:40:906 - ife>d:\s.bmp
06/11/2006 12:14:40:906 - 
06/11/2006 12:14:40:906 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:41:093 - If>imgs>0
06/11/2006 12:14:41:093 - Let>xpos=525+0
06/11/2006 12:14:41:093 - Let>ypos=353+0
06/11/2006 12:14:41:109 - MouseMove>525,353
06/11/2006 12:14:41:109 - Endif
06/11/2006 12:14:41:109 - else>
06/11/2006 12:14:41:109 - 
06/11/2006 12:14:41:109 - Label>End
06/11/2006 12:14:41:109 - Finished Macro : dsdf
06/11/2006 12:14:42:015 - Started Macro : dsdf
06/11/2006 12:14:42:015 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:42:015 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:42:015 - LibLoad>imglibDll,imglib
06/11/2006 12:14:42:015 - else>
06/11/2006 12:14:42:015 - let>xpos=0
06/11/2006 12:14:42:015 - let>ypos=0
06/11/2006 12:14:42:015 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:42:031 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:42:031 - EndIf
06/11/2006 12:14:42:031 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:42:625 - ife>d:\s.bmp
06/11/2006 12:14:42:640 - 
06/11/2006 12:14:42:640 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:42:812 - If>imgs>0
06/11/2006 12:14:42:812 - Let>xpos=525+0
06/11/2006 12:14:42:812 - Let>ypos=353+0
06/11/2006 12:14:42:812 - MouseMove>525,353
06/11/2006 12:14:42:812 - Endif
06/11/2006 12:14:42:812 - else>
06/11/2006 12:14:42:812 - 
06/11/2006 12:14:42:812 - Label>End
06/11/2006 12:14:42:812 - Finished Macro : dsdf
06/11/2006 12:14:43:593 - Started Macro : dsdf
06/11/2006 12:14:43:593 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:43:593 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:14:43:593 - LibLoad>imglibDll,imglib
06/11/2006 12:14:43:593 - else>
06/11/2006 12:14:43:593 - let>xpos=0
06/11/2006 12:14:43:593 - let>ypos=0
06/11/2006 12:14:43:593 - IfFileExists>d:\screen.bmp
06/11/2006 12:14:43:593 - DeleteFile>d:\screen.bmp
06/11/2006 12:14:43:609 - EndIf
06/11/2006 12:14:43:609 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:14:43:750 - ife>d:\s.bmp
06/11/2006 12:14:43:750 - 
06/11/2006 12:14:43:750 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:14:43:937 - If>imgs>0
06/11/2006 12:14:43:937 - Let>xpos=525+0
06/11/2006 12:14:43:937 - Let>ypos=352+0
06/11/2006 12:14:43:937 - MouseMove>525,352
06/11/2006 12:14:43:937 - Endif
06/11/2006 12:14:43:937 - else>
06/11/2006 12:14:43:937 - 
06/11/2006 12:14:43:937 - Label>End
06/11/2006 12:14:43:937 - Finished Macro : dsdf
06/11/2006 12:16:21:484 - Started Macro : dsdf
06/11/2006 12:16:21:484 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:16:21:484 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:16:21:484 - LibLoad>imglibDll,imglib
06/11/2006 12:16:21:484 - else>
06/11/2006 12:16:21:484 - let>xpos=0
06/11/2006 12:16:21:484 - let>ypos=0
06/11/2006 12:16:21:484 - IfFileExists>d:\screen.bmp
06/11/2006 12:16:21:484 - DeleteFile>d:\screen.bmp
06/11/2006 12:16:21:484 - EndIf
06/11/2006 12:16:21:484 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:16:21:625 - ife>d:\s.bmp
06/11/2006 12:16:21:625 - 
06/11/2006 12:16:21:625 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:16:22:843 - If>imgs>0
06/11/2006 12:16:22:843 - Let>xpos=118+0
06/11/2006 12:16:22:843 - Let>ypos=316+0
06/11/2006 12:16:22:843 - MouseMove>118,316
06/11/2006 12:16:22:843 - Endif
06/11/2006 12:16:22:843 - else>
06/11/2006 12:16:22:843 - 
06/11/2006 12:16:22:843 - Label>End
06/11/2006 12:16:22:843 - Finished Macro : dsdf
06/11/2006 12:18:13:921 - Started Macro : dsdf
06/11/2006 12:18:13:937 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:13:937 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:13:937 - LibLoad>imglibDll,imglib
06/11/2006 12:18:13:937 - else>
06/11/2006 12:18:13:937 - let>xpos=0
06/11/2006 12:18:13:937 - let>ypos=0
06/11/2006 12:18:13:937 - IfFileExists>d:\screen.bmp
06/11/2006 12:18:13:937 - DeleteFile>d:\screen.bmp
06/11/2006 12:18:13:937 - EndIf
06/11/2006 12:18:13:937 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:18:14:062 - ife>d:\s.bmp
06/11/2006 12:18:14:062 - 
06/11/2006 12:18:14:062 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:18:14:890 - If>imgs>0
06/11/2006 12:18:14:890 - Let>xpos=625+0
06/11/2006 12:18:14:890 - Let>ypos=392+0
06/11/2006 12:18:14:890 - MouseMove>625,392
06/11/2006 12:18:14:890 - Endif
06/11/2006 12:18:14:890 - else>
06/11/2006 12:18:14:890 - 
06/11/2006 12:18:14:890 - Label>End
06/11/2006 12:18:14:890 - Finished Macro : dsdf
06/11/2006 12:18:28:625 - Started Macro : dsdf
06/11/2006 12:18:28:625 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:28:625 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:28:625 - LibLoad>imglibDll,imglib
06/11/2006 12:18:28:625 - else>
06/11/2006 12:18:28:625 - let>xpos=0
06/11/2006 12:18:28:625 - let>ypos=0
06/11/2006 12:18:28:625 - IfFileExists>d:\screen.bmp
06/11/2006 12:18:28:625 - DeleteFile>d:\screen.bmp
06/11/2006 12:18:28:640 - EndIf
06/11/2006 12:18:28:640 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:18:28:765 - ife>d:\s.bmp
06/11/2006 12:18:28:765 - 
06/11/2006 12:18:28:765 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:18:29:609 - If>imgs>0
06/11/2006 12:18:29:609 - else>
06/11/2006 12:18:29:609 - 
06/11/2006 12:18:29:609 - Label>End
06/11/2006 12:18:29:609 - Finished Macro : dsdf
06/11/2006 12:18:31:828 - Started Macro : dsdf
06/11/2006 12:18:31:828 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:31:828 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:18:31:828 - LibLoad>imglibDll,imglib
06/11/2006 12:18:31:828 - else>
06/11/2006 12:18:31:828 - let>xpos=0
06/11/2006 12:18:31:828 - let>ypos=0
06/11/2006 12:18:31:828 - IfFileExists>d:\screen.bmp
06/11/2006 12:18:31:828 - DeleteFile>d:\screen.bmp
06/11/2006 12:18:31:843 - EndIf
06/11/2006 12:18:31:843 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:18:32:031 - ife>d:\s.bmp
06/11/2006 12:18:32:031 - 
06/11/2006 12:18:32:031 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:18:32:859 - If>imgs>0
06/11/2006 12:18:32:859 - else>
06/11/2006 12:18:32:859 - 
06/11/2006 12:18:32:859 - Label>End
06/11/2006 12:18:32:859 - Finished Macro : dsdf
06/11/2006 12:19:15:437 - Started Macro : dsdf
06/11/2006 12:19:15:437 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:15:437 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:15:437 - LibLoad>imglibDll,imglib
06/11/2006 12:19:15:437 - else>
06/11/2006 12:19:15:437 - let>xpos=0
06/11/2006 12:19:15:437 - let>ypos=0
06/11/2006 12:19:15:437 - IfFileExists>d:\screen.bmp
06/11/2006 12:19:15:453 - DeleteFile>d:\screen.bmp
06/11/2006 12:19:15:453 - EndIf
06/11/2006 12:19:15:453 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:19:15:578 - ife>d:\s.bmp
06/11/2006 12:19:15:578 - 
06/11/2006 12:19:15:578 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:19:16:406 - If>imgs>5
06/11/2006 12:19:16:406 - else>
06/11/2006 12:19:16:406 - 
06/11/2006 12:19:16:406 - Label>End
06/11/2006 12:19:16:406 - Finished Macro : dsdf
06/11/2006 12:19:19:750 - Started Macro : dsdf
06/11/2006 12:19:19:750 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:19:750 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:19:750 - LibLoad>imglibDll,imglib
06/11/2006 12:19:19:750 - else>
06/11/2006 12:19:19:750 - let>xpos=0
06/11/2006 12:19:19:750 - let>ypos=0
06/11/2006 12:19:19:750 - IfFileExists>d:\screen.bmp
06/11/2006 12:19:19:750 - DeleteFile>d:\screen.bmp
06/11/2006 12:19:19:750 - EndIf
06/11/2006 12:19:19:765 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:19:19:906 - ife>d:\s.bmp
06/11/2006 12:19:19:906 - 
06/11/2006 12:19:19:906 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:19:20:718 - If>imgs>5
06/11/2006 12:19:20:718 - else>
06/11/2006 12:19:20:718 - 
06/11/2006 12:19:20:718 - Label>End
06/11/2006 12:19:20:718 - Finished Macro : dsdf
06/11/2006 12:19:28:671 - Started Macro : dsdf
06/11/2006 12:19:28:671 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:28:671 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:28:687 - LibLoad>imglibDll,imglib
06/11/2006 12:19:28:687 - else>
06/11/2006 12:19:28:687 - let>xpos=0
06/11/2006 12:19:28:687 - let>ypos=0
06/11/2006 12:19:28:687 - IfFileExists>d:\screen.bmp
06/11/2006 12:19:28:687 - DeleteFile>d:\screen.bmp
06/11/2006 12:19:28:687 - EndIf
06/11/2006 12:19:28:687 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:19:28:843 - ife>d:\s.bmp
06/11/2006 12:19:28:843 - 
06/11/2006 12:19:28:843 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:19:29:687 - If>imgs>90
06/11/2006 12:19:29:687 - else>
06/11/2006 12:19:29:687 - 
06/11/2006 12:19:29:687 - Label>End
06/11/2006 12:19:29:687 - Finished Macro : dsdf
06/11/2006 12:19:47:265 - Started Macro : dsdf
06/11/2006 12:19:47:265 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:47:265 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:19:47:265 - LibLoad>imglibDll,imglib
06/11/2006 12:19:47:265 - else>
06/11/2006 12:19:47:265 - let>xpos=0
06/11/2006 12:19:47:265 - let>ypos=0
06/11/2006 12:19:47:281 - IfFileExists>d:\screen.bmp
06/11/2006 12:19:47:281 - DeleteFile>d:\screen.bmp
06/11/2006 12:19:47:281 - EndIf
06/11/2006 12:19:47:281 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:19:47:406 - ife>d:\s.bmp
06/11/2006 12:19:47:406 - 
06/11/2006 12:19:47:406 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:19:48:234 - If>imgs>0
06/11/2006 12:19:48:234 - Let>xpos=625+0
06/11/2006 12:19:48:234 - Let>ypos=392+0
06/11/2006 12:19:48:234 - MouseMove>625,392
06/11/2006 12:19:48:234 - Endif
06/11/2006 12:19:48:234 - else>
06/11/2006 12:19:48:234 - 
06/11/2006 12:19:48:234 - Label>End
06/11/2006 12:19:48:234 - Finished Macro : dsdf
06/11/2006 12:20:03:203 - Started Macro : dsdf
06/11/2006 12:20:03:203 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:20:03:203 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:20:03:203 - LibLoad>imglibDll,imglib
06/11/2006 12:20:03:218 - else>
06/11/2006 12:20:03:218 - let>xpos=0
06/11/2006 12:20:03:218 - let>ypos=0
06/11/2006 12:20:03:218 - IfFileExists>d:\screen.bmp
06/11/2006 12:20:03:218 - DeleteFile>d:\screen.bmp
06/11/2006 12:20:03:218 - EndIf
06/11/2006 12:20:03:218 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:20:03:343 - ife>d:\s.bmp
06/11/2006 12:20:03:343 - 
06/11/2006 12:20:03:343 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:20:04:046 - If>imgs>0
06/11/2006 12:20:04:046 - else>
06/11/2006 12:20:04:046 - 
06/11/2006 12:20:04:046 - Label>End
06/11/2006 12:20:04:062 - Finished Macro : dsdf
06/11/2006 12:20:32:984 - Started Macro : dsdf
06/11/2006 12:20:32:984 - iffileexists>D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:20:32:984 - Let>imglibDLL=D:\Program Files\MJT Net Ltd 8.1\Macro Scheduler\imglib.dll
06/11/2006 12:20:32:984 - LibLoad>imglibDll,imglib
06/11/2006 12:20:32:984 - else>
06/11/2006 12:20:32:984 - let>xpos=0
06/11/2006 12:20:32:984 - let>ypos=0
06/11/2006 12:20:32:984 - IfFileExists>d:\screen.bmp
06/11/2006 12:20:32:984 - DeleteFile>d:\screen.bmp
06/11/2006 12:20:32:984 - EndIf
06/11/2006 12:20:32:984 - ScreenCapture>0,0,1024,768,d:\screen.bmp
06/11/2006 12:20:33:125 - ife>d:\s.bmp
06/11/2006 12:20:33:125 - 
06/11/2006 12:20:33:125 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,d:\screen.bmp,20,1,ref:0,ref:0
06/11/2006 12:20:35:000 - If>imgs>0
06/11/2006 12:20:35:015 - Let>xpos=471+0
06/11/2006 12:20:35:015 - Let>ypos=460+0
06/11/2006 12:20:35:015 - MouseMove>471,460
06/11/2006 12:20:35:015 - Endif
06/11/2006 12:20:35:031 - else>
06/11/2006 12:20:35:031 - 
06/11/2006 12:20:35:031 - Label>End
06/11/2006 12:20:35:031 - Finished Macro : dsdf



But I have 2 another questions:
1. The code moves the mouse to the picture but it takes somthing like 1-2 seconds. Is there any way to accelerate it?
2. The aim of the code is to locate sentences in an internet page.The sentences are randomly put (it meanes that a specific sentence might be in the first time at the top of the screen and than in the second time it might be in the bottom of the screen, therefore I use the picture recognation function). But the problem is that the interenet page has a background (the background is constant and it is one color with lines in another color) and then The only constant thing that remains in the picture is the sentence... and therfore the image doesn't suitable.
Here is an example:
http://uploaded.fresh.co.il/2006/11/06/33839161.jpg

Notice that in the two cases the background is constant, but the sentence ("Macro Scheduler") isn't at the same place and therefore I can't recognise where it is. What can I do? Is there any way to ignor the background and take into account just the sentence? (all the sentence is in black pixels)

THANKS.

grosnombril
Newbie
Posts: 8
Joined: Tue Nov 14, 2006 5:26 pm

Me too....

Post by grosnombril » Tue Nov 14, 2006 5:32 pm

I am new to the tool, I think it has potential but I am seeing strange behavior. Don't know where the problem could be. Tried the program above and got the following log, any idea, I have outline the part which seems wrong to me.

11/14/2006 11:38:37:015 - Started Macro : Google Button Example2
11/14/2006 11:38:37:031 - START: iffileexists>c:\imglib.dll
11/14/2006 11:38:37:031 - END: iffileexists>c:\imglib.dll
11/14/2006 11:38:37:031 - START: Let>imglibDLL=c:\imglib.dll
11/14/2006 11:38:37:031 - END: Let>imglibDLL=c:\imglib.dll
11/14/2006 11:38:37:031 - START: LibLoad>imglibDll,imglib
11/14/2006 11:38:37:031 - END: LibLoad>imglibDll,imglib
11/14/2006 11:38:37:031 - START: else>
11/14/2006 11:38:37:031 - END: endif>
11/14/2006 11:38:37:031 - START: let>xpos=0
11/14/2006 11:38:37:031 - END: let>xpos=0
11/14/2006 11:38:37:031 - START: let>ypos=0
11/14/2006 11:38:37:031 - END: let>ypos=0
11/14/2006 11:38:37:031 - START: IfFileExists>c:\screen.bmp
11/14/2006 11:38:37:031 - END: IfFileExists>c:\screen.bmp
11/14/2006 11:38:37:031 - START: DeleteFile>c:\screen.bmp
11/14/2006 11:38:37:046 - END: DeleteFile>c:\screen.bmp
11/14/2006 11:38:37:046 - START: EndIf
11/14/2006 11:38:37:046 - END: EndIf
11/14/2006 11:38:37:046 - START: ScreenCapture>0,0,1024,768,c:\screen.bmp
11/14/2006 11:38:37:406 - END: ScreenCapture>0,0,1024,768,c:\screen.bmp
11/14/2006 11:38:37:421 - START: ife>c:\googlebutton.bmp
11/14/2006 11:38:37:421 - END: ife>c:\googlebutton.bmp
11/14/2006 11:38:37:421 - START:
11/14/2006 11:38:37:421 - END:
11/14/2006 11:38:37:421 - START: LibFunc>imglib,FindImgPos,imgs,c:\googlebutton.bmp,c:\screen.bmp,20,1,ref:0,ref:0
11/14/2006 11:38:37:421 - END: LibFunc>imglib,FindImgPos,imgs,c:\googlebutton.bmp,c:\screen.bmp,20,1,ref:0,ref:0
11/14/2006 11:38:37:421 - START: If>imgs>0
11/14/2006 11:38:37:421 - END: If>imgs>0
11/14/2006 11:38:37:421 - START: Let>xpos=%imgs_5%+0
11/14/2006 11:38:37:421 - END: Let>xpos=%imgs_5%+%imgs_5%+0
11/14/2006 11:38:37:421 - START: Let>ypos=%imgs_6%+0
11/14/2006 11:38:37:421 - END: Let>ypos=%imgs_6%+%imgs_6%+0
11/14/2006 11:38:37:421 - START: MouseMove>%imgs_5%+0,%imgs_6%+0
11/14/2006 11:38:38:531 - END: MouseMove>%imgs_5%+0,%imgs_6%+0
11/14/2006 11:38:38:531 - Finished Macro : Google Button Example2

grosnombril
Newbie
Posts: 8
Joined: Tue Nov 14, 2006 5:26 pm

Me too....

Post by grosnombril » Tue Nov 14, 2006 5:50 pm

I am new to the tool, I think it has potential but I am seeing strange behavior. Don't know where the problem could be. Tried the program above and got the following log, any idea:

11/14/2006 11:22:28:296 - Started Macro : Google Button Example
11/14/2006 11:22:28:296 - iffileexists>c:\imglib.dll
11/14/2006 11:22:28:296 - Let>imglibDLL=c:\imglib.dll
11/14/2006 11:22:28:312 - LibLoad>imglibDll,imglib
11/14/2006 11:22:28:312 - endif>
11/14/2006 11:22:28:312 - let>xpos=0
11/14/2006 11:22:28:312 - let>ypos=0
11/14/2006 11:22:28:312 - IfFileExists>c:\screen.bmp
11/14/2006 11:22:28:312 - DeleteFile>c:\screen.bmp
11/14/2006 11:22:28:328 - EndIf
11/14/2006 11:22:28:687 - ScreenCapture>0,0,1024,768,c:\screen.bmp
11/14/2006 11:22:28:687 - ife>c:\googlebutton.bmp
11/14/2006 11:22:28:687 -
11/14/2006 11:22:28:687 - LibFunc>imglib,FindImgPos,imgs,d:\s.bmp,c:\screen.bmp,20,1,ref:0,ref:0
11/14/2006 11:22:28:703 - If>imgs>0
11/14/2006 11:22:28:703 - Let>xpos=%imgs_5%+%imgs_5%+0
11/14/2006 11:22:28:703 - Let>ypos=%imgs_6%+%imgs_6%+0

11/14/2006 11:22:30:203 - MouseMove>%imgs_5%+0,%imgs_6%+0
11/14/2006 11:22:30:203 - Finished Macro : Google Button Example


It seems like it is because

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 » Tue Nov 14, 2006 6:10 pm

I haven't tried to go through your whole script, but this section of the log seems to indicate a problem:
11/14/2006 11:22:28:703 - If>imgs>0
11/14/2006 11:22:28:703 - Let>xpos=%imgs_5%+%imgs_5%+0
11/14/2006 11:22:28:703 - Let>ypos=%imgs_6%+%imgs_6%+0
11/14/2006 11:22:30:203 - MouseMove>%imgs_5%+0,%imgs_6%+0
-----------------------------
It looks like you are trying to add 3 values to xpos and ypos.
The first two are not being assigned properly, the third is assigned "0"

So it is likely that either the lines to create the values never ran for imgs_5 and imgs_6 or the lines that assign those values are incorrect. If those sections ran correctly then you would see something like
Let>xpos=15+15+0

The variable values inside the % have not been calculated, and you should do the math before assigning the value with Let>. You may want to try this format to do the same thing:
Add>xpos,%imgs_5%
Add>xpos,%imgs_5%
Add>xpos,0
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 14, 2006 6:15 pm

grosnombril,

1. Which version of Macro Scheduler are you using?
2. Where is imglib.dll located?
3. Is your LibLoad line referencing imglib.dll correctly?
4. What is the return value of the LibLoad line (imglib variable)
5. Does d:\s.bmp exist?
6. Why are you checking for the existence of c:\googlebutton.bmp but referencing d:\s.bmp!?
7. What is the value of imgs returned by the LibFunc FindImgPos line

To determine 4 and 7 use the debugger.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

grosnombril
Newbie
Posts: 8
Joined: Tue Nov 14, 2006 5:26 pm

to answer your questions.

Post by grosnombril » Tue Nov 14, 2006 6:40 pm

1. Which version of Macro Scheduler are you using?
I am using version 8.1e
2. Where is imglib.dll located?
I was suspecting it was because it could not find it so I moved it to c:\ to make debugging simpler.
3. Is your LibLoad line referencing imglib.dll correctly?
I think so. Steps over it correctly in the debugger.
4. What is the return value of the LibLoad line (imglib variable)
16252928
5. Does d:\s.bmp exist?
No, but I had noticed it originally and replaced with googlebutton.bmp which does exist. By the way, I have noticed a caching problem in the tool. I would open a script for edit, edit it, save it, and then reopen it and I see the older version of the file. Although, if I open it with another editor the file is seen as I last saved it. This should go in another thread but I just thought I should tell you since you are the programmer.
6. Why are you checking for the existence of c:\googlebutton.bmp but referencing d:\s.bmp!?
See explanation in 5. I have tried with googlebutton.bmp, same result.
7. What is the value of imgs returned by the LibFunc FindImgPos line
Oops... "Unable to load DLL". Does it imply that I cannot use your library with the version of macro scheduler I am using ?

To determine 4 and 7 use the debugger.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 14, 2006 7:04 pm

7. What is the value of imgs returned by the LibFunc FindImgPos line
Oops... "Unable to load DLL". Does it imply that I cannot use your library with the version of macro scheduler I am using ?
No, version 8.1 is fine. We know the DLL is being loaded because you've stepped over the LibLoad line and got a value back for imglib.

You'd get this error if it can't find the DLL or the function doesn't exist in it. But we know the DLL is loaded and since it is our DLL I know FindImgPos is in it. So it looks like imglib is not the correct reference for the DLL.

Therefore my guess is your LibLoad line has a space at the end of it. My guess is you've created a reference called "imglib " not "imglib" but you're using "imglib" in the LibFunc line. Do Edit/Remove Trailing Spaces and then try it again.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

grosnombril
Newbie
Posts: 8
Joined: Tue Nov 14, 2006 5:26 pm

Tried it would not work.

Post by grosnombril » Tue Nov 14, 2006 7:14 pm

Works, not one more question:

Is it normal it takes 9 seconds to execute ?

If so would you like me to try to help optimize the image library ? I have done lots of embedded programming and am pretty sure it could be made much faster.

If not, what could be causing so much delays?

Also, why not make the parser to get rid of trailing spaces ? I can help you with that too if you want.

thanks for the help.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 14, 2006 7:47 pm

9 seconds sounds excessive. I've not experienced that much of a delay before. Most I've seen is around 2 depending on the size of the image being scanned and the image being sought. Usually it is unnecessary to scan the entire screen - often you just need to scan a window, so that can narrow things down quite a bit. There's a relative example in the help file.

Why not get rid of trailing spaces? Because there are many valid reasons for having them! If we did that many existing scripts would stop working. E.g. some people send a space to a checkbox to check it, or send a space to an edit field, or use a space in a string function etc ... In any case if you copy from a web page and the editor notices that the clipboard contains HTML it will automatically remove the non-printable characters that copying from a web page adds at the end of each line. So in that sense the parser already does remove trailing spaces. Also the editor shows you trailing spaces by shading them gray and there's an option to warn on closing the editor if it finds any trailing spaces.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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