Jump to content

PixelSearch not working


Recommended Posts

Hey guys, im kinda new to auto it script.

Im making a bot for a game called Diablo II, so far i have the login on lockdown, now i need to focus on pixelsearch for finding enemy's which have been modded to look completely black.

heres my pixelsearch code for testing purposes, why isnt it working?

Global $Paused
HotKeySet("{End}", "ExitProg");;To exit the progam
HotKeySet("{Home}", "StartProg");;To start the program
HotKeySet("{Insert}", "TogglePause");; Key to pause and unpause

While 1
Sleep(100);;;Waits for function call
Wend

Func StartProg()
$coord = PixelSearch( 0, 0, 1024, 768, 0x00FF00 )
If Not @error Then
MouseClick("Left",$coord[0],$coord[1])
#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info
MsgBox(64,"Sucess","Found T3h Color!")
#EndRegion --- CodeWizard generated code End ---

EndIf
EndFunc
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(1000000)
WEnd
EndFunc


Func ExitProg()
Exit 0;;;Exits the program
EndFunc

Thanks in advance.

Fixed it myself. A few questions to the experienced members, whats the difference between

dim $paused
and
global $Paused
? Edited by ecstatic
Link to comment
Share on other sites

How about you change the size of the sleep in the pause function to something more sensible?

As for the rest of it, have a search for the bot... its has probably been done before.

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