Jump to content

Array with Pixelsearch?


Hok
 Share

Recommended Posts

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...

Link to comment
Share on other sites

$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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

$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!
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...