OtokIT Posted April 15, 2006 Share Posted April 15, 2006 (edited) expandcollapse popupOpt("MouseCoordMode", 0) HotKeySet("+!d", "mPos");Shift-Alt-d HotKeySet("+!s", "sClick");Shift-Alt-s $winTitle = WinGetTitle(""); $pos = MouseGetPos() Func mPos() $pos = MouseGetPos() $winTitle = WinGetTitle(""); MsgBox(0, $winTitle & " Mouse x,y:", $pos[0] & "," & $pos[1]) EndFunc ;==>mPos Func sClick() MouseMove($pos[0], $pos[1]) _MouseClickPlus($winTitle, "left", $pos[0], $pos[1]) EndFunc ;==>sClick WinWaitActive("empyrean") ;=============================================================================== ; ; Function Name: _MouseClickPlus() ; Version added: 0.1 ; Description: Sends a click to window, not entirely accurate, but works ; minimized. ; Parameter(s): $Window = Title of the window to send click to ; $Button = "left" or "right" mouse button ; $X = X coordinate ; $Y = Y coordinate ; $Clicks = Number of clicks to send ; Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs. ; Author(s): Insolence <insolence_9@yahoo.com> ; ;=============================================================================== Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X = "" Or $Y = "" Then $MouseCoord = MouseGetPos() $X = $MouseCoord[0] $Y = $MouseCoord[1] EndIf For $i = 1 To $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle($Window), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle($Window), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle($Window), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X, $Y)) Next EndFunc ;==>_MouseClickPlus Func _MakeLong($LoWord, $HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc ;==>_MakeLongAttempting to use the code from this topic, http://www.autoitscript.com/forum/index.ph...=7112&hl=diabloNo matter what I test it on it will not work. There's a button on a webpage and I want to click that while it's minimized. gratitude OtokIT Edited April 15, 2006 by OtokIT Link to comment Share on other sites More sharing options...
Uten Posted April 15, 2006 Share Posted April 15, 2006 I'm not sure but I think the windows message pump will supress mouse messages outside the button on the taskbare (and/or icons in the Tray) to a minimized window? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
OtokIT Posted April 15, 2006 Author Share Posted April 15, 2006 I'm not sure but I think the windows message pump will supress mouse messages outside the button on the taskbare (and/or icons in the Tray) to a minimized window?If you look at how I have it setup, I don't think that should be an issue.mPos() sets the information then sClick() uses it.How would I change it to make it work? Right now it's just a generic script that can send a mouse click to any target window but it's not working at all! Link to comment Share on other sites More sharing options...
TenTen Posted April 16, 2006 Share Posted April 16, 2006 Don't think you can click with autoit riight now. Maybe in the beta. Link to comment Share on other sites More sharing options...
cdkid Posted April 16, 2006 Share Posted April 16, 2006 For a web page, why not just use IE.au3? AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
OtokIT Posted April 16, 2006 Author Share Posted April 16, 2006 For a web page, why not just use IE.au3?IE.au3 cannot automate clicks in a flash object, if it can I would enjoy an example. What I must do is click on a flash game different points over time and then navigate to a new you-are-el. I am hoping that this script can be fixed to work not incorrectly.appreciation for your reply Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 16, 2006 Share Posted April 16, 2006 could you possibly provide the link to the game? Link to comment Share on other sites More sharing options...
OtokIT Posted April 16, 2006 Author Share Posted April 16, 2006 could you possibly provide the link to the game?Yes.http://www.ebaumsworld.com/helicopter.shtmlI tried using google some more but I have not found a nice solution unless I can send packets or HTTP headers directly and programaticly in an easy way.... Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 16, 2006 Share Posted April 16, 2006 (edited) this might make it easier to make a bot,http://media.ebaumsworld.com/copter.swfand i got 1291 wow wait im still confused at the question , do u want a bot to play the game or just what?cuz by the way if u were compiling that , thats a UDF not a script Edited April 16, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
OtokIT Posted April 16, 2006 Author Share Posted April 16, 2006 this might make it easier to make a bot,http://media.ebaumsworld.com/copter.swfand i got 1291 wow wait im still confused at the question , do u want a bot to play the game or just what?cuz by the way if u were compiling that , thats a UDF not a scriptI'm not boting it, just sending clicks to it. There's a difference. Boting would imply doing something intelligent where I'm just crashing it over, and over.If you look at my code and can't figure out what it's doing then I'm in shock.1st you set the window name and the mouse position then you run the other function to "minimize click" at that location.The UDF I'm trying to use sucks apparently. I'm hoping for a fix. Link to comment Share on other sites More sharing options...
OtokIT Posted April 16, 2006 Author Share Posted April 16, 2006 Can anyone else confirm that the UDF in question is broken OR provide a working example...? It seems broken. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 16, 2006 Share Posted April 16, 2006 im busy but ill post something later on , i got homework to finish so yeah, idk why u want to make it crash over and over but yeah ok Link to comment Share on other sites More sharing options...
OtokIT Posted April 17, 2006 Author Share Posted April 17, 2006 im busy but ill post something later on , i got homework to finish so yeah, idk why u want to make it crash over and over but yeah okOkay thanks.Just remember the clicks have to be "minimized" ones, check out the thread I linked to in my first post.:heart: 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