Teckx

can i modify $x,$y coordinates to look -100,-100 ?

18 posts in this topic

#1 ·  Posted

I am using imagesearch and from where the mousemove goes to when it sees the image, I want it to move left on the screen a certain distance

Share this post


Link to post
Share on other sites



#2 ·  Posted

explanation of what im doing

im grabbing a 'name' from a notepad

going to IE and searching for it

Imagesearch looks for the color blue of the highlighted search result

there is a radio button to the left of that particular 'name' that I need to click

there are 50+ of the identical radio buttons on the page so I cant search for that

Share this post


Link to post
Share on other sites

#3 ·  Posted

well anyways I noticed that when searching for the name having the mouse move to the variable coordinate it highlighted the button so I was able to now search for that highlighted button . awesome

 

but for education purposes is there a way to change coordinates based on subtracting from the variable?

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted

Hey, I just had to use this earlier today. Basically you want to use mousegetpos.

Here is a link to forms where this was disused.

 

1 person likes this

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Please any help would be most appreciated!! I'm still having a little issue here. Here's my goal:

1) I want imagesearch to locate the word 'Notes'

              This word will move around every time I search for it so I cannot use static mouse coordinates for the next step.

 

2) After locating notes I want it to move the mouse right and highlight the text that's next to it (usually a few sentences)      <-----This is the part I need help with

Edited by Teckx

Share this post


Link to post
Share on other sites

#6 ·  Posted

@Teckx

Your script seems very mechanic, and I don't like mechanic things ( at least, not scripts ).

What you're trying to do is copy-paste a word that you search in a text file, go in IE, and click a (some) radio button(s) in a web-page...

Is this your goal?

:)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

#7 ·  Posted

Just now, FrancescoDiMuro said:

@Teckx

Your script seems very mechanic, and I don't like mechanic things ( at least, not scripts ).

What you're trying to do is copy-paste a word that you search in a text file, go in IE, and click a (some) radio button(s) in a web-page...

Is this your goal?

:)

its part of a function I have going. The radio button is a differnt script I figured out- this one im referring to in this thread is the much more complicated one that will be an ongoing battle.

This is the Else portion where it would copy notes from a completed ticket and then submit the notes to the customer saying their request (notes) was completed.

 

I actually figured a way to just search for the Notes: (mousedown) then imagesearch for the end corner of the window (mouseup) copy paste and continue on

 

So I guess this is now for education purposes if its even possible to subtract coordinates from a variable

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@Teckx

3 minutes ago, Teckx said:

So I guess this is now for education purposes if its even possible to subtract coordinates from a variable

You would like to substract coordinates ( of what? Mouse? Window? ) from a variable?

If so, it should not be so difficult, but... Can you please explain step by step what your script should do?

I'm asking this to you in order to help you as much as I can :) 

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

4 minutes ago, FrancescoDiMuro said:

@Teckx

You would like to substract coordinates ( of what? Mouse? Window? ) from a variable?

If so, it should not be so difficult, but... Can you please explain step by step what your script should do?

I'm asking this to you in order to help you as much as I can :) 

 

I would like to subtract coordinates from the imagesearch MouseMove $x, $y coordinates

say for example the Image im searching for (Notes) is always 5 inches away on the left from what I want to highlight and copy

kind of confusing .

 

look at my post/replies for example. say I wanted to imagesearch my name Teckx. Then from there id want to subtract coordinates so the mouse would move to the right and copy the post number which will always be in the same spot.

Edited by Teckx

Share this post


Link to post
Share on other sites

#10 ·  Posted

@Teckx

It's very mechanic...

You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch().

Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need?

You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... :) 


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

#11 ·  Posted

49 minutes ago, FrancescoDiMuro said:

@Teckx

It's very mechanic...

You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch().

Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need?

You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... :) 

wish I could give you a video that would make things much easier but its classified

I haven't really tried pixelsearch much because all of the forms im using are mainly just black text on a white background.

Share this post


Link to post
Share on other sites

#12 ·  Posted

heres a sample if it helps at all.

 

Are you creating a New Group or Modifying an Existing Group?* :

Create a New Group

Enter the New Group Name* :

Test Group Capture this

Type of Group* :

Distribution

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

so looking at that sample id want to copy Test Group Capture this

so ive been image searching the Group Name* :  and having it mousedown and move towards the border of the form with another imagesearch., is there a better way?

Share this post


Link to post
Share on other sites

#14 ·  Posted

11 minutes ago, Teckx said:

so looking at that sample id want to copy Test Group Capture this

so ive been image searching the Group Name* :  and having it mousedown and move towards the border of the form with another imagesearch., is there a better way?

@Teckx

I think you could use _IE_* functions, in order to retrieve some information that for sure would be helpful!

Did you already take a look at them? :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

#15 ·  Posted

Just now, FrancescoDiMuro said:

@Teckx

I think you could use _IE_* functions, in order to retrieve some information that for sure would be helpful!

Did you already take a look at them? :)

I have not. still a bit new at all this so I tend to stick to what im comfortable with and try to make it work. ill look those up

Share this post


Link to post
Share on other sites

#16 ·  Posted

On 7/25/2017 at 10:02 AM, FrancescoDiMuro said:

It's very mechanic...

You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch().

Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need?

You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... :) 

 

sorry to bug you. was still thinking about this

 

three things

1: not sure if IE functions can do this but ive noticed the item i want is always on line 52 in the 'view source'  unsure if theres a way to pull that while removing all the html surrounding it

 

2: Could you point me in the right direction or expand on "why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need?"

 

3: Same as above, could you point me to more info on "You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch()."

instead of using pixelsearch however i would have to use imagesearch

 

Share this post


Link to post
Share on other sites

#17 ·  Posted

this thread can be deleted. the solution is so simple  :blink:

 

 

$result = _ImageSearch("test.png",1,$x1,$y1,0)
if $result=1 Then
    MouseMove($x1,$y1,3)
    Mouseclick("left",$x1+200,$y1,1)
Else
    MsgBox(0,"WAS NOT FOUND"," DID NOT FIND IT")
    Exit
EndIf

 

Share this post


Link to post
Share on other sites

#18 ·  Posted

Happy to see that you solved your issue :)


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

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