Jump to content

[Questions] -=|Zanax|=-


ZanaxNL
 Share

Recommended Posts

Hey Guys,

I'v got some questions.

  • I have to get the size of a progrem and then click like 500x right and 200y down. So it can work on any resolution to click on a button of a program.
  • The script most be in the same map as the program and then use Run that file in the same file like u got @ProgramFilesDir, but is there something for the same map, > if fie exist in same map then Run "".

Thanks for answering : )

bb

Zanax

Link to comment
Share on other sites

What do you mean by same map? If this is a game bot/automation script, we refuse to help.

shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:

%programfiles%/AutoIt3/autoit3.chm
Link to comment
Share on other sites

What do you mean by same map?

I'm thinking map == dir?

But thats the only thought i have, no idea whatsoever what your asking.

after much contemplating ive decided your after something like this:

WinGetClientSize ( "title" [, "text"] )

...used to find the size of the window

FileExists ( "path" )

...and assuming that map converts to directory then the above function will be used to check if a file exists

Edited by C45Y
http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun
Link to comment
Share on other sites

Since the answers seems satisfied, I would like just to add that you should name your topics properly.

Heeeeelp/PLZ GUISE/ HEY I've go a problem/Question [nickname here] and so on aren't very attractive.

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Hi,

sorry for late answering but school : (

and NO i dont make bot's or hacks.

Im pretty new to scripting and i faced some problems.

i will detail the problem i cant figure out:

i wanna set the Script or .exe in a certain map.

When u Run the script/exe then he will Run: a program what is INSIDE the same map.

When the the programs starts up. he will work with any resolution of the user, what i mean is he will check the x,y of the screen i runned and click then on the same spot of any other resolution.

So can anybody help me out?

And please stop say bot.

i just started Autoit so bot isnt even worth my experience,

Thank u!

Zanax

*C45Y Thanks,

WinGetClientSize ( "title" [, "text"] ) = usefull.

FileExists ( "path" ) = if u see this post u will maybe see what i mean, other people dont got got the same path so => error.

tyty

*Newb

I know but i cannot figure out a good title : (

Edited by ZanaxNL
Link to comment
Share on other sites

Got a idea.

> WinGetClientSize ( "title" [, "text"] )

And then use those coordinates.

like:

> (cord)y-100 to get the button i want to press and (cord)x+250

Is that possible?

(got linux on this PC so cant run autoit from this one)

Link to comment
Share on other sites

WinGetPos ( "title" [, "text"] )

will return the X,Y position of the window.

from there its simply a matter of adding the extra pixels to the control you wish to interact with.

example:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 193, 125)
$Button1 = GUICtrlCreateButton("Button1", 232, 168, 121, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
dim $array

MsgBox(0,"","Moving Mouse!")
$array = WinGetPos("Form1","Button1")
;//mouse move example
MouseMove($array[0],$array[1],100)

MsgBox(0,"","Button Clicking example!")
;//control click example
ControlClick("Form1","Button1","[CLASS:Button; INSTANCE:1]")
;//there is no need to acctually find the coordinates of the button/control you want to click.
;//find its info using the autoIT window info tool [ Ctrl + F6 ] in scite

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(0,"","Button clicked!")
    EndSwitch
WEnd

hope that pretty much covers everything.

Though i still have no idea what you are referring to when you say map.....

http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun
Link to comment
Share on other sites

Ok,

- but the button what most be pressed is not on the form1, the button is on a other program.

What i want is that he will press the button, no matter what the resolution of the user is.

- and the same folder i mean,[ Get location of script > then run /samepath/otherprogram.exe ]

Thanks,

Zanax : D

Link to comment
Share on other sites

If FileExists(@ProgramFilesDir & "\Firefox\Firefox.exe") Then

Run(@ProgramFilesDir & "\Firefox\Firefox.exe")

$cord = WinGetPos("FireFox")

MsgBox(1,$cord[0],$cord[1])

MouseMove(966, 543, 2,)

MouseClick("left", 966, 543, 1, 2)

Cord[0] = 301

Cord[1] = 128

Now i have to reach

301>966

and

128>543

to reach the button to click on

so can it be Mousemove($cord[0]+665,$Cord[1]+415,2)

How most this?

Thank u

Zanax

:DDDDDDDDDDDDDDDDDDDDDDDDD

********WORKED**********

Edited by ZanaxNL
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...