ZanaxNL Posted January 12, 2011 Share Posted January 12, 2011 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 : )bbZanax Link to comment Share on other sites More sharing options...
shanet Posted January 12, 2011 Share Posted January 12, 2011 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 More sharing options...
C45Y Posted January 12, 2011 Share Posted January 12, 2011 (edited) 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 January 12, 2011 by C45Y http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun Link to comment Share on other sites More sharing options...
Newb Posted January 12, 2011 Share Posted January 12, 2011 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 More sharing options...
ZanaxNL Posted January 12, 2011 Author Share Posted January 12, 2011 (edited) 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*NewbI know but i cannot figure out a good title : ( Edited January 12, 2011 by ZanaxNL Link to comment Share on other sites More sharing options...
ZanaxNL Posted January 12, 2011 Author Share Posted January 12, 2011 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 More sharing options...
C45Y Posted January 12, 2011 Share Posted January 12, 2011 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 More sharing options...
ZanaxNL Posted January 13, 2011 Author Share Posted January 13, 2011 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 More sharing options...
ZanaxNL Posted January 13, 2011 Author Share Posted January 13, 2011 (edited) 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 January 13, 2011 by ZanaxNL Link to comment Share on other sites More sharing options...
C45Y Posted January 15, 2011 Share Posted January 15, 2011 yes thats basically it. just find out where the firefox window is located, then add said amount of pixels to the button you need. Sounds like you've figured it out. Glad to help http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now