Challenge of the day.

By GoldFish on Jun 15, 2010

Honestly the most pointless script I have ever made (which is saying something). It lets people type !cotd (even in query ;D) to see the "Challenge of the day." type /cotd to set the challenge of the day. By the way, the * wildcard is so people with color scripts can still use it. It's not that significant though.

on *:text:*!cotd:?:{ 
  if (%cotd == $null) || if (!%cotd) {
    notice $nick No challenge today, sorry :(
  }
  else {
    notice $nick Challenge of the day: %cotd
    echo -a 2Cotd sent to $nick $+ .
  }
}

alias cotd {
  set %cotd $$?=Challenge of the day:
}

Comments

Sign in to comment.
Jethro   -  Jun 23, 2010

If you like to use a mass amount of if statements pointlessly, you might wanna experiement with goto (not the example shown in the help file), which you don't have to have mirc go through each and every one of if statement (they'll be unneeded) to process their routines.

 Respond  
GoldFish   -  Jun 23, 2010

ok

 Respond  
Aucun50   -  Jun 22, 2010

Never said there was, i just like using if statements pointlessly.

 Respond  
Jethro   -  Jun 22, 2010

There's nothing wrong with using the if statement, but not in an overkill manner. Make use of the && and || operator whenever you can.

 Respond  
GoldFish   -  Jun 22, 2010

:P

 Respond  
Aucun50   -  Jun 18, 2010

/me slaps SunnyD around with an if statement

 Respond  
Sorasyn   -  Jun 16, 2010

for those immature fuckers lol jk

 Respond  
Jethro   -  Jun 15, 2010

You text event can be:

on *:text:!cotd:?:{ 
  notice $nick $iif(!%cotd,No challenge today $+ $chr(44) sorry,Challenge of the day: %cotd) 
  echo -a 2Cotd sent to $nick $+ .
}

Which saves about 20 bytes. Also, you should always be aware that such script runs the risk of being spammed or flooded. You should implement a trigger control just to be on the safe side.

 Respond  
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.