Jump to content

Recommended Posts

Posted

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

Jobs1.png

Jobs2.png

Jobs3.png

Jobs4.png

  • Solution
Posted (edited)

I think

_GUICtrlEdit_SetSel($g_idMemo, $start, $linelength+1)

needs to be

_GUICtrlEdit_SetSel($g_idMemo, $start, $start + $linelength+1)
Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

You are most welcome

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...