Please Disable Ad-Block To View This Website.

If you block ads, this site can not survive!

Ads are very minimal for registered users. If you don't have an account please register now!

DOWNLOAD
 Full Scripts
 Addons
 Snippets
 DLLs
 MTS Themes
 Tutorials
 Misc.
 File Queue
 Download mIRC
INTERACT
 Screenshots
 Challenge
 Top Downloads
 Submit Form
 Forums

SEARCH
Site Search

FRIENDS
Link to us!
PhotoShelf

Top Challenge Entrants

  # User Points
  1 jaytea 587
  2 [Znork] 303
  3 urza 297
  4 Ag2X 288
  5 dr_Eamer 255
  6 Albie 199
  7 Chessnut 197
  8 A Noniem 194
  9 zzattack 186
  10 Kol 185
  11 m910q 168
  12 Sephiroth 115
  13 patje 114
  14 Auron956 114
  15 chid 110
  16 Ohad2121 92
  17 SkorpSSS 87
  18 DixrouE 84
  19 Suchorski 83
  20 ^Vampire^ 74
Challenge:Smallest $switch
Start:September 14th 2009
End:September 22nd 2009
Description:

In this challenge you are asked to create an alias that will take the inputted switches (such as those you would put in a native mIRC command) and return the corresponding switch or its data if the .data property is supplied

Syntax:

$switch(<switches>,<N/switch char>)[.data]
If N is a number, it should return the Nth switch. If N is 0, it should return the total switches.

If char is supplied, it should return the same char if the switch exists.

.data can be supplied at any point and it should return the data for that switch i.e. for the Nth switch, or data for switch <char>.



Specifications:

  - A switch is a case-sensitive character a-z.
  - Each switch can have its own numerical data (may be negative and have decimals) following it;
$switch(a4b7,b) = b
The data may also be enclosed in quotes (" ");
$switch(a"switch a quote data"b"switch b quote data",b).data = switch b quote data


Validation

You can assume:
  • Checking for non-existent switches will be tested, in which case your alias should return $null
  • $2 will always be a letter (a-z or A-Z) or a whole number >= 0
  • $switch(<switches>,0).data will not be tested
  • If .data is supplied but the switch doesn't have any "data", your alias should return $null
  • Quotes with data can have any character in it but "
  • There will always be data within the quotes
  • No switch will be repeated twice


Example:

$switch(abc,0) = 3
$switch(abc,1) = a
$switch(abc,c) = c
$switch(abc,b).data = $null
$switch(abc,4) = $null
$switch(ab9z8.98,z).data = 8.98
$switch(mBv,z) = $null
$switch(mB"v"v"mB",B).data = v
$switch(mB"v"v"mB",v).data = mB
$switch($null,0) = 0
$switch($null,1) = $null
$switch(abc,0).data = NOT TESTED
$switch(a""b,a).data = NOT TESTED
$switch(aba,a) = NOT TESTED




Rules:

  • Tested in a clean, offline mIRC 6.35
  • Will be loaded in ALIASES section (i.e "switch {" -- NOT "alias switch {"
  • MUST HAVE closing bracket -- if not supplied it WILL be added on
  • No COMs, DLLs, or sockets
  • Alias must give correct results after consecutive runs