Jump to content
Sign in to follow this  
Zibit

Need help with pixelsearch...

Recommended Posts

Zibit

; Find a pure red pixel in the range 0,0-20,300
Opt("MustDeclareVars", 0)
HotKeySet("+!d", "main")  ;Shift-Alt-d
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
While 1
    Sleep(100)
WEnd

func main()
$hcoord = MouseGetPos()
$coord = PixelSearch( 400, 300, 300, 100, 0xFF0000, 10 )
TrayTip("Working!", "Avp2 aimbot is working!", 5, 1) 
If Not @error Then
    sleep(100)
    MouseClick("left", $coord[0], $coord[1], 25)
EndIf
endfunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

could u help with this it says "Error: Subscript used with non-Array variable."

Share this post


Link to post
Share on other sites
Zibit

no im pretty much sure that the problem is in "MouseClick("left", $coord[0], $coord[1], 25)"

but ive been trying to fix it for quite a while... ( and dont worry, the only reason im doing this bot is to prove that character skins should be catagorized as hacks )

Share this post


Link to post
Share on other sites
Jos

no im pretty much sure that the problem is in "MouseClick("left", $coord[0], $coord[1], 25)"

but ive been trying to fix it for quite a while... ( and dont worry, the only reason im doing this bot is to prove that character skins should be catagorized as hacks )

Again: You need to test for the success of Pixelsearch() because when it fails it will notr return an Array resulting in this error. Test for @error directly after the PixelSearch() statement!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×