Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Image Search


Rekomendowane odpowiedzi

  • 1 miesiąc temu...
  • Odpowiedzi 113
  • Dodano
  • Ostatniej odpowiedzi
Opublikowano

Przepraszam, ale mam taki sam error co kolega up. =) Win7 64bit. Dll w folderze ze stryptem, w autoit jest include, dll w windows, w system i nadal ten error.

 

If $result[0] = "0" Then Return 0
If $result^ ERROR

Error: Subscript used with non-Array variable."

userbarwb.png

Zawsze promocje na sygnatury ^^

Opublikowano

zarejestruj sobie dll w systemie regsvr32.exe plik.dll

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Opublikowano

zarejestruj sobie dll w systemie regsvr32.exe plik.dll

 

Dzięki za szybką odpowiedź. Niestety, błąd jakiś dziwny =)

 

beztytuuts.png

 

 

 

Jak pisałem up - mam system 64 bitowy i ta dll jest pewnie tylko pod 32 ;< Da się to jakoś naprawić?

userbarwb.png

Zawsze promocje na sygnatury ^^

Opublikowano

dla x64 jest inna biblioteka , na forum autoit jest link , tu tez gdzies kiedyś podawałem

 

czyli powody niedziałania znasz , niewłaściwa wersja biblioteki do systemu operacyjnego , dlatego najlepiej dołączyć obydwie biblioteki do programu i uzyc tej właściwej

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

  • 4 miesiące temu...
Opublikowano

Mam cały czas błąd

C:\Programy\AutoIt3\Include\ImageSearch.au3(91,31) : WARNING: $fenster: possibly used before declaration.
$state = WinGetState($fenster,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Programy\AutoIt3\Include\ImageSearch.au3(91,31) : ERROR: $fenster: undeclared global variable.
$state = WinGetState($fenster,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Programy\AutoIt3\Examples\GUI\Advanced\AlphaBlend.au3 - 1 error(s), 1 warning(s)

LAYOUT'Y POD SERWER MINECRAFT U MNIE. ZAPRASZAM PW

Opublikowano

pewnie źle skopiowałeś includa, najwyzej dopisz na poczatku Global $fenster = 0;

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano

Skopiowany dll do system32/windows/system a au3 do include.

Po dodaniu tego co pisałeś

C:\Programy\AutoIt3\Include\ImageSearch.au3(1,10) : ERROR: Scriptfile trying to include itself.
#include <ImageSearch.au3>
~~~~~~~~~^
C:\Programy\AutoIt3\Include\ImageSearch.au3(4,51) : ERROR: _ImageSearch(): undefined function.
$result = _ImageSearch("GFX\.bmp", 1, $x, $y, 20)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Programy\AutoIt3\Include\ImageSearch.au3 - 2 error(s), 0 warning(s)

 

ps.Pobrany od robem

LAYOUT'Y POD SERWER MINECRAFT U MNIE. ZAPRASZAM PW

Opublikowano

 

#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

;                   $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of

;                                  the color to be used as transparency; can be omitted if

;                                  not needed

;

; 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,$transparency=0)

  return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$transparency)

EndFunc



Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance, $transparency=0)

   ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)

   if not ($transparency = 0) then $findImage = "*" & $transparency & " " & $findImage

   if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage

   $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)



   ; 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

;                   $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of

;                                  the color to be used as transparency can be omitted if

;                                  not needed

;

; Return Value(s):  On Success - Returns 1

;                   On Failure - Returns 0

;

;

;===============================================================================

Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $x, ByRef $y,$tolerance,$transparency=0)

   $waitSecs = $waitSecs * 1000

   $startTime=TimerInit()

   While TimerDiff($startTime) < $waitSecs

       sleep(100)

       $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance,$transparency)

       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

;                   $transparent - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of

;                                  the color to be used as transparent; can be omitted if

;                                  not needed

;

; 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,$transparency=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,$transparency)

           if $result > 0 Then

               return $i

           EndIf

       Next

   WEnd

   return 0

EndFunc

daj tą wersje , otwórz i wklej to na starą

 

albo uzyj gotowego ;p

ImageSearch.au3.zip

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

  • 2 tygodnie później...
Opublikowano

