Jump to content

Recommended Posts

Posted

Hi I'm very new to Autoit and need some help with my script.

#include <ImageSearch2015.au3>

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{END}", "Terminate")

$x1 = 850
$y1 = 350
$x2 = 1050
$y2 = 550

$returnX = 0
$returnY = 0

$picture0 = "Spider.png"

$i = 0

While $i < 1000

   $result = _ImageSearchArea($picture0, 1, $x1, $y1, $x2, $y2, $returnX, $returnY, 155, 0)

   If $result = 1 Then
      MouseMove ($returnX, $returnY, 0.001)
      Sleep (100)
      MouseDown($MOUSE_CLICK_LEFT)
      Sleep (20)
      MouseUp($MOUSE_CLICK_LEFT)
   EndIf
WEnd

Func TogglePause()
   $Paused = NOT $Paused
   While $Paused
       sleep(100)
       ToolTip($paused&'Script is "Paused"',0,0)
   WEnd
   ToolTip($paused)
EndFunc

Func Terminate()
   Exit 0
EndFunc

 

So what it does is it clicks on a bug to crush it. I have managed to get it work with 1 image(spider), but I can't get 3 images to get it work together.

So spider is added to the script, so I need to add cockroach and fly. Make it click on the first bug shows up randomly on the screen.

Can you experts help me please? and is there any tweaks I can do on my script so that the click is more accurate.

Thank you

screenshot here

Bugs.png

  • Developers
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...