Skip to content

Instantly share code, notes, and snippets.

@iokiwi
Created August 3, 2016 03:16
Show Gist options
  • Select an option

  • Save iokiwi/51b730903443957753efd06e07c912ea to your computer and use it in GitHub Desktop.

Select an option

Save iokiwi/51b730903443957753efd06e07c912ea to your computer and use it in GitHub Desktop.
A windows basic script the
'**************************************************
'Name: DONT CLICK ME
'File: DONT CLICK ME.vbs
'Date: 12/11/14
'Breif: A script to mess with windows computers in
' a harmless but fun manner
'**************************************************
VERBOSE = false
IS_RANDOM = false
MIN_DELAY = 0
MAX_DELAY = 300
INITIAL_DELAY = 10
STANDARD_DELAY = 120
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
Sub print(p)
WScript.Echo p
End Sub
Sub print_array(p)
For i = 0 to p.Count - 1
print(p.Item(i))
Next
End Sub
Sub eject_drive(drive)
drive.Eject()
drive.Eject()
End Sub
Sub wait_t(t)
wait_msec = t*1000
WScript.Sleep(wait_msec)
End Sub
Function get_random_t()
Randomize
get_random_t = Int((MAX_DELAY-MIN_DELAY+1)*Rnd+min)
End Function
Function get_wait_time()
If IS_RANDOM then
get_wait_time = get_random_t()
else
get_wait_time = STANDARD_DELAY
End If
End Function
Sub main_procedure()
For i = 0 to colCDROMS.Count - 1
eject_drive(colCDROMs.Item(i))
Next
End Sub
Sub help()
print("Usage:")
print("DONT CLICK ME.vbs [-help]|[-v][-d|-c|-r][-init=][-min=][-max=][-std=]")
print("-help Show the help information for script usage")
print("-v Operate in verbose mode")
print("-d Use the default timing parameters")
print("-c Use timing parameters to open and close the optical constantly")
print("-r Use random wait time interval")
print("|THE BELOW COMMANDS ARE EXPERIMENTAL OR HAVE NOT BEEN IMPLEMENTED|")
print("-min= Set the minimum random delay time in seconds")
print("-max= Set the maximum random delay time in seconds")
print("-std= Set the standard delay time in seconds")
print("-init= Set the initial delay time in seconds")
WScript.Quit
End Sub
Sub process_command_line_arguments(argv)
For i = 0 to argv.Count - 1
Select Case argv.Item(i)
Case "-help"
help()
Case "-d"
IS_RANDOM = false
Case "-r"
IS_RANDOM = true
Case "-v"
VERBOSE = true
Case "-c"
INITIAL_DELAY = 0
STANDARD_DELAY = 0
Case Else
help()
End Select
Next
End Sub
Sub init()
argc = WScript.Arguments.Count
Set argv = WScript.Arguments
If argc > 0 then
process_command_line_arguments(argv)
End If
If VERBOSE = true then
print_array(argv)
End If
End Sub
Sub Run()
init()
wait_t(INITIAL_DELAY)
Do
main_procedure()
wait_t(get_wait_time())
Loop
End Sub
Run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment