'Use: from the command line type: "cscript leds.vbs [display_type] [speed_of_leds]" 'Note!: Ensure that all CAPSLOCK, NUMLOCK and SCRLK are turned off before running the script --" 'By: John Tregoning | monkeylaser.com 'Why?: Learn basic programming (parameters,if statements,etc) while having fun without the need to install anything on your default Windows box. Option Explicit Dim shShell, speed_of_leds, display_type set shShell = CreateObject("WScript.Shell") if Wscript.Arguments.Count = 0 Then 'Default values display_type = 1 speed_of_leds = 150 elseif Wscript.Arguments.Count = 1 Then display_type = WScript.Arguments(0) speed_of_leds = 150 elseif Wscript.Arguments.Count = 2 Then display_type = WScript.Arguments(0) speed_of_leds = WScript.Arguments(1) end if 'This is needed to start the display correctly 'shShell.SendKeys "{NUMLOCK}" 'WScript.Sleep(speed_of_leds) do '## Knight Rider ## if display_type = 1 then shShell.SendKeys "{NUMLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{NUMLOCK}" shShell.SendKeys "{CAPSLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{CAPSLOCK}" shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{CAPSLOCK}" shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{NUMLOCK}" shShell.SendKeys "{CAPSLOCK}" shShell.SendKeys "{NUMLOCK}" '## Music ## elseif display_type = 2 then shShell.SendKeys "{NUMLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{CAPSLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) WScript.Sleep(speed_of_leds) shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{CAPSLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{NUMLOCK}" WScript.Sleep(speed_of_leds) WScript.Sleep(speed_of_leds) '## Alert ## elseif display_type = 3 then shShell.SendKeys "{NUMLOCK}" shShell.SendKeys "{ScrollLock}" shShell.SendKeys "{CAPSLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{NUMLOCK}" shShell.SendKeys "{CAPSLOCK}" shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) WScript.Sleep(speed_of_leds) '## Highway ## elseif display_type = 4 then shShell.SendKeys "{NUMLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{NUMLOCK}" shShell.SendKeys "{CAPSLOCK}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{CAPSLOCK}" shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) shShell.SendKeys "{ScrollLock}" WScript.Sleep(speed_of_leds) WScript.Sleep(speed_of_leds) '## x-mass ## elseif display_type = 2412 then 'For you to implement! 'Wrong parameter else wscript.echo "The number " & WScript.Arguments(0) & " is an incorrect parameter" exit do end if loop