herewasplato Posted September 28, 2006 Posted September 28, 2006 (edited) $TempPath = EnvGet("temp") MsgBox(0, "My First Attempt", "This is my first try at making a script from my own idea =D Tell me if you find anything wrong with it ^^.") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(":Start") Send("{Enter}") Send("echo off") Send("{Enter}") Send("color 2") Send("{Enter}") Send("echo ") For $i = 1 To 113 Send("%random% ") Next Send("{Enter}") Send("goto start") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "The text in the Untitled file has changed") Send("!Y") Send($TempPath & "\Matrix.bat") Send("!s") Sleep(1000) Run($TempPath & "\Matrix.bat") Send("!{Enter}") Sleep(10000) Send("^c") Sleep(500) Send("Y") Send("{Enter}") Sleep(10000) FileDelete($TempPath & "\Matrix.bat")Edit: What did you want to slow down? Edited September 28, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
Canasian Posted September 28, 2006 Author Posted September 28, 2006 I get this from SciTE when I run your code:and now I have Matrix.bat in my "My Docs" folderand the script attempted to run it from Matrix.bat from my c:\temp folder.Blehhhhh It does the same thing on my comp at home... like the matrix.bat doesn't exist? But it worked fine at school.. and the thing i wanted to slow down was the typing of the text.. the :start echo off color 2 echo %random% etc..
herewasplato Posted September 28, 2006 Posted September 28, 2006 try this:Opt("SendKeyDelay", 40) $TempPath = EnvGet("temp") MsgBox(0, "My First Attempt", "This is my first try at making a script from my own idea =D Tell me if you find anything wrong with it ^^.") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(":Start") Send("{Enter}") Send("echo off") Send("{Enter}") Send("color 2") Send("{Enter}") Send("echo ") For $i = 1 To 113 Send("%random% ") Next Send("{Enter}") Send("goto start") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "The text in the Untitled file has changed") Send("!Y") Send($TempPath & "\Matrix.bat") Send("!s") Sleep(1000) Run($TempPath & "\Matrix.bat") Send("!{Enter}") Sleep(10000) Send("^c") Sleep(500) Send("Y") Send("{Enter}") Sleep(10000) FileDelete($TempPath & "\Matrix.bat") [size="1"][font="Arial"].[u].[/u][/font][/size]
Paulie Posted September 28, 2006 Posted September 28, 2006 Dim $Line[10] $file= FileOpen(@ScriptDir&"\Matrix.bat",2) $Line[1] = ":Start" $Line[2] = "echo off" $Line[3] = "color 2" $Line[4] = "echo %Random%" For $i = 1 to 112 $Line[4] = $line[4]&" %Random%" Next $Line[6]="Goto start" For $int = 1 to 6 FileWriteLine($File, $Line[$Int]) Next FileClose($File) Run(@ScriptDir&"\Matrix.bat") Unfamiliar with batch, dunno how to do it full screen, but this got rid of the notepad thing
herewasplato Posted September 28, 2006 Posted September 28, 2006 ...But that doesn't show how the bat file was made that's kinda how I got the idea of making it.. a few people wanted to know how i did the simple matrix.bat thing and I thought it'd be neat to make it open up notepad then close it all on it's own then open it and make the matrix.bat fullscreen ...OP wants notepad. [size="1"][font="Arial"].[u].[/u][/font][/size]
Canasian Posted September 28, 2006 Author Posted September 28, 2006 try this:Opt("SendKeyDelay", 40) $TempPath = EnvGet("temp") MsgBox(0, "My First Attempt", "This is my first try at making a script from my own idea =D Tell me if you find anything wrong with it ^^.") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(":Start") Send("{Enter}") Send("echo off") Send("{Enter}") Send("color 2") Send("{Enter}") Send("echo ") For $i = 1 To 113 Send("%random% ") Next Send("{Enter}") Send("goto start") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "The text in the Untitled file has changed") Send("!Y") Send($TempPath & "\Matrix.bat") Send("!s") Sleep(1000) Run($TempPath & "\Matrix.bat") Send("!{Enter}") Sleep(10000) Send("^c") Sleep(500) Send("Y") Send("{Enter}") Sleep(10000) FileDelete($TempPath & "\Matrix.bat") Woooo!!! that's awsome... works perfectly except.. watching it type %random% 143 times got alittle boring lmao.. but i'm sure with what you gave me i could figure out how to speed that part up then make it go back to the speed you made it go... or maybe just make it delay before exiting so they could look at it for a few seconds.. haha anyways tyvvvm you've helped me alot ^^ now i gotta go read about $TempPath cuz i had no idea where it went when it saved the .bat ^^ lol ty tho very much
fu2m8 Posted September 28, 2006 Posted September 28, 2006 (edited) or maybe just make it delay before exiting so they could look at it for a few seconds.. haha anyways tyvvvm you've helped me alot ^^ now i gotta go read about $TempPath cuz i had no idea where it went when it saved the .bat ^^ lol ty tho very much yeh you could just add: Send("goto start") Sleep(10000) ;time in milliseconds to sleep for (10 secs in this case) WinClose("Untitled - Notepad") somewhere around there should do the trick. $TempPath = EnvGet("temp") returns an environment variable (in this case the path to the logged in users temp folder). You could see what path yours returns (as well as other environment variables) by opening a command prompt window and typing SET and then look for the TEMP entry Edited September 28, 2006 by fu2m8
herewasplato Posted September 29, 2006 Posted September 29, 2006 oops missed that :"> :">me too the first time I read the thread.I liked your array. It might be a bit much for those new to AutoIt to grasp, but it sure works well in a loop. Your use of @ScriptDir is probably better than my use of the user temp directory. [size="1"][font="Arial"].[u].[/u][/font][/size]
herewasplato Posted September 29, 2006 Posted September 29, 2006 ...figure out how to speed that part up then make it go back to the speed you made it go...try this version:expandcollapse popupOpt("SendKeyDelay", 50) $TempPath = EnvGet("temp") FileDelete($TempPath & "\Matrix.bat") MsgBox(0, "My First Attempt", "This is my first try at making a script from my own idea =D Tell me if you find anything wrong with it ^^.") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(":Start") Send("{Enter}") Send("echo off") Send("{Enter}") Send("color 2") Send("{Enter}") Send("echo ") $var = "" For $i = 1 To 113 $var = $var & "%random% " Next ClipPut($var) Sleep(100) Send("^v") Send("{Enter}") Send("goto start") For $i = 10 To 1 Step - 1 TrayTip("", @CR & @CR & " " & $i & " " & @CR & @CR, 1) Sleep(1000) Next TrayTip("", "", 1) WinClose("Untitled - Notepad") WinWaitActive("Notepad", "The text in the Untitled file has changed") Send("!Y") Send($TempPath & "\Matrix.bat") Send("!s") Sleep(1000) Run($TempPath & "\Matrix.bat") Send("!{Enter}") Sleep(10000) Send("^c") Sleep(500) Send("Y") Send("{Enter}") Sleep(10000) FileDelete($TempPath & "\Matrix.bat")I counted "random" 113 times in your code in this post http://www.autoitscript.com/forum/index.ph...st&p=242734 (Okay, MS Word counted for me.) You might want to change that down around 80 or play with 20 and see how the pattern changes for you. Change this line For $i = 1 To 113 to For $i = 1 To 80 enjoy [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now