Jump to content
Sign in to follow this  
OptimusJH

ImageSearch Recursion Error

Recommended Posts

#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include <ImageSearch.au3>
 
Global $x = 0
Global $y = 0
 
Func Room()
 
    Local $Room = _ImageSearcharea("room.bmp",1,708,56,768,96, $x, $y, 20)

 

If $Room = 1 Then

Call ("Room2")

   Else

  Sleep(300)
  Send("{ENTER}")
  Sleep(300)
  Call ("Room")
 
Endif
 
Endfunc
 
 
Func Room2
 
Local $Room2 = _ImageSearcharea("room2.bmp",1,708,56,768,96, $x, $y, 20)
 
If $Room2 = 1 Then

 

Call ("Room")

   Else

  Sleep(300)
  Send("{Ctrl}")
  Sleep(300)
  Call ("Room2")
 
Endif
 
Endfunc
 
 
----------------------------------------------
 
This is my imagesearch script. But If I run program about 1 hours, It notice recursion level error.
Please Help Me..

Share this post


Link to post
Share on other sites

Welcome to AutoIt and the forum!

Can you please tell us which program you try to automate? Most of the time there are more reliable and efficient ways to automate a program than using ImageSearch.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I make code for game which my friend made... Original Code is too Long. so I wrote part of code.

Please read our forum rules before continuing posting questions in our forums.

Jos

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...