Sign in to follow this  
Followers 0
Casper2400

Someone please help with this code

12 posts in this topic

Hello all and thank you for reading this post. Below is a code snipet from my program.

On the bottom of the window is a solid black bar.

When a message window is opened and then minimized it creates a tab on this black bar (the tab is NOT black)

I want to know how to determin when the bar is not nlack and send a mouseclick on that tab (more tabs will move, most recent tab will be first)

Here is the code I have but I cannot seem to get it to work.

Can someone look at the code and tell me how to fix it (clean it up) to where it will work as it should.

Thank you

AU3_MouseMove (280,730,1);
      Spambox:=AU3_PixelGetColor (280,730);
        if Spambox=0 then
          begin
            AU3_MouseMove (380,730,1);
            Spambox:=AU3_PixelGetColor (380,730);
          end;
            if Spambox=0 then
              begin
                AU3_MouseMove (480,730,1);
                Spambox:=AU3_PixelGetColor (480,730);
              end;
                if Spambox=0 then
                  begin
                    AU3_MouseMove (580,730,1);
                    Spambox:=AU3_PixelGetColor (580,730);
                  end;
                    if Spambox=0 then
                      begin
                        AU3_MouseMove (680,730,1);
                        Spambox:=AU3_PixelGetColor (680,730);
                      end;
                        if Spambox=0 then
                          begin
                            AU3_MouseMove (780,730,1);
                            Spambox:=AU3_PixelGetColor (780,730);
                          end;
                            if Spambox=0 then
                              begin
                                AU3_MouseMove (880,730,1);
                                Spambox:=AU3_PixelGetColor (880,730);
                              end
        else if Spambox<>0 then
          begin
            AU3_MouseDown ('left');
          end;
    Sleep (1000);
    AU3_MouseClick ('left', 137,367, 1, 3);
    AU3_Send (spamsg2,0);
    AU3_Send ('{ENTER}',0);
    Sleep (1000);
    Sleep (300000);

I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites



Hello all and thank you for reading this post. Below is a code snipet from my program.

On the bottom of the window is a solid black bar.

When a message window is opened and then minimized it creates a tab on this black bar (the tab is NOT black)

I want to know how to determin when the bar is not nlack and send a mouseclick on that tab (more tabs will move, most recent tab will be first)

Here is the code I have but I cannot seem to get it to work.

Can someone look at the code and tell me how to fix it (clean it up) to where it will work as it should.

Thank you

AU3_MouseMove (280,730,1);
      Spambox:=AU3_PixelGetColor (280,730);
        if Spambox=0 then
          begin
            AU3_MouseMove (380,730,1);
            Spambox:=AU3_PixelGetColor (380,730);
          end;
            if Spambox=0 then
              begin
                AU3_MouseMove (480,730,1);
                Spambox:=AU3_PixelGetColor (480,730);
              end;
                if Spambox=0 then
                  begin
                    AU3_MouseMove (580,730,1);
                    Spambox:=AU3_PixelGetColor (580,730);
                  end;
                    if Spambox=0 then
                      begin
                        AU3_MouseMove (680,730,1);
                        Spambox:=AU3_PixelGetColor (680,730);
                      end;
                        if Spambox=0 then
                          begin
                            AU3_MouseMove (780,730,1);
                            Spambox:=AU3_PixelGetColor (780,730);
                          end;
                            if Spambox=0 then
                              begin
                                AU3_MouseMove (880,730,1);
                                Spambox:=AU3_PixelGetColor (880,730);
                              end
        else if Spambox<>0 then
          begin
            AU3_MouseDown ('left');
          end;
    Sleep (1000);
    AU3_MouseClick ('left', 137,367, 1, 3);
    AU3_Send (spamsg2,0);
    AU3_Send ('{ENTER}',0);
    Sleep (1000);
    Sleep (300000);
What version of AutoIt is this? Doesn't look familiar to me

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It looks like ActiveX? I dunno a mix maybe?

Try this:

MouseMove(280, 730, 1);
$Spambox = PixelGetColor(280, 730);
If $Spambox = 0 Then
    MouseMove(380, 730, 1);
    $Spambox = PixelGetColor(380, 730);
ElseIf $Spambox = 0 Then
    MouseMove(480, 730, 1);
    $Spambox = PixelGetColor(480, 730);
ElseIf $Spambox = 0 Then
    MouseMove(580, 730, 1);
    $Spambox = PixelGetColor(580, 730);
ElseIf $Spambox = 0 Then
    MouseMove(680, 730, 1);
    $Spambox = PixelGetColor(680, 730);
ElseIf $Spambox = 0 Then
    MouseMove(780, 730, 1);
    $Spambox = PixelGetColor(780, 730);