Czy da rade zrobic zeby w petli while 1 prog szukal 2-och roznych obrazkow ? bo z jednym to nie ma problemu, ale jak probuje dac 2 rozne obrazki to nie chce mi dzialac :/ jezeli da rade to prosilbym o przykladowy kod. Z gory THX.

  • 3 miesiące temu...
Opublikowano

Ja mam taki problem, ktoś chyba też miał taki na 3 str. tematu ale odpowiedzi nie były zbyt jasne przynajmniej dla mnie. Bot szuka całego obrazka, który może być poprostu prostokątny lub kwadratowy, a ja chcę zrobić coś takiego (nie wiem czy to wogóle możliwe), żeby bot szukał mi napisu i w niego klikał. Chodzi o to, że mam napis np. na środku ekranu, a tłem dokoła liter jest sama gra i to co się w niej dzieje więc tło zmienia się nieustannie. Co zrobić (czy to się da zrobić), aby bot szukał tylko tego napisu, a tło poprostu ignorował?

  • 7 miesięcy temu...
Opublikowano

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ImageSearch.au3>

FileInstall("D:\qwe.bmp", @TempDir & "\qwe.bmp")

$Okno = GUICreate("Form1", 98, 74, 192, 124)
$Button1 = GUICtrlCreateButton("Start", 8, 8, 81, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Exit", 8, 40, 81, 25, $WS_GROUP)
GUISetState(@SW_SHOW)

Global $x, $y

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $Button1
		$Result = _ImageSearch(@TempDir & "\qwe.bmp", 1, $x, $y, 20)
			If $Result = 1 Then
				MouseMove($x, $y, 3)
			EndIf
	Case $Button2
		Exit

EndSwitch
WEnd

 

Czemu nie działa? Po kliknięciu pokazuje mi się:

C:\Program Files (x86)\AutoIt 3\Include\ImageSearch.au3 (44) : ==> Subscript used with non-Array variable.:
if $result[0]="0" then return 0
if $result^ ERROR
->21:48:06 AutoIT3.exe ended.rc:1

 

Wgrałem wszystko jak trzeba dll do C:\Windows, au3 do folderu Include w AutoIt.

Czemu nie chce działać? Mam Win7 x64.

 

@Edit Już mam: Klik

obraz24.png


  • 8 miesięcy temu...
Opublikowano

nie wiem czy nawet wykrywa autoita wiec pierewsze pytanie: jak to sprawdzic?

 

a drugi co tu jest zle?

 

 

#include <ImageSearch.au3>
Global $x, $y ;A
$result = _ImageSearch("D:\lop.bmp", 1, $x, $y, 20) ;B
If $result = 1 Then ;C
MsgBox(0, "Found!", "Znalazlem obrazek jego pozycja to x: "&$x&"y: "&$y) ;D
endif ;E

Opublikowano

nie wiem czy nawet wykrywa autoita wiec pierewsze pytanie: jak to sprawdzic?

 

a drugi co tu jest zle?

 

 

#include <ImageSearch.au3>
Global $x, $y ;A
$result = _ImageSearch("D:\lop.bmp", 1, $x, $y, 20) ;B
If $result = 1 Then ;C
MsgBox(0, "Found!", "Znalazlem obrazek jego pozycja to x: "&$x&"y: "&$y) ;D
endif ;E

 

Wszystko jest ok.

Obrazek ktory szukasz musi byc widoczny na ekranie.

 

Upewnij sie, ze to masz :

 

Na początek ściągamy include.

[uDF]ImageSearch

 

Plik "ImageSearchDLL.dll" Wrzucamy do folderu z windowsem np. c:\windows

Plik "ImageSearch.au3" Dajemy do folderu include folderze autoita.

 

dla systemu 32bit i 64bit trzeba sciagnac inny plik

  • 6 miesięcy temu...
Opublikowano

Cześć
Przeczytałem tego tutka wszystko pięknie działa jak napisałeś wyżej lecz gry próbuje użyć tej funkcji po raz drugi to mi nie działa ;/

#include <ImageSearch.au3>
Global $x, $y
$result = _ImageSearch("aa.bmp", 1, $x, $y, 10)
If $result = 1 Then
MouseClick("left", $x, $y)
EndIf

Global $a, $b
$result = _ImageSearch("bb.bmp", 1, $a, $b, 10)
If $result = 1 Then
MouseClick("left", $a, $B)
EndIf

Opublikowano

@up

Nie działa? Jakiś błąd czy po prostu nie klika?

Jeśli nie klika być może po prostu nie znajduje nigdzie obrazka (w drugiej instrukcji warunkowej $result != 1)? Jesteś pewny, że masz umieszczony bb.bmp w miejscu, gdzie jest program?

a i $result jest niezdeklarowana, z tym że nie pamiętam czy w autoit jest potrzeba wcześniejszego deklarowania zmiennych.

 

P.S. Możesz ponownie użyć zmiennych $x, $y, o ile już nie będą ci potrzebne w programie współrzędne pierwszego obrazka (z programu widać, że nie są).

Opublikowano

Cześć

Przeczytałem tego tutka wszystko pięknie działa jak napisałeś wyżej lecz gry próbuje użyć tej funkcji po raz drugi to mi nie działa ;/

 

#include <ImageSearch.au3>

Global $x, $y

$result = _ImageSearch("aa.bmp", 1, $x, $y, 10)

If $result = 1 Then

MouseClick("left", $x, $y)

EndIf

 

Global $a, $b

$result = _ImageSearch("bb.bmp", 1, $a, $b, 10)

If $result = 1 Then

MouseClick("left", $a, $ B)

EndIf

Po pierwsze i dobre rozwiazanie dodaj sobie If $result = 0 Then Msgbox wtedy bedziesz wiedzial że nie znalazło obrazka. Najlepiej wypróbuj bota na pulpicie czy działa, Może nie może znaleźć obrazka lub pliku (podaj pełną sciezke do obrazka)

1387536187-U112334.png

Jeśli Ci pomogłem mógłbyś wynagrodzić lajkiem :)

  • 2 tygodnie później...
