Jump to content

Merging 2 differnet scripts


SOB
 Share

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
Link to comment
Share on other sites

  • Developers

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 

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.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...