Jump to content

Need help with pixelsearch...


Zibit
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

The "If Not @error Then" is done for TrayTip and not for Pixelsearch as you probably want.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 )

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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