Coins Posted April 26, 2009 Share Posted April 26, 2009 Hi, im new to autoit, so at the moment, im trying to make it send "Right Click" to the minimized window, the good thing, it works ONCE but its suppose to do it 3 times, but it only right clicks one no matter how many clicks I tell it to do. expandcollapse popupGlobal $yaxis = 3 Global $xaxis = 28 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 Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Func Start() _Mouseclickplus("Diablo II", "right", 8 - $yaxis, 94 - $xaxis, 400) EndFunc As you can see, i supplied 400 click, still only does 1.... If anyone can help me, please. Link to comment Share on other sites More sharing options...
Marlo Posted April 26, 2009 Share Posted April 26, 2009 Maybe your overloading the click function, so maybe insert a sleep somewhere in the Click loop like so: expandcollapse popupGlobal $yaxis = 3 Global $xaxis = 28 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)) sleep(20) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Func Start() _Mouseclickplus("Diablo II", "right", 8 - $yaxis, 94 - $xaxis, 400) EndFunc untested Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Coins Posted April 26, 2009 Author Share Posted April 26, 2009 (edited) Doesn't work, do you think you can give it another try please. Edited April 26, 2009 by Coins Link to comment Share on other sites More sharing options...
Coins Posted April 26, 2009 Author Share Posted April 26, 2009 Seems to only work when you got the window up, but I cant put the window up everytime, can anybody help? Link to comment Share on other sites More sharing options...
syno Posted April 27, 2009 Share Posted April 27, 2009 Seems to only work when you got the window up, but I cant put the window up everytime, can anybody help? @SW_MAXIMIZE Maximizes the specified window. Link to comment Share on other sites More sharing options...
Coins Posted April 27, 2009 Author Share Posted April 27, 2009 (edited) @SW_MAXIMIZE Maximizes the specified window. [edit = Thats command, makes it as if the diablo window was full screen, but its window mode, anyway to fix that?] I don't want to make the window pop up at all defeats the purpose kind of, but ill try. IF anyone can please help, im willing to pay 5$ or more for help!! Edited April 27, 2009 by Coins Link to comment Share on other sites More sharing options...
FinalVersion Posted April 27, 2009 Share Posted April 27, 2009 I don't want to make the window pop up at all defeats the purpose kind of, but ill try. IF anyone can please help, im willing to pay 5$ or more for help!!Good luck making a Diablo 2 Bot in AutoIt, Oh and good ****** luck making a bot in autoit which can have the d2 window minimized. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Coins Posted April 27, 2009 Author Share Posted April 27, 2009 Good luck making a Diablo 2 Bot in AutoIt, Oh and good ****** luck making a bot in autoit which can have the d2 window minimized.Sarcasm much? Link to comment Share on other sites More sharing options...
Marlo Posted April 27, 2009 Share Posted April 27, 2009 Very accurate sarcasm by the sound of it. Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Coins Posted April 27, 2009 Author Share Posted April 27, 2009 Very accurate sarcasm by the sound of it.Im guessing if its hard, then ok, but Maximize makes the wndow act as if it was fullscreen, but its really window mod, anyway to set the actual size? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2009 Developers Share Posted April 27, 2009 Im guessing if its hard, then ok, but Maximize makes the wndow act as if it was fullscreen, but its really window mod, anyway to set the actual size?What is with typing all your replies with bold characters?Can't be that everything you type has to stand out ...right? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Coins Posted April 27, 2009 Author Share Posted April 27, 2009 What is with typing all your replies with bold characters?Can't be that everything you type has to stand out ...right?Sorry ^^ I perfer bold on anything really.Still looking to get this done, its only the teleport part, it wont send multiple click to the window while minimized, everything else is easy, so it can be ran minimized. Link to comment Share on other sites More sharing options...
FinalVersion Posted April 28, 2009 Share Posted April 28, 2009 Sorry ^^ I perfer bold on anything really. Still looking to get this done, its only the teleport part, it wont send multiple click to the window while minimized, everything else is easy, so it can be ran minimized.Uh.. @SW_SHOW [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] 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