Matrix Command Window

Author Message
mcsajames

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 12/2/2010
  • Status: offline
Matrix Command Window Thursday, December 02, 2010 5:00 PM (permalink)
0

I wrote the following as a challenge from a coworker. It is pretty simple. It just brings up a command window and types in the same phrases that were used in the movie Matrix. It does have a random millisecond pause between each keystroke, to emulate typing. I hope there's nothing against posting something like this.

'Begin Script
Randomize
'to make sure the value is truly random for each keystroke
set objShell = WScript.CreateObject("WScript.Shell")
'The below launches the command line, goes to the c drive,
'changes the title to Matrix, turns of the c:\> prompt, and
'clears the messages on the screen
objShell.run "cmd /K C: & title Matrix & echo off & cls"
' 1 second pause to make sure the command window had a second to come up
slp 1000
'Send the words wake up, neo to the command window one key stroke at a time
splitstring "Wake up, Neo..."
slp 2000
'sends the Esc key to the command window to clear the typing -wake up, neo
SK "{ESC}"
splitstring "The Matrix has you..."
slp 2500
SK "{ESC}"
splitstring "Follow the white rabbit."
slp 2000
SK "{ESC}"
SK "Knock, knock, Neo."
slp 4000
SK "{ESC}exit{ENTER}"
sub splitstring (strng)
'This sub routine splits the string - strng- into one letter sections,
'runs the SK (SendKeys) sub for each letter, and has a random
'sleep/ pause in between each letter from 50-200 milliseconds
i=1
do until i>len(strng)
Char1=mid(strng,i,1)
SK Char1
wscript.sleep Int((200 * Rnd) + 50)
i=i+1
loop
End sub

sub SK(keys)
'Make sure the command window with the title -Matrix is selected
objShell.AppActivate "Matrix"
'send the key strokes -keys to the matrix window
objShell.SendKeys(keys)
End Sub

sub slp(ms) 'sleep however many millisecond specified
wscript.sleep ms
End Sub


<message edited by mcsajames on Thursday, December 02, 2010 5:17 PM>
 
#1
    Fredledingue

    • Total Posts : 572
    • Scores: 2
    • Reward points : 0
    • Joined: 5/9/2005
    • Location: Europe
    • Status: offline
    Re:Matrix Command Window Thursday, December 09, 2010 11:04 AM (permalink)
    0
    Yeah,... Do you have a script so that I can actualy materialize myself inside ny computer memory? ;)
    Fred
     
    #2
      Fredledingue

      • Total Posts : 572
      • Scores: 2
      • Reward points : 0
      • Joined: 5/9/2005
      • Location: Europe
      • Status: offline
      Re:Matrix Command Window Thursday, December 09, 2010 5:05 PM (permalink)
      0
      I did my own green Matrix monitor screen:
      Click here for the code and everything!

      Have fun!
      Fred
       
      #3
        Fredledingue

        • Total Posts : 572
        • Scores: 2
        • Reward points : 0
        • Joined: 5/9/2005
        • Location: Europe
        • Status: offline
        Re:Matrix Command Window Saturday, December 11, 2010 1:59 AM (permalink)
        0
        It's an interresting way to observe random generation of characters.
        I thought I'd see more alfanumeric characters here...
        Fred
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9