ElseIf $Spambox = 0 Then
    MouseMove(880, 730, 1);
    $Spambox = PixelGetColor(880, 730);
ElseIf $Spambox <> 0 Then

    MouseDown('left');
    ;
    Sleep(1000);
    MouseClick('left', 137, 367, 1, 3);
    Send("spamsg2", 0);
    Send('{ENTER}', 0);
    Sleep(1000);
    Sleep (300000);
EndIf

That's Autoitv3.

Edited by Chip

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It looks like ActiveX? I dunno a mix maybe?

Try this:

MouseMove(280, 730, 1);
$Spambox = PixelGetColor(280, 730);
If $Spambox = 0 Then
    MouseMove(380, 730, 1);
    $Spambox = PixelGetColor(380, 730);
ElseIf $Spambox = 0 Then
    MouseMove(480, 730, 1);
    $Spambox = PixelGetColor(480, 730);
ElseIf $Spambox = 0 Then
    MouseMove(580, 730, 1);
    $Spambox = PixelGetColor(580, 730);
ElseIf $Spambox = 0 Then
    MouseMove(680, 730, 1);
    $Spambox = PixelGetColor(680, 730);
ElseIf $Spambox = 0 Then
    MouseMove(780, 730, 1);
    $Spambox = PixelGetColor(780, 730);
ElseIf $Spambox = 0 Then
    MouseMove(880, 730, 1);
    $Spambox = PixelGetColor(880, 730);
ElseIf $Spambox <> 0 Then

    MouseDown('left');
    ;
    Sleep(1000);
    MouseClick('left', 137, 367, 1, 3);
    Send("spamsg2", 0);
    Send('{ENTER}', 0);
    Sleep(1000);
    Sleep (300000);
EndIf

That's Autoitv3.

It is Delphi with AutoItx wrapper.

$ symbols are not recognized, MUST have AU3_ preceding, and single quotes not double.

I will fix this code and try it. Thank you Chip.

Edited by Casper2400

I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

Match If with EndIf, i think that goes for Delphi too, look up how many If you have and match them up.

Share this post


Link to post
Share on other sites

Match If with EndIf, i think that goes for Delphi too, look up how many If you have and match them up.

Turns out in this situation I will need to use a "case" and "while" statements.

Thank you all for your assistance.


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

Turns out in this situation I will need to use a "case" and "while" statements.

Thank you all for your assistance.

Hello again, still on this same situation. I got the code I need to loop for sending messages but now I am having trouble getting it to locate WHERE it needs to click to get the tab to open.

On the bottom of the screen is a solid black bar, When a room is minimized it creates a tab here (NOT black) However the location of this tab is not always the same.

ie: If user is member of a "clan" will be the first tab, IF user chooses to have buying AND/OR selling boards will create 1, 2 OR 0 tabs, and finally the trade room itself (which is the room I need to open to send the message at timed intervals.

Can someone explain how to look at the black bar AND CLICK where it FIRST appears NOT black?

Thank you.


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

Hello again, still on this same situation. I got the code I need to loop for sending messages but now I am having trouble getting it to locate WHERE it needs to click to get the tab to open.

On the bottom of the screen is a solid black bar, When a room is minimized it creates a tab here (NOT black) However the location of this tab is not always the same.

ie: If user is member of a "clan" will be the first tab, IF user chooses to have buying AND/OR selling boards will create 1, 2 OR 0 tabs, and finally the trade room itself (which is the room I need to open to send the message at timed intervals.

Can someone explain how to look at the black bar AND CLICK where it FIRST appears NOT black?

Thank you.

So you mean you want the window to be activiated? Just use your username as title, if i didn't misunderstand you.

Share this post


Link to post
Share on other sites

So you mean you want the window to be activiated? Just use your username as title, if i didn't misunderstand you.

unfortunatly there are no "window handles" for this.

Its a tab at the bottom of the screen and I need to click on the tab to open it. this is an IN game window so there are no handles (that I can locate.) also this tab name could change from user to user so it would be unknown anyways.

basically what I need it to do is pixelsearch the area and mouseclick on the FIRST area that is NOT black.


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

Just use PixelChecksum and look for the color.

Share this post


Link to post
Share on other sites

Just use PixelChecksum and look for the color.

PixelCheckSum will find the color yes BUT how to make it mouse click AT the position IF that color is found AND on the FIRST one not EACH of them (there may be more than 1 tab)


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

basic logic:

Pixel search for the color (that should stay the same, right?) and it returns the co-ords you need to click at.

Alternatively, is the tab always in the same place? if so, just click at the right co-ords and you will get it.

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