
rodiney
Active Members-
Posts
38 -
Joined
-
Last visited
Everything posted by rodiney
-
hello my program is giving an error , someone help me ? #include <ImageSearch.au3> Global $x Global $y $pixel = _ImageSearch("pixel.PNG", 1, $x, $y,0) if $char = 1 Then MsgBox(0,"","fff") EndIf when I try to play this script appears this message >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Grubi\Documents\autoit\suporte\hh.au3" "C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3" (43) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR >Exit code: 1 Time: 0.0655 when I press 2 times in error, goes to include the code searchimage #include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Image Search ; Require that the ImageSearchDLL.dll be loadable ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify ; a desktop region to search ; ;=============================================================================== Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance, $HBMP=0) return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$HBMP) EndFunc 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 ; 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 ;=============================================================================== ; ; Description: Wait for a specified number of seconds for an image to appear ; ; Syntax: _WaitForImageSearch, _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$HBMP=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs sleep(100) $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance,$HBMP) if $result > 0 Then return 1 EndIf WEnd return 0 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for any of a set of ; images to appear ; ; Syntax: _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the ARRAY of images to locate on the desktop ; - ARRAY[0] is set to the number of images to loop through ; ARRAY[1] is the first image ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns the index of the successful find ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$HBMP=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs for $i = 1 to $findImage[0] sleep(100) $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance,$HBMP) if $result > 0 Then return $i EndIf Next WEnd return 0 EndFunc anyone know why is that?
-
I not see it thank you so much!
-
#include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <GuiRichEdit.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Constants.au3> $Form1 = GUICreate("Main", 400, 400) $idTab = GUICtrlCreateTab(2, 2, 396, 396) $hTab = GUICtrlGetHandle($idTab) $TabSheet1 = GUICtrlCreateTabItem("Main") GUICtrlCreateLabel("Main tab 0...", 20, 50, 360, 20) $TabSheet2 = GUICtrlCreateTabItem("History") GUICtrlCreateLabel("History tab 1...", 20, 50, 360, 20) $hRichEdit = _GUICtrlRichEdit_Create($Form1, "", 20, 80, 360, 200, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL)) For $n = 1 To 50 _GUICtrlRichEdit_AppendText($hRichEdit, $n & ": Test a very long line of text in a RichEdit box." & @CRLF) Next ControlDisable($Form1, "", $hRichEdit) ControlHide($Form1, "", $hRichEdit) $TabSheet3 = GUICtrlCreateTabItem("blah") GUICtrlCreateLabel("blah tab 2...", 20, 50, 360, 20) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab, $iTab $hWndTab = $hTab $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTab Switch $iCode Case $TCN_SELCHANGE ; selection changed $iTab = _GUICtrlTab_GetCurSel($hTab) Switch $iTab Case 1 ControlEnable($Form1, "", $hRichEdit) ControlShow($Form1, "", $hRichEdit) Case Else ControlDisable($Form1, "", $hRichEdit) ControlHide($Form1, "", $hRichEdit) EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY hello I need some help here. I have this example to select which tab the GUICtrlRichEdit will appear, however this example appears in tab 2, I need that appears on the tab 1. tried many ways not obitive success. if anyone can help me I thank.
-
how would my code? I looked at some examples, but not understand how it works ... can you help me?
-
Hello I'm trying to capture text from a browser tab, the more I'm not getting. so I can find the browser information. use code: #include <MsgBoxConstants.au3> Example() Func Example() ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:IEFrame]", "", 10) ; Retrieve the text of the edit control in browser. The handle returned by WinWait is used for the "title" parameter of ControlGetText. Local $sText = ControlGetText($hWnd, "", "") ; Display the text of the edit control. MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $sText) EndFunc ; Window information: >>>> Window <<<< Title: TibiaME - Web Client - XHTML - Internet Explorer Class: IEFrame Position: 0, 0 Size: 662, 456 Style: 0x16CF0000 ExStyle: 0x00000100 Handle: 0x0004030A >>>> Control <<<< Class: SunAwtCanvas Instance: 1 ClassnameNN: SunAwtCanvas1 Name: Advanced (Class): [CLASS:SunAwtCanvas; INSTANCE:1] ID: Text: Position: 3, 85 Size: 640, 360 ControlClick Coords: 255, 187 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x00040448 >>>> Mouse <<<< Position: 266, 272 Cursor ID: 0 Color: 0x8A9BA3 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Barra de Navegação Barra de Endereços http://www.tibiame.com/?section=webclient&markup=xhtml Controle de Combinação de Endereços Controle de Páginas Favoritos e Barra de Ferramentas TibiaME - Web Client - XHTML - Internet Explorer >>>> Hidden Text <<<<
-
the example I had was an unauthorized program. more I already managed to do What do I want, this work used the _GUICtrlRichEdit_AppendText that BrewManNH said, and is working now, thank you
-
Hi In my program I am separating each function in a .au3 file and each will call at the right time , I want to know if you have to join all .au3 files and compile .exe also has a folder with images.
-
Thank you Melba23. All questions solved thanks to all
-
Now I 'm need to do he not editable , read-only. Someone help me?
-
Thanks you BrewManNH, _GUICtrlRichEdit_AppendText work
-
Sorry autobet, the script exemple i have, cant post here.
-
Hello I need help in GUICtrl RichEdit. I managed to create a window using _GUICtrlRichEdit_Create (). now takes place not editable window (for the User not editas data), and also need to write on the screen. example, case $ button1 "this message is written" more without deleting WHAT already had before. Thanks
-
-snip- Hello I need help in GUICtrl RichEdit. I managed to create a window using _GUICtrlRichEdit_Create (). now takes place not editable window (for the User not editas data), and also need to write on the screen. example, case $ button1 "this message is written" more without deleting WHAT already had before. I managed to find this example of a clash of clans program. most do not understand, can someone help me? Setlog("text", $COLOR_PURPLE) Administrator i only used this code as an example, I want to know how to, does not mean I want to make a bot game, thanks you
-
I found help. did not know existed, it has several examples Thank you, I will try
-
hi rudi, yes want to get the timestamp. I want to make the same photo. I found really cool this log , It is pretty much in the program.
-
Can show me one exemple please?
-
Hello how do I make a log like the image? for what you appear the program is doing, like search main screen. note: the photo is only example. thanks
-
I need help to improve this script. and need that when connected checkbox the program send commands to the conrespondende that was saved in the file array.tmp thank you <snip>
-
Thanks all
-
How do I leave a message on my program at each button instance, have two buttons when I put the mouse on top of him a message, more is not a message like msgbox () is a small message near the required button Thanks you
-
I was using otherwise. like that worked perfectly thank InunoTaishou !!! and all
-
Hello I need to store data in an array in a temporary file. example: globla $ Array [5] $ Array [0] = 2 $ Array [1] = 3 $ Array [2] = 5 $ Array [3] = 9 $ Array [4] = 8 need to keep them in order, and one below the other. in line 2 3 5 9 8
-
I want to do an if in the array. in my array the value can be 0. $ Array [0] = 0 as I do to check if array is empty? if $ array [0] = "" the endif It works well?
-
I will test it. Thank you
-
hello need help with array, I'm using search array to find a number stored in this array. example: $ array [0] = 2 $ array [1] = 2 and I need to look for the number 2 within the array, I check the 2, 2 stored in the array, in my case it only finds the first array $ array [0] i need check two array. Script. #include <Array.au3> #include <MsgBoxConstants.au3> Local $avArray[2] $avArray[0] = 2 $avArray[1] = 2 _ArrayDisplay($avArray, "$avArray") Local $sSearch = 2 Local $iIndex = _ArraySearch($avArray, $sSearch, 0, 0, 0, 1, 1, 0) If @error Then MsgBox($MB_SYSTEMMODAL, "Not Found", '"' & $sSearch & '" was not found") Else MsgBox($MB_SYSTEMMODAL, "Found", '"' & $sSearch & '" was found in the array at position ' & $iIndex) EndIf