option explicite
On Error Resume Next
' déclarer des variables
Dim wshshell, titre, mystring, longueur, position, tmp, loopA, loopB, linesToWrite, colonnes, objUser, objSysInfo, monnom, myNameLength, col1, col2, col3, col4, col5, maximum, éléments
Set wshshell = wscript.createobject("wscript.shell")
titre = « the matrix »
WshShell. SendKeys « {ALT} » + « {ENTER} »
« Infos utilisateur, utilisé pour obtenir le nom
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject ("LDAP: / /" & objSysInfo.UserName)
' ---------------------------
void waitfor(var)
« configurer la fenêtre, affectez title, attendre qu’il se terminer
tmp = false
faire jusqu’au tmp
WScript.Sleep 1000
tmp = wshshell.appactivate(var)
boucle
EndSub
' ---------------------------
void matrix(elements)
« imprimer des nombres aléatoires pour réaliser « la matrice » Rechercher
"suppose des éléments est divisible par 5
colonnes = 5
col1 = true
col2 = true
COL3 = true
COL4 = true
col5 = true
Randomize()
linesToWrite = éléments / colonnes
loopA = 1 à linesToWrite
loopB = 1 à colonnes
Sélectionnez la Case loopB
Cas 1
Si col1 = true puis wshshell. Wshshell SendKeys Int(Round(rnd())) & « {TAB} » Else. SendKeys « {TAB} »
Cas 2
Si col2 = true puis wshshell. Wshshell SendKeys Int(Round(rnd())) & « {TAB} » Else. SendKeys « {TAB} »
Cas 3
Si col3 = true puis wshshell. Wshshell SendKeys Int(Round(rnd())) & « {TAB} » Else. SendKeys « {TAB} »
Cas 4
Si col4 = true puis wshshell. Wshshell SendKeys Int(Round(rnd())) & « {TAB} » Else. SendKeys « {TAB} »
Cas no 5
Si col5 = true puis wshshell. Wshshell SendKeys Int(Round(rnd())) & « {TAB} » Else. SendKeys « {TAB} »
End Select
WScript.Sleep 5
prochaine
WScript. ECHO
« Ce Flip-Flops colonnes pour afficher les 20 pour cent du temps, indépendamment les uns des autres.
maximum = 0,20
Si rnd() < maximale puis
Si col1 = true puis col1 = false Else col1 = true
End If
Si rnd() < maximale puis
Si col2 = true puis col2 = false Else col2 = true
End If
Si rnd() < maximale puis
Si col3 = true puis col3 = false Else col3 = true
End If
Si rnd() < maximale puis
Si col4 = true puis col4 = false Else col4 = true
End If
Si rnd() < maximale puis
Si col5 = true puis col5 = false Else col5 = true
End If
prochaine
WScript. ECHO
WScript. ECHO
EndSub
' ---------------------------
void key(msg)
« faire des impressions des messages de « the matrix » et les effacer
WScript.Sleep 1500
longueur = len(msg)
position = 1 à longueur
WshShell. SendKeys milieu (msg, position, 1)
WScript.Sleep 250
prochaine
WScript.Sleep 3000
position = 1 à longueur
WshShell. SendKeys « {BACKSPACE} »
WScript.Sleep 75
prochaine
EndSub
' ---------------------------
"Démarrer « principale » exécution ici
WAITFOR(title)
Pour loopA = 1 à 4
Sélectionnez la Case loopA
Cas 1
myString = « wake up, Neo... »
Cas 2
myString = « la matrice a vous... »
Cas 3
myString = « Suivez le lapin blanc... »
Cas 4
myString = « TOC-TOC... »
End Select
« maintenant imprimer la chaîne correcte
Key(myString)
prochaine
'_ _ _ _ _ _ _ _ _ _
WScript.Quit()