frew Posted March 27, 2009 Share Posted March 27, 2009 Hello, I have this MouseClick("left", 75, 123, 1, 500) Sleep(1000) MouseClick("left", 75, 321, 1, 500) Sleep(1000) MouseClick("left", 75, 456, 1, 500) Sleep(1000) MouseClick("left", 75, 654, 1, 500) Sleep(1000) MouseClick("left", 75, 789, 1, 500) Sleep(1000) and I want a script that will get this result MouseClick("left", 75, 600, 1, 500) Sleep(1000) MouseClick("left", 75, 610, 1, 500) Sleep(1000) MouseClick("left", 75, 620, 1, 500) Sleep(1000) MouseClick("left", 75, 630, 1, 500) Sleep(1000) MouseClick("left", 75, 640, 1, 500) Sleep(1000) So the script will go into the text file (no problem) go to every other line (I do not know the best way to script that, except to do Send("{Down 2}")..is that the best way?) find a certain position in the line (no problem...unless there's a faster way than Send("{Right 23}") etc.) and replace the number at that cursor position with the incremented number. I know that's a lot, but if no script, could someone please point me in a direction so I could learn how to make these kinds of text editing scripts? Thank you very much, frew Link to comment Share on other sites More sharing options...
KaFu Posted March 27, 2009 Share Posted March 27, 2009 for $i =600 to 640 step 10 MouseClick("left", 75, $i, 1, 500) Sleep(1000) next OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
frew Posted March 27, 2009 Author Share Posted March 27, 2009 I'm trying to grasp this. Ah, yes, it get's the result...maybe I do not need the text file to be edited when I can use your script idea. It looks like your code will send the mouse clicks but not edit the text file? What if I want the script to edit the text file from looking like this MouseClick("left", 75, 123, 1, 500) Sleep(1000) MouseClick("left", 75, 321, 1, 500) Sleep(1000) MouseClick("left", 75, 456, 1, 500) Sleep(1000) MouseClick("left", 75, 654, 1, 500) Sleep(1000) MouseClick("left", 75, 789, 1, 500) Sleep(1000) to looking like this MouseClick("left", 75, 600, 1, 500) Sleep(1000) MouseClick("left", 75, 610, 1, 500) Sleep(1000) MouseClick("left", 75, 620, 1, 500) Sleep(1000) MouseClick("left", 75, 630, 1, 500) Sleep(1000) MouseClick("left", 75, 640, 1, 500) Sleep(1000) You've got me thinking that maybe I do not need the text file to be edited when I can just use code like what you gave here. Now I have to think about this and do some testing. Thank you very much for your help with this. frew Link to comment Share on other sites More sharing options...
TerarinK Posted March 28, 2009 Share Posted March 28, 2009 Let me just clear this up if you have alot of MouseClick then Sleeping you can easily collapse it into a 5 line (so anything more then 5 lines should include this statement. Local $aArray[2][6] = [["left", 10, 100, 1, 100, 1000],["left", 50, 100, 1, 100, 1000]] _MouseClick($aArray) Func _MouseClick(ByRef $avArray) For $i = 0 To UBound($avArray) - 1 MouseClick($avArray[$i][0], $avArray[$i][1], $avArray[$i][2], $avArray[$i][3], $avArray[$i][4]) Sleep($avArray[$i][5]) Next EndFunc ;==>_MouseClick 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
frew Posted March 28, 2009 Author Share Posted March 28, 2009 Thanks TerarinK, At this point this is all way over my head, so I thank you very much, but I can see that I need to study a tutorial, then come back to see if I can figure this out. But for now I don't understand the nice work that you have provided. Thank you, frew 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