Cool Meter

By Minoglem on Feb 17, 2014

Wanna see how cool you are? Well try this out! Add it into the remotes section.
Note: Percentage is random..
Syntax: !Coolmeter

on *:TEXT:!Coolmeter:#: {
    if (!$var(%flood)) {
      .timer 1 1 msg # 1is collecting coolness percentage...
      .timer 1 5 msg # 2is done collecting coolness percentage! Let's see how cool you are $nick !
      var %tm = timer 1 8 msg $chan
      var %cool = $rand(1,20)
      if (%cool == 1) %tm 4 $nick you are 0% cool! Also known as 100% LAME!
      if (%cool == 2) %tm 4 $nick you are 5% cool!
      if (%cool == 3) %tm 4 $nick you are 10% cool!
      if (%cool == 4) %tm 4 $nick you are 15% cool!
      if (%cool == 5) %tm 4 $nick you are 20% cool!
      if (%cool == 6) %tm 4 $nick you are 25% cool!
      if (%cool == 7) %tm 4 $nick you are 30% cool!
      if (%cool == 8) %tm 4 $nick you are 35% cool!
      if (%cool == 9) %tm 4 $nick you are 40% cool!
      if (%cool == 10) %tm 4 $nick you are 45% cool!
      if (%cool == 11) %tm 4 $nick you are 50% cool!
      if (%cool == 12) %tm 4 $nick you are 55% cool!
      if (%cool == 13) %tm 4 $nick you are 60% cool!
      if (%cool == 14) %tm 4 $nick you are 65% cool!
      if (%cool == 15) %tm 4 $nick you are 70% cool!
      if (%cool == 16) %tm 4 $nick you are 75% cool!
      if (%cool == 17) %tm 4 $nick you are 80% cool!
      if (%cool == 18) %tm 4 $nick you are 85% cool!
      if (%cool == 19) %tm 4 $nick you are 90% cool!
      if (%cool == 20) %tm 4 $nick you are 95% cool!
      if (%cool == 25) %tm 4 $Nick you are 100 cool! YOU'RE AWESOME! 

Comments

Sign in to comment.
Vegito   -  Feb 19, 2014

You could do something like this.

on *:TEXT:!Coolmeter:#: {
  .timer 1 1 msg # 1is collecting coolness percentage...
  .timer 1 5 msg # 2is done collecting coolness percentage! Let's see how cool you are $nick !
  var %cool $r(0,100) | while ($calc(%cool % 5) != 0) %cool = $r(0,100)
  .timer 1 8 msg # 4 $nick you are %cool $+ % cool! $iif(%cool = 0,Also known as 100% LAME!,$iif($v1 = 100,YOU'RE AWESOME!,)) 
}
 Respond  
Sorasyn   -  Feb 17, 2014

That's quite the broken piece of code you've brought to us today. Did you not do any basic testing or debugging?

First off, you don't have any closing brackets for anything. That'll cause all sorts of problems.

Lastly, you have a random integer generator for numbers 1 through 20, but check through 25.

Conscious  -  Feb 18, 2014

In addition, the floor detection doesn't actually change, it's just checking. Also, most of the if statements are unnecessary. If the intervals of 5 are desired, one could simply calculate $rand(1,25) then multiply it by 4. With that in mind, this entire snippet could be condensed to about 4 lines.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.