Crome_BAD Posted December 31, 2004 Share Posted December 31, 2004 Try this, run diablo in -w Mode I Run D2Loader, just change it to work on ur d2 window name expandcollapse popupGlobal $yaxis = 3 Global $xaxis = 28 Start() Func Start() Opt( "MouseCoordMode", 0) _MouseClickPlus( "D2Loader", "left", 396 - $yaxis, 328 - $xaxis, 1);Selects Single Player Sleep(1000) _MouseClickPlus( "D2Loader", "left", 172 - $yaxis, 151 - $xaxis, 2);Selects Character 1 EndFunc 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 Post Back Link to comment Share on other sites More sharing options...
quick_sliver007 Posted March 31, 2005 Share Posted March 31, 2005 Is there a way for PixelGetColor() in a minimize window? I hate to ask for someone to make the function, but I have no ideal how to make it myself. I would be very thankful. . Link to comment Share on other sites More sharing options...
Insolence Posted March 31, 2005 Author Share Posted March 31, 2005 I tried many ways, and nope not possible "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
quick_sliver007 Posted March 31, 2005 Share Posted March 31, 2005 I tried many ways, and nope not possible <{POST_SNAPBACK}>There is only one way I can think of but I have no ideal how to code it.1. Do a screen capture.2.Convert screen capture to a string.3.Split the string in to the blocks of each pixels.4.Give the blocks X,Y coordinates as to the location in the string.This could be all wrong but what do I know.P.S. Very nice _mouseclickplus(). . Link to comment Share on other sites More sharing options...
Insolence Posted March 31, 2005 Author Share Posted March 31, 2005 Thank you, but all those methods are over kill. I simply tried a DLLCall to the actual windows API to get the pixel, to no avail. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
jackyyll Posted April 5, 2005 Share Posted April 5, 2005 So basically this is a virtual clicking thing? Link to comment Share on other sites More sharing options...
Insolence Posted April 5, 2005 Author Share Posted April 5, 2005 Virtual clicking thing? It works just like AutoIt's clicking except it sends clicks in to a window, so it works minimized. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
jackyyll Posted April 6, 2005 Share Posted April 6, 2005 It's not clicking on the right place for me, or something, heres my code: expandcollapse popupGlobal $X = "800" Global $Y = "470" $ErrorTitle = "Instruction" AdlibEnable ( "_WinCheck", 10 ) HotKeySet("{PAUSE}", "EndScript") $start = MsgBox(4+16+0+4096+0, "Theivery Bot", "End Theivery Bot? Press 'No' to start the bot. Press the PAUSE key to stop the bot.") If $start = 6 Then Exit EndIf While 1 _IfActive() WEnd Func _MouseClickPlus($Window, $Button = "right", $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 _IfActive() Send('{F9}') _MouseClickPlus( "Monster&Me - MythOfOrient", "right", $X , $Y) Sleep(0) EndFunc Func _WinCheck() If WinExists ( $ErrorTitle ) Then WinActivate ( $ErrorTitle ) Send ( "o" ) EndIf EndFunc ; Function to exit script Func EndScript() $exit = MsgBox(4+16+0+4096+0, "Theivery Bot", "End Theivery Bot?") If $exit = 6 Then Exit EndIf EndFunc Link to comment Share on other sites More sharing options...
Insolence Posted April 7, 2005 Author Share Posted April 7, 2005 Come on... I answered in at the bottom of the first post "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
jackyyll Posted April 7, 2005 Share Posted April 7, 2005 I dont think the offsets affect my game. Link to comment Share on other sites More sharing options...
Insolence Posted April 7, 2005 Author Share Posted April 7, 2005 Did you try? That's the only explination I have. Try to figure it out... see where it's clicking and where your coord is... "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
jftuga Posted May 24, 2005 Share Posted May 24, 2005 The _MouseClickPlus() UDF looks pretty cool. I'll have to check it out. -John Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
Scorpius Posted July 6, 2005 Share Posted July 6, 2005 (edited) Hmmmm I'm having some problems with this in Star Wars Galaxies, seems just to not click anything, I tried to not set coords and make it click where mouse was and still nothing. Here is my code that I use now. expandcollapse popupOpt("MouseClickDelay", 1) Opt("MouseCoordMode", 0) Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 2) 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 $j = 0 While $j <= 10 If WinExists("Windows Task Manager") Then Exit EndIf _MouseClickPlus("SwgClient", "left") _MouseClickPlus("SwgClient", "left", 430, 260) _MouseClickPlus("SwgClient", "left", 490, 260) _MouseClickPlus("SwgClient", "left", 360, 325) _MouseClickPlus("SwgClient", "left", 425, 325) WEnd Edited July 6, 2005 by Scorpius Link to comment Share on other sites More sharing options...
fastnick1oo Posted November 5, 2005 Share Posted November 5, 2005 (edited) I have same problem with World of Warcraft, this function doesn't click when window is minimized, only when i activate window and move mouse over it. Edited November 5, 2005 by fastnick1oo SciTE - much better than notepad. ; ] Link to comment Share on other sites More sharing options...
jackyyll Posted November 5, 2005 Share Posted November 5, 2005 Hmm is there a way to send keys to ONLY the game? Link to comment Share on other sites More sharing options...
jackyyll Posted November 6, 2005 Share Posted November 6, 2005 It wont right click for me :/ Heres my code... expandcollapse popup;Theivery Bot V0.2 ;By jackyyll ;11.5.05 ;Stuff $ErrorTitle = "Instruction" AdlibEnable ( "_WinCheck", 10 ) HotKeySet("{PAUSE}", "EndScript") ;End Stuff ;GUI #include <GUIConstants.au3> $MyGUI = GuiCreate("Theivery Bot", 250, 250) GuiCtrlCreateTab(1, 1, 250, 250) GuiCtrlCreateTabItem("About") GuiCtrlCreateLabel("Theivery bot By jackyyll", 5, 40) GuiCtrlCreateTabItem("Theivery") GuiCtrlCreateLabel("Theivery Bot", 85, 40) GuiCtrlCreateLabel("Instructions:", 88, 55) GuiCtrlCreateLabel("Press F10 to launch the mouse locator.", 30, 70) GuiCtrlCreateLabel("Put the X and Y values in the input boxes.", 25, 85) GuiCtrlCreateLabel("X", 45, 135) GuiCtrlCreateLabel("Y", 80, 135) $x1 = GuiCtrlCreateInput("", 35, 150, 30, 20) $y1 = GuiCtrlCreateInput("", 70, 150, 30, 20) $start = GuiCtrlCreateCheckbox("Run", 175, 150, 50, 20) GuiCtrlSetState(-1, $GUI_UNCHECKED) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case GUICtrlRead($start) <> 4 While GUICtrlRead($start) <> 4 Steal() WEnd Case GUICtrlRead($start) = -1 ExitLoop EndSelect WEnd GUIDelete() Exit ;Functions ;Mouse Locator Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMouse() If $T = 0 Then $T = 1 Return EndIf If $T = 1 Then ToolTip("") $T = 0 Return EndIf EndFunc ;End Mouse Locator ;Close error Func _WinCheck() If WinExists ( $ErrorTitle ) Then WinActivate ( $ErrorTitle ) Send ( "o" ) EndIf EndFunc ;End Close Eror ;Steal Func Steal() Opt( "MouseCoordMode", 0) Send('{F9}') _MouseClickPlus( "Monster&Me - MythOfOrient", "right", $x1 , $y1 , 2) Sleep(300) EndFunc ;End Steal ;Exit Bot Func EndScript() $exit = MsgBox(4+16+0+4096+0, "Theivery Bot", "End Theivery Bot?") If $exit = 6 Then Exit EndIf EndFunc ;End Exit Bot ;SilentMouse 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 ;End SilentMouse Link to comment Share on other sites More sharing options...
fastnick1oo Posted November 6, 2005 Share Posted November 6, 2005 Maby this function doesn't work for v3? Maby it's for beta only?Insolence please reply. I really need this function. SciTE - much better than notepad. ; ] Link to comment Share on other sites More sharing options...
jackyyll Posted November 6, 2005 Share Posted November 6, 2005 Yeah, i really need it to. Would make my bot much much more efficient. I have beta though.. :/ Link to comment Share on other sites More sharing options...
Azothoras Posted November 7, 2005 Share Posted November 7, 2005 Works perfectly fine with diablo II but not World of Warcraft... What do I do wrong? I've tried alot of different things but without result... Opt( "MouseCoordMode", 0) Func Start() _MouseClickPlus( "World of Warcraft", "left", 766 - $yaxis, 588 - $xaxis, 1) _MouseClickPlus( "World of Warcraft", "left", 775 - $yaxis, 603 - $xaxis, 2) EndFunc 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 Link to comment Share on other sites More sharing options...
jackyyll Posted November 7, 2005 Share Posted November 7, 2005 I think that ths only words with diablo two or something... Maybe because of the DLL's? Link to comment Share on other sites More sharing options...
Recommended Posts