Jump to content

Recommended Posts

Posted (edited)

im programming a bot thats checking for specific colors. as it is now i need to place the window (Internet explorer)

at an absolute place to be able to use the bot and if i move my IE window then the bot wont work. so i wonder if their is a way to find the game in the IEwindow even if its positioned at another pixelvalue on the screen?

thanks alot for taking time!

Edited by joeyone
Posted

im programming a bot thats checking for specific colors. as it is now i need to place the window (Internet explorer)

at an absolute place to be able to use the bot and if i move my IE window then the bot wont work. so i wonder if their is a way to find the game in the IEwindow even if its positioned at another pixelvalue on the screen?

thanks alot for taking time!

Well, if you're going with an absolute positioning requirement for your IE window, you could use WinMove() to force the IE window to a specific placement and window size.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Posted

Well, if you're going with an absolute positioning requirement for your IE window, you could use WinMove() to force the IE window to a specific placement and window size.

But is there a option to have a relative position of the window and find the right values to be able to use the bot even when its not at the same place all the time?

Posted

Maybe a timer pointing to a WinPos-ish sort of function. Just a suggestion

----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Posted (edited)

Look up "Opt" or "MouseCoordMode" and "PixelCoordMode" in the help

You can set all your mouse movement functions and pixel functions to be based off the client area of the window. That way, no matter where your window moves, it will still work. 0,0 is no longer the top left corner of the screen, but the top left corner of the IE Client area, or window.

Eg:

opt("MouseCoordMode",2)  ; Mousemovements are now relative to 0,0 of active windows client area
opt("WinTitleMatchMode",2)

Run("Notepad")
WinWaitActive("Notepad")
WinMove("Notepad","",default, default ,400,400)
Msgbox(0,"","Moving mouse to 100,100 of Notepads client area")
WinWaitActive("Notepad")
MouseMove(100,100,10)
Msgbox(0,"","Go ahead and move the notepad window around now on your screen.  Click OK on this message box" & @CRLF & _
            "And I will move the mouse to 100,100 of the client area again.")
WinWaitActive("Notepad")
MouseMove(100,100,10)
Edited by covaks

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
  • Recently Browsing   0 members

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