Просмотр исходного кода

I guess there was a reason I did this

Zachary Kotlarek 12 лет назад
Родитель
Сommit
3dc99fc799
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      dmx/projectorPower.pl

+ 4 - 1
dmx/projectorPower.pl

@@ -296,7 +296,10 @@ while (1) {
 		# Announce lamp life status, if near/past $LAMP_LIFE
 		if (exists($exists{'PROJECTOR_LAMP'})) {
 			if ($life > 0.9) {
-				DMX::say('Projector lamp has run for ' . int($life * 100) . '% of its estimated life.');
+				my $chance = ($life - 0.9) * 10;
+				if (rand(1) <= $chance) {
+					DMX::say('Projector lamp has run for ' . int($life * 100) . '% of its estimated life.');
+				}
 			}
 		}