How to code multiple alerts?

 

Hello,


I want to have multiple sound alerts on a certain condition. I try to, but it seems failed.

Here is the code :


if(condition_is_meet() and once_a_candle())
 {
    Repetition=10;
    Alert("Arrow down");
    Sleep(10);   
    for(int s=Repetition-2;s>=0;s--)
     {
       PlaySound("Alert.wav");
       Sleep(10);
     } 
 }

I set the loop from "Repetition minus 2" because the first sound is "Alert("Arrow Down");"


Any suggestion is very appreciate. Thank you

 

Hello,


Is there anybody could assist me?

 
Try Sleep(1000) or maybe even 2000. 10 is way too short a time.
 

Hi Jtr,


Thanks for your respond. I was using 1000, but it's not working, I thought it's too long so I make it shorter.

Any other suggestion maybe?

 
I tested your code with 1000 and the repeating sound works. Check that your if conditions are allowing the code to run. Also remember a tick has to occur for the script to be run.
 

Really?

Thanks, I'll check it out again.