Pixel problem

11/05/2012 12:26 mlukac89#1
i got problem with this script

Code:
      While True
		If PixelGetColor(411, 24, "0xF94746") Then
			ControlSend($title, "", "", "{3}")
		Else
			ControlSend($title, "", "", "{Tab}")
		EndIf
	WEnd
problem is that when it kills mob it wont send tab to aim for other mobs
i need when it kills mobs it send tab kill mob send tab ....
11/05/2012 14:12 Jonas_93#2
PixelGetColor:
Returns a pixel color according to x,y pixel coordinates.
PixelGetColor ( x , y [, hwnd] )

you use this function like this:

PixelGetColor( x, y, color)

And what you want is this:

PixelSearch ( left, top, right, bottom, color)

so ...

Code:
While True
     PixelSearch ( 1, 1, @DesktopWidth, @DesktopHeight, "0xF94746")
          If NOT @ ERROR Then
	       ControlSend($title, "", "", "{3}")
	  Else
	       ControlSend($title, "", "", "{Tab}")
	  EndIf
WEnd
11/05/2012 15:01 mlukac89#3
Still dont work when i run it its press TAB 4-5 times and stop but wont press 3 to attack mob here is whold script

Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <Color.au3>
#include <Array.au3>

Global $Paused

$title = ("Archlord")
WinActivate($title)

 ; HotKeys
 HotKeySet("{F8}", "TogglePause")
 HotKeySet("{F9}", "_Quit")


; Coords of hunt area
$xTop = 143
$yTop = 119
$xBot = 882
$yBot = 582

; Mob color
$mobcolor = "0xF94746"

; Mob hp
$xMobhp = 409
$yMobhp = 41
$mobhpcolor = "0xF74A48"

; Pause bot
Func TogglePause()
	$Paused = NOT $Paused
	While $Paused
		Sleep(100)
		ToolTip("Bot is paused" ,0 ,0)
	WEnd
	ToolTip("")
EndFunc

; Exits bot
Func _Quit()
   Exit
EndFunc

; Main action
While True
     PixelSearch ($xTop, $yTop, $xBot, $yBot, $mobcolor, 10)
          If NOT @error Then
	       ControlSend($title, "", "", "{3}")
	  Else
	       ControlSend($title, "", "", "{Tab}")
	  EndIf
WEnd
here is pic of mob hp bar [Only registered and activated users can see links. Click Here To Register...]

so i need something like this

Code:
; send tab to get mob
ControlSend($title, "", "", "{Tab}") 

; scan mob bar for color if is mob alive kill it
ControlSend($title, "", "", "{3}")

if not

; send tab again
ControlSend($title, "", "", "{Tab}")

...............................
sry if is stupid question or request by im new in this i was read many tutorials and cant got in to work