Jump to content

Pixels & errors.


lolp1
 Share

Recommended Posts

Sorry for my multible post, but I am still learning some things.

When I try:

PixelSearch( 0, 0, 800, 600, 5922138 )
If Not @error Then
    Mouseclick("left", 566,263,1,0); 
Endif

if @error 
Mouseclick("left",372,401,1,0)
endif

It still performs both actions.

EG: It still clicks mouse at both locations, why?

Link to comment
Share on other sites

This is what I have:

PixelSearch( 0, 0, 800, 600, 5922138 )
If Not @error Then
    Sleep(750); 
    Mouseclick("left", 566,263,1,0);

Sleep(300); 
Mouseclick("left",372,401,1,0);

Else

Send("i");

Sleep(750); 
    Mouseclick("left", 566,263,1,0);

Sleep(300); 
Mouseclick("left",372,401,1,0);

But for some reason, it does not want to send i, or ir is just repeating the mouse clicks with out pressing Y, any idea?

Link to comment
Share on other sites

  • Moderators

This is what I have:

PixelSearch( 0, 0, 800, 600, 5922138 )
If Not @error Then
    Sleep(750); 
    Mouseclick("left", 566,263,1,0);

Sleep(300); 
Mouseclick("left",372,401,1,0);

Else

Send("i");

Sleep(750); 
    Mouseclick("left", 566,263,1,0);

Sleep(300); 
Mouseclick("left",372,401,1,0);

But for some reason, it does not want to send i, or ir is just repeating the mouse clicks with out pressing Y, any idea?

1. What do you mean "pressing "Y""?

2. Isn't this the samething as you are trying to do?

PixelSearch( 0, 0, 800, 600, 5922138 )
If @error Then Send('i')
Sleep(750)
Mouseclick("left", 566,263,1,0);
Sleep(300);
Mouseclick("left",372,401,1,0);
If it never sends I, it's always finding the color. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

What I'm trying to do:

Scan the area for the pixel, if the pixel is there perform the action.

If it is not, press the button (I) to open the pixel and then perform the action, this is what I tried to do this with:

PixelSearch( 0, 0, 800, 600, 5922138 )
If Not @error Then
    Sleep(750);
    Mouseclick("left", 566,263,1,0);

Sleep(300);
Mouseclick("left",372,401,1,0);

Else

Send("i");

Sleep(750);
    Mouseclick("left", 566,263,1,0);

Sleep(300);
Mouseclick("left",372,401,1,0);

Did I do something wrong?

Link to comment
Share on other sites

  • Moderators

And "Send('i')" presses the "button" for you if you do it with the keyboard?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Yes, if I use just plain send("I") in Auto-it the pixel will show up.

You're so confusing... why don't you regroup and write out exactly what you want, and or provide some sensible information to help you.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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