Bishop12 Posted June 5, 2019 Share Posted June 5, 2019 Hi guys im having a problem in to my code so first thing the code is working when i open and run it into Scite im using image search so after i compiled my code and put my compiled code into other files i mean like i move it into desktop and run the code then there i will have the problem Autoit Error Line 15 Error:Subscript used on non-accesible variabble. i will show some my code i cant figure out what is the problem even its working 101% when not compiled and run in folder . #include <ImageSearch.au3> HotKeySet("{F1}", "myExit") Global $Loc1 = 0 Global $x = 0 Global $y = 0 while 1 Loc1() WEnd Func Loc1() Do $Loc1 = _imagesearcharea("Loc1Spt.png", 1, 0, 0,764, 55, $x, $y, 150) If $Loc1 = 1 Then Sleep(2000) ElseIf $Loc1 = 0 Then Sleep(500) MsgBox($Loc1,"","WAITING",1) Sleep(1000) EndIf Until $Loc1 = 1 MsgBox(0,"FOUND","") EndFunc Link to comment Share on other sites More sharing options...
Bishop12 Posted June 5, 2019 Author Share Posted June 5, 2019 after testing and trying and looking for a problem i guest my problem is on image search and i already fix but another problem comes after editing my image search adding ; Error checking goes here If (IsArray($result) = False) Then Return 0 after DllCall problem fix i didnt get the error message saying that varible use without being declaired and i can use it like i move the compiled files into desktop and no error but another problem image search cant find the picture even the picture is there still telling waiting waiting and cant even find i wish some one help me here ???? Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance,$HBMP=0) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage If IsString($findImage) Then $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage,"ptr",$HBMP) Else $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"ptr",$findImage,"ptr",$HBMP) EndIf ; Error checking goes here If (IsArray($result) = False) Then Return 0 ; If error exit if $result[0]="0" then return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0],"|") $x=Int(Number($array[2])) $y=Int(Number($array[3])) if $resultPosition=1 then $x=$x + Int(Number($array[4])/2) $y=$y + Int(Number($array[5])/2) endif return 1 EndFunc Link to comment Share on other sites More sharing options...
Bishop12 Posted June 6, 2019 Author Share Posted June 6, 2019 Any one can help me on this ???? Link to comment Share on other sites More sharing options...
Bishop12 Posted June 6, 2019 Author Share Posted June 6, 2019 is there any way to fix Image search causeimage is found when both compile code and image is on the same folder but when i move or say i cut the compile code then put in desktop or any new folder alone image search return 0 cant find whats inside the code can any one help me ??????? Link to comment Share on other sites More sharing options...
Nine Posted June 6, 2019 Share Posted June 6, 2019 make sure you use full path for the .dll If you move .exe to another folder, then it won't find the dll anymore “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Bishop12 Posted June 6, 2019 Author Share Posted June 6, 2019 Just now, Nine said: make sure you use full path for the .dll If you move .exe to another folder, then it won't find the dll anymore how can i do that can you give me example on what should i do ? Link to comment Share on other sites More sharing options...
Bishop12 Posted June 7, 2019 Author Share Posted June 7, 2019 already fix thankyou any way Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now