Search the Community
Showing results for tags 'or'.
-
Dear All, I have been in SL quite a few years, but my scripting skills are still quite raw. I'm after some tips please to reduce my scripting down to less lines, as I am sure there must be a better way and I just can't understand on the wiki as they don't always explain all the possible configurations. I want to check the value of a time is between certain minutes (i.e. between 21and 30, between 31 and 40, between 41 and 50 or above 50) so that my "speaking clock" will read out "20","30","40" or "50" before it reads the minutes (i.e. "50" "1" for 51 minutes. Could anybody kindly help me in getting the syntax right so that it can check all of the above in one "IF" instead of having to do IF > ELSE in the same way I have? I'm basically hoping to say something like if (Minute>=21 && Minute<30) or (Minute>=31 && Minute<40) or (Minute>=41 && Minute<50) or (Minute>50) For your reference "Minute" is the variable taken from the time and represents the minutes in the hour. unimin = the unit measurement of the minutes, decmin = the tens measurement of the minutes (i.e. if the time is 15:34 then the decmin would equal "3" and the unimin would equal "4") a snippet of my huge code below - Thank you so much in advance!! if (Minute>=21 && Minute<30) { if (unimin==1) { llPlaySound("1",1.0); } else if (unimin==2) { llPlaySound("2",1.0); } else if (unimin==3) { llPlaySound("3",1.0); } else if (unimin==4) { llPlaySound("4",1.0); } else if (unimin==5) { llPlaySound("5",1.0); } else if (unimin==6) { llPlaySound("6",1.0); } else if (unimin==7) { llPlaySound("7",1.0); } else if (unimin==8) { llPlaySound("8",1.0); } else if (unimin==9) { llPlaySound("9",1.0); } } else if (Minute>=31 && Minute<40) { if (unimin==1) { llPlaySound("1",1.0); } else if (unimin==2) { llPlaySound("2",1.0); } else if (unimin==3) { llPlaySound("3",1.0); } else if (unimin==4) { llPlaySound("4",1.0); } else if (unimin==5) { llPlaySound("5",1.0); } else if (unimin==6) { llPlaySound("6",1.0); } else if (unimin==7) { llPlaySound("7",1.0); } else if (unimin==8) { llPlaySound("8",1.0); } else if (unimin==9) { llPlaySound("9",1.0); } } else if (Minute>=41 && Minute<50) { if (unimin==1) { llPlaySound("1",1.0); } else if (unimin==2) { llPlaySound("2",1.0); } else if (unimin==3) { llPlaySound("3",1.0); } else if (unimin==4) { llPlaySound("4",1.0); } else if (unimin==5) { llPlaySound("5",1.0); } else if (unimin==6) { llPlaySound("6",1.0); } else if (unimin==7) { llPlaySound("7",1.0); } else if (unimin==8) { llPlaySound("8",1.0); } else if (unimin==9) { llPlaySound("9",1.0); } } else if (Minute>50) { if (unimin==1) { llPlaySound("1",1.0); } else if (unimin==2) { llPlaySound("2",1.0); } else if (unimin==3) { llPlaySound("3",1.0); } else if (unimin==4) { llPlaySound("4",1.0); } else if (unimin==5) { llPlaySound("5",1.0); } else if (unimin==6) { llPlaySound("6",1.0); } else if (unimin==7) { llPlaySound("7",1.0); } else if (unimin==8) { llPlaySound("8",1.0); } else if (unimin==9) { llPlaySound("9",1.0); } } else if (Minute<10) { if (unimin==1) { llPlaySound("1",1.0); } else if (unimin==2) { llPlaySound("2",1.0); } else if (unimin==3) { llPlaySound("3",1.0); } else if (unimin==4) { llPlaySound("4",1.0); } else if (unimin==5) { llPlaySound("5",1.0); } else if (unimin==6) { llPlaySound("6",1.0); } else if (unimin==7) { llPlaySound("7",1.0); } else if (unimin==8) { llPlaySound("8",1.0); } else if (unimin==9) { llPlaySound("9",1.0); } }