Opublikowano

Hej ciągle wywala takowy błąd :

Line 44 (File "C:\Program Files(x86)\AutoIt3\Include\ImageSearch.au3"):

if $result[0]="0" then return 0

if $result^ Error

Error:Subscript used with non-array variable

O co w tym chodzi, jest tak przy każdym skrypcie z image search

"...przeważnie zachowuje się rozważnie ... "

  • 6 miesięcy temu...
Opublikowano

Pomocy meczę się już 2 dzień z tym

>"C:\Games\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Szymon.Szymon-HP.000\Desktop\0001.au3" /UserParams    

+>22:21:01 Starting AutoIt3Wrapper v.2.1.2.9    Environment(Language:0415  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (1.54.22.0)  from:C:\Games\AutoIt3
C:\Users\Szymon.Szymon-HP.000\Desktop\0001.au3(1,9) : ERROR: can't open include file <ImageSearch.au3>.
#Include<ImageSearch.au3>
~~~~~~~~^
C:\Users\Szymon.Szymon-HP.000\Desktop\0001.au3(9,95) : ERROR: _ImageSearch(): undefined function.
$Search = _ImageSearch("C:\Users\Szymon.Szymon-HP.000\Desktop\ImageSearch.bmp", 0 , $x, $y, 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Szymon.Szymon-HP.000\Desktop\0001.au3 - 2 error(s), 0 warning(s)
!>22:21:02 AU3Check ended. Press F4 to jump to next error.rc:2
>Exit code: 2    Time: 0.662
napisałem takie coś zęby najeżdżał na ikonkę od TS-3 (team speak 3,program) na pulpicie .
#Include<ImageSearch.au3>



HotKeySet("s" ,"Start")


$x = 0
$y = 0


Func Start()
$Search = _ImageSearch("C:\Users\Szymon.Szymon-HP.000\Desktop\ImageSearch.bmp", 0 , $x, $y, 0)
If $Search = 1 Then
  MouseMove($x, $y, 10)
 EndIf
EndFunc


While 1
sleep(100)
WEnd
Znalazłem taki filmik
 :http://www.youtube.com/watch?v=lrc54kmVqjI 
wszystko zrobiłem identyko ale nie odczytuje mi #Include <ImageSearch.au3>
Błagam pomocy bo nie daje rady z tym

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...