Sign in to follow this  
Followers 0
frew

How to increment numbers in text lines by 10 more each line?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0