Jump to content
Sign in to follow this  
Hok

Array with Pixelsearch?

Recommended Posts

Hok

So here is my script...

$Color = 0x00000000
$MousePos = MouseGetPos()
$ColorVariation = 20

$Left = $MousePos[0]-[50]
$Top = $MousePos[1]+[50]
$Right = $MousePos[0]+[50]
$Bottom = $MousePos[1]-[50]

Func Click()
If WinActive ( "[Conquer2.0]", "" ) then
$ShadowCoords = PixelSearch ($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
If @error=1 Then
    MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
Else
    MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
EndIf

EndIf
EndFunc

It has a problem with the part with:

$Left = $MousePos[0]-[50]
$Top = $MousePos[1]+[50]
$Right = $MousePos[0]+[50]
$Bottom = $MousePos[1]-[50]

I get a syntax error for every line...

Share this post


Link to post
Share on other sites
Valuater

$Color = 0x00000000
$MousePos = MouseGetPos()
$ColorVariation = 20

$Left = $MousePos[0] - 50
$Top = $MousePos[1] + 50
$Right = $MousePos[0] + 50
$Bottom = $MousePos[1] - 50

Func Click()
    If WinActive("[Conquer2.0]", "") Then
        $ShadowCoords = PixelSearch($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
        If @error = 1 Then
            MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
        Else
            MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
        EndIf
    EndIf
EndFunc   ;==>Click

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

But, I think these are the coordinates you want.

$Color = 0x00000000
$MousePos = MouseGetPos()
$ColorVariation = 20

$Left = $MousePos[0] - 50
$Top = $MousePos[1] - 50
$Right = $MousePos[0] + 50
$Bottom = $MousePos[1] + 50

Func Click()
    If WinActive("[Conquer2.0]", "") Then
        $ShadowCoords = PixelSearch($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
        If @error = 1 Then
            MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
        Else
            MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
        EndIf
    EndIf
EndFunc   ;==>Click

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Hok

$Color = 0x00000000
$MousePos = MouseGetPos()
$ColorVariation = 20

$Left = $MousePos[0] - 50
$Top = $MousePos[1] + 50
$Right = $MousePos[0] + 50
$Bottom = $MousePos[1] - 50

Func Click()
    If WinActive("[Conquer2.0]", "") Then
        $ShadowCoords = PixelSearch($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
        If @error = 1 Then
            MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
        Else
            MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
        EndIf
    EndIf
EndFunc   ;==>Click

8)

Thanks!

Share this post


Link to post
Share on other sites
Hok

Sorry but a new problem just came up >.<

While 1

HotKeySet("!x", Click())

WEnd

I replaced that with what I previously had and I got an error: Invalid Function name.

But, if I have it like I have before, nothing happens when I press Alt+X

Share this post


Link to post
Share on other sites
Valuater

Local $MousePos = MouseGetPos()

Global $Color = 0x00000000
Global $ColorVariation = 20
Global $Left = $MousePos[0] - 50
Global $Top = $MousePos[1] - 50
Global $Right = $MousePos[0] + 50
Global $Bottom = $MousePos[1] + 50

HotKeySet("{ESC}", "Terminate")
HotKeySet("!x", "Click")

While 1
    Sleep(100)
WEnd


Func Click()
    If WinActive("[Conquer2.0]", "") Then
        $ShadowCoords = PixelSearch($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
        If @error = 1 Then
            MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
        Else
            MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
        EndIf
    EndIf
EndFunc   ;==>Click

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate


NEWHeader1.png

Share this post


Link to post
Share on other sites
Hok

Local $MousePos = MouseGetPos()

Global $Color = 0x00000000
Global $ColorVariation = 20
Global $Left = $MousePos[0] - 50
Global $Top = $MousePos[1] - 50
Global $Right = $MousePos[0] + 50
Global $Bottom = $MousePos[1] + 50

HotKeySet("{ESC}", "Terminate")
HotKeySet("!x", "Click")

While 1
    Sleep(100)
WEnd


Func Click()
    If WinActive("[Conquer2.0]", "") Then
        $ShadowCoords = PixelSearch($Left, $Top, $Right, $Bottom, $Color, $ColorVariation, 2)
        If @error = 1 Then
            MsgBox(16, "Aimbot ERROR", "No black pixel found within 100 pixels of the mouse")
        Else
            MouseClick("Right", $ShadowCoords[0], $ShadowCoords[1])
        EndIf
    EndIf
EndFunc   ;==>Click

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Thanks, but it was actually just a problem with the window name...

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×