Sserpy Posted December 19, 2016 Posted December 19, 2016 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
Sserpy Posted December 19, 2016 Author Posted December 19, 2016 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
Moderators JLogan3o13 Posted December 19, 2016 Moderators Posted December 19, 2016 @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. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts