ToniMuniz Posted September 12, 2019 Share Posted September 12, 2019 Hey guys I need some help here. I`m trying to create a something just to write a long text for me. Its a topographic info that I constantly need to change and re write. I made this, but the type speed is really low, even with Opt("SendKeyDelay",) set to 1. It starts really fast and getr slow after 4 ou 5 lines. Opt("SendKeyDelay", 70) Run("cmd.exe") Sleep(100) Send("cd c:\rdr") Send("{ENTER}") send("cemigrdr.exe") send("{ENTER}") send("{ENTER}") send("C") send("C") send("G") send("0") send("{ENTER}") send("500") send("{ENTER}") send("d") send("wild") send("{ENTER}") send("20190001") send("159") send("{ENTER}") send("E2{ENTER}9{ENTER}11280{ENTER}090011600{ENTER}37{ENTER}{ENTER}") send("E2{ENTER}10{ENTER}{ENTER}{ENTER}090281600{ENTER}84{ENTER}{ENTER}") send("E2{ENTER}E3{ENTER}{ENTER}{ENTER}090392000{ENTER}124{ENTER}{ENTER}") send("E3{ENTER}E2{ENTER}213620{ENTER}") send("E3{ENTER}12{ENTER}11360800121E092431600{ENTER}24{ENTER}{ENTER}") send("E3{ENTER}13{ENTER}{ENTER}0409236{ENTER}1600{ENTER}41{ENTER}{ENTER}") send("E3{ENTER}14{ENTER}{ENTER}0309215{ENTER}2600{ENTER}48{ENTER}{ENTER}") send("E3{ENTER}15{ENTER}{ENTER}0309101{ENTER}3600{ENTER}55{ENTER}{ENTER}") send("E3{ENTER}16{ENTER}{ENTER}2609010{ENTER}3600{ENTER}61{ENTER}{ENTER}") send("E3{ENTER}17{ENTER}{ENTER}2609014{ENTER}3600{ENTER}57{ENTER}{ENTER}") send("E3{ENTER}18{ENTER}{ENTER}0409106{ENTER}4800{ENTER}104{ENTER}{ENTER}") Can someome help me to speed it up? Link to comment Share on other sites More sharing options...
Musashi Posted September 12, 2019 Share Posted September 12, 2019 1 hour ago, ToniMuniz said: I made this, but the type speed is really low, even with Opt("SendKeyDelay",) set to 1. It starts really fast and gets slow after 4 or 5 lines. I don't know what cemigrdr.exe is or does, but if you send the text to notepad, nothing gets slow after 4 or 5 lines. expandcollapse popupOpt("SendKeyDelay", 0) ConsoleWrite("Start the Notepad process" & @CRLF) ; Run Notepad with the window maximized. Local $iPID = Run("notepad.exe", "", @SW_SHOWMAXIMIZED) ; Wait 10 seconds for the Notepad window to appear. WinWait("[CLASS:Notepad]", "", 10) Send("cd c:\rdr") Send("{ENTER}") send("xyz.txt (former : name of cemigrdr.exe") send("{ENTER}") send("{ENTER}") send("C") send("C") send("G") send("0") send("{ENTER}") send("500") send("{ENTER}") send("d") send("wild") send("{ENTER}") send("20190001") send("159") send("{ENTER}") send("E2{ENTER}9{ENTER}11280{ENTER}090011600{ENTER}37{ENTER}{ENTER}") send("E2{ENTER}10{ENTER}{ENTER}{ENTER}090281600{ENTER}84{ENTER}{ENTER}") send("E2{ENTER}E3{ENTER}{ENTER}{ENTER}090392000{ENTER}124{ENTER}{ENTER}") send("E3{ENTER}E2{ENTER}213620{ENTER}") send("E3{ENTER}12{ENTER}11360800121E092431600{ENTER}24{ENTER}{ENTER}") send("E3{ENTER}13{ENTER}{ENTER}0409236{ENTER}1600{ENTER}41{ENTER}{ENTER}") send("E3{ENTER}14{ENTER}{ENTER}0309215{ENTER}2600{ENTER}48{ENTER}{ENTER}") send("E3{ENTER}15{ENTER}{ENTER}0309101{ENTER}3600{ENTER}55{ENTER}{ENTER}") send("E3{ENTER}16{ENTER}{ENTER}2609010{ENTER}3600{ENTER}61{ENTER}{ENTER}") send("E3{ENTER}17{ENTER}{ENTER}2609014{ENTER}3600{ENTER}57{ENTER}{ENTER}") send("E3{ENTER}18{ENTER}{ENTER}0409106{ENTER}4800{ENTER}104{ENTER}{ENTER}") ; Wait for 5 seconds. Sleep(5000) ; Close the Notepad process using the PID returned by Run. ProcessClose($iPID) ConsoleWrite("Notepad process closed" & @CRLF) Can you explain the functionality of cemigrdr.exe ? ToniMuniz 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
ToniMuniz Posted September 12, 2019 Author Share Posted September 12, 2019 1 minute ago, Musashi said: I don't know what cemigrdr.exe is or does, but if you send the text to notepad, nothing gets slow after 4 or 5 lines. expandcollapse popupOpt("SendKeyDelay", 0) ConsoleWrite("Start the Notepad process" & @CRLF) ; Run Notepad with the window maximized. Local $iPID = Run("notepad.exe", "", @SW_SHOWMAXIMIZED) ; Wait 10 seconds for the Notepad window to appear. WinWait("[CLASS:Notepad]", "", 10) Send("cd c:\rdr") Send("{ENTER}") send("xyz.txt (former : name of cemigrdr.exe") send("{ENTER}") send("{ENTER}") send("C") send("C") send("G") send("0") send("{ENTER}") send("500") send("{ENTER}") send("d") send("wild") send("{ENTER}") send("20190001") send("159") send("{ENTER}") send("E2{ENTER}9{ENTER}11280{ENTER}090011600{ENTER}37{ENTER}{ENTER}") send("E2{ENTER}10{ENTER}{ENTER}{ENTER}090281600{ENTER}84{ENTER}{ENTER}") send("E2{ENTER}E3{ENTER}{ENTER}{ENTER}090392000{ENTER}124{ENTER}{ENTER}") send("E3{ENTER}E2{ENTER}213620{ENTER}") send("E3{ENTER}12{ENTER}11360800121E092431600{ENTER}24{ENTER}{ENTER}") send("E3{ENTER}13{ENTER}{ENTER}0409236{ENTER}1600{ENTER}41{ENTER}{ENTER}") send("E3{ENTER}14{ENTER}{ENTER}0309215{ENTER}2600{ENTER}48{ENTER}{ENTER}") send("E3{ENTER}15{ENTER}{ENTER}0309101{ENTER}3600{ENTER}55{ENTER}{ENTER}") send("E3{ENTER}16{ENTER}{ENTER}2609010{ENTER}3600{ENTER}61{ENTER}{ENTER}") send("E3{ENTER}17{ENTER}{ENTER}2609014{ENTER}3600{ENTER}57{ENTER}{ENTER}") send("E3{ENTER}18{ENTER}{ENTER}0409106{ENTER}4800{ENTER}104{ENTER}{ENTER}") ; Wait for 5 seconds. Sleep(5000) ; Close the Notepad process using the PID returned by Run. ProcessClose($iPID) ConsoleWrite("Notepad process closed" & @CRLF) Can you explain the functionality of cemigrdr.exe ? Hi friend, tx for the reply. It`s a program that run on DOS, it takes all that information and draw a topographic profile. But it has separated colums, thats why I use [enter] between the information. SO the program needs me to type a field, press enter, type another one, and keep going. Let me put some screens here to try make it more easy to understand since english is not my first language: This is the excel plan were all the information is: This one is the program were I need to translate all information from excel. Runing in DOS in a virtual PC with win xp. All that I need is to take the info from excel, and write that on this DOS program, but its huge somtetimes, like a 300 lines. To change between columns I need to press Enter. Link to comment Share on other sites More sharing options...
ToniMuniz Posted September 12, 2019 Author Share Posted September 12, 2019 I forgot to mention that it was much faster before, and now its slower, I dunno what I change that brokes the script, I`m not familiar with programming language, I`m just a technician, trying to make my job faster XD Link to comment Share on other sites More sharing options...
Musashi Posted September 12, 2019 Share Posted September 12, 2019 Hi @ToniMuniz First of all, I apologize for the late response. I am very busy at the moment, but I don't want to leave you without some kind of feedback. Questions :Q1 : Sending commands to the Dos program works basically, right ? The problem is, that the execution is getting increasingly slower. Try, just for the sake of it, to play with the value in SendKeyDelay -> 10 -> 20 ... Does this have any effect on the processing speed ? Q2 : Maybe a stupid one, but does cemigrdr.exe has some kind of interface to import data ? Q3 : The Excel part is still missing completely, right ? Finally : Not sure if I can help you further with this, because the automation of old Dos programs is not my favorite field of activity. Working virtually blind also doesn't make things easier, because I can't test anything myself. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
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