Ijaz Posted September 12, 2017 Share Posted September 12, 2017 Hello! every body. I am new to programming........... I already have a working code for PixelChecksum but i am unable to make it loop after completion. existing code is this: ----------------------------------------------------------------------------------------------------------------------------------- #include <MsgBoxConstants.au3> ; Wait until something changes in the region 0,0 to 50,50 ; Get initial checksum Local $iCheckSum = PixelChecksum(0, 0, 50, 50) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $iCheckSum = PixelChecksum(0, 0, 50, 50) Sleep (100) WEnd SoundPlay(@WindowsDir & "\media\tada.wav",1) MsgBox($MB_SYSTEMMODAL, "", "There is a pixel color change!") ------------------------------------------------------------------------------------------------------------------ 1- I need that after execution of all code it should automatically start again from beginning and wait for another pixel color change. 2- i need to play sound file continuously until i click OK on message box. for now sound file plays only for 01 time. any help will be appreciated. thanks in advance. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 12, 2017 Share Posted September 12, 2017 Hi @Ijaz, and welcome to the AutoIt forum Can I ask you for what purpose are you doing this? By the way, you should insert another While...WEnd loop, in order to have your checksum continuosely Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Ijaz Posted September 12, 2017 Author Share Posted September 12, 2017 40 minutes ago, FrancescoDiMuro said: Hi @Ijaz, and welcome to the AutoIt forum Can I ask you for what purpose are you doing this? By the way, you should insert another While...WEnd loop, in order to have your checksum continuosely Thanks dear, I already have done it and it is working fine now. now the problem is how to repeat sound file until i press ok button on the message box. thanks for your kind reply. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 12, 2017 Share Posted September 12, 2017 3 minutes ago, Ijaz said: Thanks dear, I already have done it and it is working fine now. now the problem is how to repeat sound file until i press ok button on the message box. thanks for your kind reply. @Ijaz Just put another While...WEnd loop with the MsgBox that returns a value ( like $MB_YESNO ), and wait for the value Yes or No... Until the Yes or No is pressed, then play the sound Hope that helps Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Ijaz Posted September 12, 2017 Author Share Posted September 12, 2017 3 minutes ago, FrancescoDiMuro said: @Ijaz Just put another While...WEnd loop with the MsgBox that returns a value ( like $MB_YESNO ), and wait for the value Yes or No... Until the Yes or No is pressed, then play the sound Hope that helps Please can you give an example because i am new to programming. so it is better if you show me some example of it. i already posted my code. thanks alot. Link to comment Share on other sites More sharing options...
Ijaz Posted September 14, 2017 Author Share Posted September 14, 2017 Thanks I found the solution. I made sound loop with another scripting language AutoHotkey and then called this autohotkey script from autoit. now working fine. anyway thanks for helping me. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 14, 2017 Developers Share Posted September 14, 2017 44 minutes ago, Ijaz said: I made sound loop with another scripting language AutoHotkey and then called this autohotkey script from autoit. Ah the sledgehammer approach for getting the nail in... sweet! 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now