Jump to content
Sign in to follow this  
Sobiech

Clicking on one of two maches pixels

Recommended Posts

Sobiech

Maybe my code better explain my problem :D

#Include <Misc.au3>

Opt("MouseCoordMode", 2)
Opt("PixelCoordMode", 2)
Opt("mouseClickDelay", 1)
$IC_Unique0 = 0x7C6450
$IC_Unique1 = 0x948064
$Title = WinGetHandle("D2Loader v1.12 - Build On Jun 18 2008")

HotKeySet("{F1}", "_Exit")

While 1
If _IsPressed(12) Then
Sleep(Random(50,100))
$Uniq = PixelSearch(0, 0, 800, 600, $IC_Unique0, "", "", $title)
If PixelGetColor($Uniq[0], $Uniq[0]-1, $title) = $IC_Unique1 Then
MouseClick("left", $Uniq[0], $Uniq[1], 1, 1)
Else
ConsoleWrite("Something is wrong" & @CRLF)
EndIf
EndIf
WEnd

Func _Exit()
Exit
EndFunc

Posted Image

But it seems that "If expression" failed, I am sure that two pixels are matched on the screen after press "ALT"

Maybe my second MouseClick line is wrong?

I know, that i wanna create a simple bot clicker, but maybe some day i can help to someone on this forum, if i do this with your help :huggles:


This world is crazy

Share this post


Link to post
Share on other sites
Sobiech

I added this

$Uniq = PixelSearch(0, 0, 800, 600, $IC_Unique0, "", "", $title)
If PixelSearch(0, 0, 800, 600, $IC_Unique0, "", "", $title) & PixelGetColor($Uniq[0], $Uniq[1]+1) = $IC_Unique1 Then
ToolTip("Ok, I have found two pixels. Now i must click on one of these pixels")
Else
ToolTip("Ok, I have bad night :(")
EndIf

I know where is the problem. Game window have many $IC_Unique0 pixels, and when PixelSearch find that pixel, then stop looking next pixels...

$Uniq = PixelSearch(0, 0, 800, 600, $IC_Unique0, "", "", $title)
If PixelSearch(0, 0, 800, 600, $IC_Unique0, "", "", $title) & PixelGetColor($Uniq[0], $Uniq[1]+1) = $IC_Unique1 Then ;Ok found first pixel, but second is other than $IC_Unique1... Program get only first instruction and second (after "&") go away for him :(
ToolTip("Ok, I have found two pixels. Now i must click on one of these pixels")
Else
ToolTip("Ok, I have bad night :(")
EndIf

Please Help :D

Btw. Where is difference between "&" and "And"?


This world is crazy

Share this post


Link to post
Share on other sites
Sobiech

Is this possible to click on pixels checksum? i saw these topics

http://www.autoitscript.com/forum/index.php?showtopic=63318

and

http://www.autoitscript.com/forum/index.php?showtopic=95623&st=0&gopid=766569&#entry766569

But i cant use this to clicking :D


This world is crazy

Share this post


Link to post
Share on other sites
Sobiech

Maybe is there any method to continue searching pixel after found first of eg. 10?

Program always stop on first pixel =|


This world is crazy

Share this post


Link to post
Share on other sites
JohnOne

You are persistent.

Let me explain incase you havent noticed, to try and save you some time.

Making cheats for games is frowned upon for the most here, espeasially those online multiplayer which is against the TOS of the host.

Im going to go out on a limb and suggest your cheat is for Diablo II (D2loader)

You are flogging a dead horse here mate.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Valik

We will not help you automate games when it's against the TOS for that game. I would have thought you understood that when I banned you the first time for releasing a bot for Diablo II. Next time you breathe the word Diablo II on this forum you will be gone.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.