Jump to content
Sign in to follow this  
Coins

Diablo 2 teleport problem

Recommended Posts

Coins

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.

Global $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.

Share this post


Link to post
Share on other sites
Marlo

Maybe your overloading the click function, so maybe insert a sleep somewhere in the Click loop like so:

Global $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

Share this post


Link to post
Share on other sites
Coins

Doesn't work, do you think you can give it another try please. ^_^

Edited by Coins

Share this post


Link to post
Share on other sites
Coins
Seems to only work when you got the window up, but I cant put the window up everytime, can anybody help?

Share this post


Link to post
Share on other sites
syno

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.

Share this post


Link to post
Share on other sites
Coins

@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 by Coins

Share this post


Link to post
Share on other sites
FinalVersion

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.

Share this post


Link to post
Share on other sites
Coins

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?

Share this post


Link to post
Share on other sites
Coins

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?

Share this post


Link to post
Share on other sites
Jos

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?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Coins

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.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×