DaVinci Posted March 5 Share Posted March 5 Hello. I am new to autoit, 2-3 months of dealing with it. I bump on it looking for making a bot for making meanless clicks on a game :P, and stuck on it. I made a lot of small scripts for different jobs since then. I 've made a script now that do various jobs, p.e. kill programs that don't want to run anymore, clean junks, boost memory, play music , etc I choose every time the jobs i want in a list in an edit box, i don't want everything all the time. Everything works fine. The script read each line, do the job and go to the next. If a job isn't available, it go to the next one (p.e. the programs i want to killl are not loaded yet). I want when it go to end, come back and start over to do what's left. I was thinking replace the line of the edit box that was done with the word DONE, so the script bypass that line and go to the next I don't want to erase the line so i can looking it and know what has be done or not. That's the problem. I can replace only the first line, when start for the second, third, etc, it loosing it, replacing half worlds, place DONE on the same line twice etc... You can see the pics that it loses it after the first replace. I search the forum and i find a lot about replacing lines in txt files, but my problem is that it is not a file. I tried using stringinstring too, but no luck (i haven't understand strings very well yet). Maybe edit boxes couldn't replaced, i don't know. That's my code for the replace: Local Static $line = 0 ;the line of the edit box Local Static $start = 0 $linelength = _GUICtrlEdit_LineLength($g_idMemo, $line) _GUICtrlEdit_SetSel($g_idMemo, $start, $linelength+1) _GUICtrlEdit_ReplaceSel($g_idMemo,"Done"&@CRLF, False) $line +=1 ;go to next line in each pass $start += 6 ;start with a DONE more Any help is appreciated, or any other ideas how to make the script avoid the already done jobs Thank you Link to comment Share on other sites More sharing options...
Solution donnyh13 Posted March 5 Solution Share Posted March 5 (edited) I think _GUICtrlEdit_SetSel($g_idMemo, $start, $linelength+1) needs to be _GUICtrlEdit_SetSel($g_idMemo, $start, $start + $linelength+1) Edited March 5 by donnyh13 DaVinci and jaberwacky 2 LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." Link to comment Share on other sites More sharing options...
DaVinci Posted March 5 Author Share Posted March 5 That's work perfectly!! Thank you!!! donnyh13 1 Link to comment Share on other sites More sharing options...
donnyh13 Posted March 5 Share Posted March 5 You are most welcome LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." 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