View Single Post
Problems with PixelSearch.
Old
  (#1 (permalink))
RaZzor is Offline
**** the system.
RaZzor is on a distinguished road
 
RaZzor's Avatar
 
Posts: 954
Credits: 76
Spent time on board: 1 Day and 4:56:02 Hours
Join Date: Dec 2004
Location: Germany
Reputation: 20
Rep Power: 5
 Send a message via ICQ to RaZzor  
Default Problems with PixelSearch. - 08-17-2007, 06:03 AM

Hello everyone.

I didn't really know in which forum to post this, but my script is more a bot than a hack, so here it is.

Quote:
AutoItSetOption ( "MouseCoordMode", 0 ) ; Do not change this parameter! It's needed for windowed D2.
AutoItSetOption ( "PixelCoordMode", 0 ) ; Do not change this parameter! It's needed for windowed D2.

HotKeySet ( "{PGUP}", "PickIt" ) ; Hotkey to activate the main PickIt function
HotKeySet ( "{PGDN}", "Pause" ) ; Hotkey to pause the script
HotKeySet ( "{END}", "Terminate" ) ; Hotkey to terminate the script

While 1 ; This makes the script sleep until you execute one of the declared functions, so it doesn't go nuts :P
Sleep ( 100 )
WEnd

Func Pause() ; Pause Function
Sleep ( 100 )
EndFunc

Func PickIt() ; Main PickIt Function. It searchs a pixel in D2 window which has the declared and then performs a left click onto it if the declared color exists.
$PixelSearch = PixelSearch ( 0, 600, 860, 0, 958166, )
If Not @error Then
MouseClick ( "Left", $PixelSearch[0] & "," & $PixelSearch[1], )
EndIf
EndFunc

Func Terminate() ; Terminate function
Exit 0
EndFunc
The idea behind this is a PickIt program. I thought that it should be possible to make the script click onto pixels colored in #958166 (the color which is used for the unique tag in D2). Now, the problem is, that it doesn't do anything. The termination function is the only part which is working at the moment.

I hope that someone could help me out with that.. :P
  
Reply With Quote