Sign in to follow this  
Followers 0
Sserpy

Is it possible to make sure that mouse only clicks on the correct color after pixelsearch

3 posts in this topic

Hello brainiacs

I am playing an anoying game in browser where i need to press the right christmas hearts. The problem is sometimes they get covered by the wrong hearts and it seems like there is a small delay between pixelsearch and mouse click so i hit the wrong heart when it swing over the right one. I am extremely new to programming but i would apreciate all the help i can get.

Heres the code..

#include <AutoItConstants.au3>

Local $Paused

HotKeySet ("{ENTER}", "Start")
HotKeySet ("{ESC}", "Exit")
HotKeySet("{p}", "pause")

Func pause()
    $Paused = NOT $Paused
    While $Paused
        Sleep(100)
        Tooltip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

While 1
Sleep(0)
WEnd

Func Start()
While 1
$pxs = PixelSearch(1390,900,50,400,0xED1A3B)
If isArray($pxs) then
MouseMove($pxs[0],$pxs[1], 0)
MouseClick("left", $pxs[0]-5, $pxs[1], 1, 0)
EndIf
 Sleep (180)
WEnd
EndFunc

 

Share this post


Link to post
Share on other sites



Hello brainiacs

I am playing an anoying game in browser where i need to press the right christmas hearts. The problem is sometimes they get covered by the wrong hearts and it seems like there is a small delay between pixelsearch and mouse click so i hit the wrong heart when it swing over the right one. I am extremely new to programming but i would apreciate all the help i can get.

Heres the code..

#include <AutoItConstants.au3>

Local $Paused

HotKeySet ("{ENTER}", "Start")
HotKeySet ("{ESC}", "Exit")
HotKeySet("{p}", "pause")

Func pause()
    $Paused = NOT $Paused
    While $Paused
        Sleep(100)
        Tooltip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

While 1
Sleep(0)
WEnd

Func Start()
While 1
$pxs = PixelSearch(1390,900,50,400,0xED1A3B)
If isArray($pxs) then
MouseMove($pxs[0],$pxs[1], 0)
MouseClick("left", $pxs[0]-5, $pxs[1], 1, 0)
EndIf
 Sleep (180)
WEnd
EndFunc

 

Share this post


Link to post
Share on other sites

@Sserpy you seem to have missed the forum rules on your way in. I would suggest reading them now, especially the part about game automation, and you will see why this topic is locked.


√-1 2^3 ∑ π, and it was delicious!

Share this post


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