Jump to content

AutoitX Help


xZZTx
 Share

Recommended Posts

im starting AutoitX and i was just wondering how todo a few things

#include <Windows.h>
#include "AutoIt3.h"
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR   lpCmdLine,
                     int       nCmdShow)
{
    int $T;
    $T = AU3_PixelSearch(0,0,1000,900,0xFF0000,NULL,NULL,NULL);
    if (AU3_error() == 0)
    {
        AU3_MouseMove($T[0],$T[1],NULL);
    }
    return 0;
}

Error

1>------ Build started: Project: test1, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>main.cpp(15) : error C2440: '=' : cannot convert from 'void' to 'int'
1>      Expressions of type void cannot be converted to other types
1>main.cpp(18) : error C2109: subscript requires array or pointer type
1>main.cpp(18) : error C2109: subscript requires array or pointer type
1>Build log was saved at "file://Debug\BuildLog.htm"
1>test1 - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Please Explane the error to me

thank you in advanced

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

You obviously don't know C++. If you knew C++, part of the error would be obvious.

AU3_PixelSearch doesn't have a return code.

You didn't pass a pointer to a point to receive the location of the found pixel.

You are attempting to subscript an integer.

There may be other errors but those are what I see immediately.

Link to comment
Share on other sites

alright then..

could you please explane how i should write this, a few examples would help me learn this faster

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

i know i should learn C++ 1st but the thing is i don't really have time for that

so with a simple syntex setup i could learn what i need/want to use

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

Well there are two ways I could help you. I could just rewrite that small piece of code. Or you could ask specific questions and learn. I'd much rather you learn from it.

#include <Windows.h>
#include "AutoIt3.h"
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR   lpCmdLine,
                     int       nCmdShow)
{
    POINT T;
    AU3_PixelSearch(0,0,1000,900,0xFF0000,NULL,NULL,&T);
    if (AU3_error() == 0)
    {
        AU3_MouseMove(T.x,T.y,NULL);
    }
    return 0;
}

I want to say it's something like that. This is close anyways.

Edited by Richard Robertson
Link to comment
Share on other sites

Thank you for the help now i understand how part of this works..theres just a bit of a snag..

Unhandled exception at 0x1001b52b in Test.exe: 0xC0000005: Access violation reading location 0x00000008.
Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

it brakes on IF and on MouseMove

and T.x & T.y are returning numbers so that can't be the error

Edited by xZZTx
Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

AU3_PixelSearch is the error

even if i don't use what it outputs it makes it error

{
    POINT T;
      AU3_PixelSearch(1,1,1000,900,0xFF0000,30,1,&T);
    if (AU3_error() == 0)
    {
    int T1 = 300;//T.x;
    int T2 = 900;//T.y;
        AU3_MouseMove(T1,T2,1);//Error on this line
    }
}

as to

{
    POINT T;
    //AU3_PixelSearch(1,1,1000,900,0xFF0000,30,1,&T);
    if (AU3_error() == 0)
    {
    int T1 = 300;//T.x;
    int T2 = 900;//T.y;
        AU3_MouseMove(T1,T2,1);//No Error At All
    }
}
Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
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...