|
You last visited: Today at 01:33
Advertisement
PixelSearch in background EXAMPLE
Discussion on PixelSearch in background EXAMPLE within the AutoIt forum part of the Coders Den category.
04/30/2016, 19:24
|
#1
|
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
|
PixelSearch in background EXAMPLE
Hello I need a simple example for pixelsearch in background using gdi+ for screenshot, fastfind for searching pixels and controlclick...I'he tried but idk what I'm doing wrong so I need help, thx
|
|
|
04/30/2016, 20:21
|
#2
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Last param @ PixelSearch and SetWindow with FastFind. where is the problem?
|
|
|
05/01/2016, 02:01
|
#3
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 166
|
Hi there, lets say your game is this...
Code:
#include <GDIPlus.au3>
$width = 800
$height = 600
#NoTrayIcon
$GUI = GUICreate("Game gui",$width,$height)
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($GUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width,$height,$hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$hBrush1 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
Global $objectX = 0,$objectW = 50
While Sleep(5)
update()
draw()
if GUIGetMsg() = -3 Then ExitLoop
WEnd
Func draw()
_GDIPlus_GraphicsClear($hBackbuffer)
_GDIPlus_GraphicsFillRect($hBackbuffer,0,$height/2,$width,$height/2,$hBrush2)
_GDIPlus_GraphicsFillEllipse($hBackbuffer,$objectX,$height/2,$objectW,$objectW,$hBrush1)
_GDIPlus_GraphicsDrawImage($hGraphic,$hBitmap,0,0)
EndFunc
Func update()
$objectX+=10
If $objectX + $objectW >= $width Then $objectX = 0
EndFunc
Now you cannot just take a screen of a minimized window, because when minimized the window isn't draw so u need set it on top, take the screen and hide it again.
Code:
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
Func CaptureWindowMinimized($hwnd)
Local $winData = WinGetPos($hwnd)
WinMove($hwnd,"",0,0)
WinSetOnTop($hwnd,"",1)
$HBMP = _ScreenCapture_CaptureWnd("",$hwnd,0,0,$winData[2],$winData[3],False) ;capture
WinMove($hwnd,"",@DesktopWidth-100,@DesktopHeight)
WinSetOnTop($hwnd,"",0)
$bmp = _GDIPlus_BitmapCreateFromHBITMAP($HBMP); we need the bitmap to get pixel colors
Return $bmp
EndFunc
$GUI = GUICreate("caca",800,600)
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($GUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(800,600,$hGraphic)
$hBackBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
HotKeySet("{F1}","capture")
While Sleep(5)
if GUIGetMsg() = -3 Then ExitLoop
WEnd
Func capture()
$hwnd = WinGetHandle("Game gui")
$image = CaptureWindowMinimized($hwnd)
_GDIPlus_GraphicsClear($hBackBuffer)
_GDIPlus_GraphicsDrawImage($hBackBuffer,$image,0,0)
_GDIPlus_GraphicsDrawImage($hGraphic,$hBitmap,0,0)
MsgBox(0,"",searchImage($image,4294901760,1,300))
EndFunc
Func searchImage($image,$color,$xo=1,$yo=1)
$imgW = _GDIPlus_ImageGetWidth($image)
$imgH = _GDIPlus_ImageGetHeight($image)
$currentColor = -1
For $x = $xo To $imgW
For $y = $yo To $imgH
$currentColor = _GDIPlus_BitmapGetPixel($image,$x,$y)
If $currentColor = $color Then Return $x&","&$y
Next
Next
EndFunc
I recommend to use image search for a fast pixel search...
|
|
|
05/01/2016, 10:04
|
#4
|
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
|
I need the fastest method..is there any faster than that? ^_^
|
|
|
05/01/2016, 10:12
|
#5
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Want a cookie ? :P
|
|
|
05/01/2016, 19:52
|
#6
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 166
|
I don't know but maybe u can make it work with fast pixel search, its open source, change the función that searchs a screenshot (i think its pixelsearch or sth)and add a pointer to your bitmap, recompile and use it
|
|
|
05/01/2016, 20:00
|
#7
|
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
|
thank you all :3 except mulak89 ( go fkyourself dude )
|
|
|
|
Similar Threads
|
BoxyBot Background's with GG's Background
11/26/2016 - DarkOrbit - 8 Replies
BoxyBot Hintergrundbilder
Hier sind die Piratenmaps zu sehen im Hintergrund und die Galaxy Gate Map's falls ihr ja im GG seit weil dieses schwaze Hintergrund ist ja schei***
Ich weiß es gibt schon einen Therad mit den Hintergrunden aber es gab sie nicht mit den Piraten Maps & GG's also habe ich mal bisschen daran rumgespielt.
Anleitung :
1) Entpackt : BoxyBot Backgrounds
2) BoxyBot Ordner öffnen
|
Image&PixelSearch in Background .Net Snippets
01/27/2015 - DarkOrbit - 3 Replies
A new year present for our .Net coders in this section! :cool:
Maybe you can do something in other languages too^^
Info
So i want to do it short and simple...
I uploaded a zip folder with some .cs files in it.
The code in it is all free to use and i have the right to share all of this code.
The HWID code is from http://www.elitepvpers.com/forum/members/2342603-s hawak.html and is free to use!
What can it do?
|
Pixelsearch Bot
07/08/2011 - AutoIt - 6 Replies
Hallo,
ich wollte fragen ob es möglich ist z.B. für Crossfire einen Pixelsearch Bot zu machen
und
Wie macht man mit Autoit so einen Youtube Account Creator
und
wie umgeht man die Captchaabfrage?
|
pixelsearch
12/27/2009 - AutoIt - 11 Replies
hi hab mal ne frage
ich hab jetzt mit pixelsearch die coordinaten
ich will aber jetzt das der 50 pixel darunter von den coordinaten hinklickt
wie geht das?
|
pixelSearch
07/05/2009 - AutoIt - 11 Replies
hi leute,
brauch mal eure hilfe bei autoit
ich möchte einen bot machen der einen pixel sucht
und wenn er ihn findet soll er mit der maus zu ihm gehen und
rechtsklick machen
( bin anfänger bei autoit)
thx im vorraus
|
All times are GMT +1. The time now is 01:33.
|
|