Jump to content
SOB

Merging 2 differnet scripts

Recommended Posts

Hey Guys

 

I am pretty new to autoit and i wanted to learn how to merge 2 script as it will help me alot.  All i want is basically that script 1 to recognize an image and then automatically stop script 2 while its functioning. Also if possible i want a hotkey set for script 2 so that i can stop it when i want to while script  1 can always search for the specified image.  I am sorry if i am confusing :/ Thanks!

Script 1

#include <ImageSearch.au3>

global $y = 0, $x = 0

Func checkForImage()
Local $search = _ImageSearch('Image1.bmp', 0, $x, $y, 0)
If $search = 1 Then
MouseMove($x, $y, 10)
EndIf
EndFunc

while 1
sleep(200)
WEnd

 

Script 2 ( the loop)

WinActivate("document")
Sleep(5000)

HotKeySet("^!x", "MyExit")


For $x = 1 to 60
Send("{LEFT Down}")
sleep(600)
Send("{LEFT UP}")
sleep(100)
mouseclick("left",650,578)
Send("{RIGHT Down}")
sleep(650)
Send("{RIGHT UP}")
sleep(60)

While 1
    Sleep(100)
WEnd

Func MyExit()
    Exit
EndFunc

 

Edited by SOB

Share this post


Link to post
Share on other sites

Seriously MahM? 
You are banned for the next 7 days for your 3rd violation of our rules.
Do not try to do this again or the ban will be permanent.

This account will be disabled and your MahM account will get the 7 days posting ban.

Jos 

Share this post


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

×
×
  • Create New...