Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Need assistance with script

$
0
0
Hello I can't  seem to figure the last part of my script out so i'm posting here for possible help.

I'd like for when i turn it on, it scans the "2182, 437" area of my desktop here for the "16316667" color, when the color changes i want it to play the "music.wav" 3 times, and then wait for "16316667" to re-appear, once the color "16316667" has re-appeared then I'd like for it to start all over at the top, and wait until "16316667" has dissappeared.

Currently the error is: it seems to be stuck in an infinite loop of spamming 'music.wav' once the pixel changes and then it keeps repeating and not stopping, i'd like for it to stop until color "16316667" comes back.

Hope that makes sense, thanks =)



[ autoit ]         
Global $on=0 HotKeySet("{a}", "Music") While 1 Sleep(1000) WEnd Func Music() if $on=0 Then SoundPlay("H:\Music.wav"); On $on=1 Sleep(200) Else Beep(5500, 500) ; Off $on=0 Sleep(500) EndIf While $on=1 Sleep(1000) PixelSearch(2182, 437, 2182, 437, 16316667, 10) ;music If @error Then SoundPlay("H:\Music.wav") Sleep(10000) SoundPlay("H:\Music.wav") Sleep(10000) SoundPlay("H:\Music.wav") Else PixelSearch(2182, 437, 2182, 437, 16316667, 10) If Not @error Then EndIf EndIf WEnd EndFunc

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>