Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 13:46

  • Please register to post and access all features, it's quick, easy and FREE!

 

Ether Saga Online-[Starter Pack]

Closed Thread
 
Old   #16
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by donaru View Post
hmmm..... reading memory and executing the key sets is a workable solution, I've been thinking about how to target the creeps and move on to the next creep when it dies.

Just not sure what to check in for in those memory offsets.

But the minimize key send is awessome ... I was about to look into it but this info saves me the trouble. Thank you !!!!
Is the minimized sendkeys working more than once for you? I only get it to send it one time, then I must restart the bot in order to send another I do not know why. But targeting is easy to figure.

If $PlayerTarget <> 0 then
'Do Attack Function
Else
'Send Tab Key to retarget
EndIF

also you have here Video = &Ha40c9c.
what exactly is video ?



blinko is offline  
Old   #17
 
elite*gold: 20
Join Date: Nov 2007
Posts: 2,827
Received Thanks: 1,842
+2-12 Reported At: Sun 28 Feb 2010 - 11:42:41 GMT +1 Cause: Double Post
+16 Reported At: Sun 28 Feb 2010 - 11:42:41 GMT +1 Cause: Double Post


janvier123 is offline  
Old   #18
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
excuse me?

Quote:
Originally Posted by janvier123 View Post
+2-12 Reported At: Sun 28 Feb 2010 - 11:42:41 GMT +1 Cause: Double Post
+16 Reported At: Sun 28 Feb 2010 - 11:42:41 GMT +1 Cause: Double Post
Am i being reported for double posting? I don't get what this means
If I'm being reported for things I have clearly not done (I use the edit button) then I shall move all of my work elsewhere..
blinko is offline  
Old   #19
 
elite*gold: 0
Join Date: Jan 2009
Posts: 31
Received Thanks: 2
Blinko, those addys are client sided correct?


weird0ne is offline  
Old   #20
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
hmm..

Quote:
Originally Posted by weird0ne View Post
Blinko, those addys are client sided correct?
Yes they are.
All Memory Reading/writing is client sided that I am aware of.
The only way I know to gain server sided access would be through packet capturing, decrypting, re-writing (editing), encrypting, sending.
Reading Memory as far as I know is pulling information from allocated memory stored in the applications virtual memory (RAM). You will see the changes, but no one else will; kinda like when you mod the game files, you may see the edited texture/skin (should you be doing a texture/skin mod XD), but others will not be able to enjoy the mod unless they too install it.

So far my AutoIt project can do it all Read's all memory types. I added two new Functions to the EtherMemory.au3 file and have cleaned out the stuff I didn't use. This will be uploaded here soon.
Code:
_ReadSagaFlt ($BaseAddress, $Offset) - Reads Float value (Player Coordinates X,Y,Z)
_ReadSagaDbl ($BaseAddress, $Offset) - Reads Double value (Player Spirit, Exp)

Example:

$BaseAddress = 0x00A69254
$PlayerX = 0x7C
$Player_X = _ReadSagaFlt ($BaseAddress, $PlayerX)

the 0x28 offset is already calculated as with the previous version of this script, so you just need to set the offset for the final pointer.
It also can perform many bot functions now using the ControlClick() function.

My VB6.0 project can read all memory types except for doubles atm..
I need to work out bot functions for this project since VB requires more Windows API calls than what AutoIt already provides you for sending commands etc..but yeah both updated projects will be uploaded here soon, with my first post edited...so check back !
blinko is offline  
Old   #21
 
elite*gold: 0
Join Date: Jan 2010
Posts: 18
Received Thanks: 2
Quote:
Originally Posted by blinko View Post
My VB6.0 project can read all memory types except for doubles atm..
I need to work out bot functions for this project since VB requires more Windows API calls than what AutoIt already provides you for sending commands etc..but yeah both updated projects will be uploaded here soon, with my first post edited...so check back !
Or you can check out Currently trying to get my bot to send keys/mouse to inactive/minimized window.
mibiz1 is offline  
Old   #22
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
yo

Quote:
Originally Posted by mibiz1 View Post
Or you can check out Currently trying to get my bot to send keys/mouse to inactive/minimized window.
I'm not much of a C# programmer, however, AutoIt is very similar to C#.
I'll have a look at it though as I know enough to get around while using the C# language. I'm sure we can get it sending keys to an inactive window very easily.
Only thing we'd need to worry about is the control ids. Last I checked ESO did not have any client control ids to attach to or hook. Then I figured out that AutoIt's function ControlClick (mouse clicking) sent the mouse click to the recorded mouse coordinates and executed a click within the Clients window even while minimized; the ControlSend (keyboard) functions simply do not work. So I do not know about sending keys, But you could definately send mouse clicks to the target window at the given coordinates (unfortunately this means we must place our client in a certain area, and then set the hotkeys separate. Unless of course you made an .ini file and stored the window position as well as the mouse coords..o.o then it'd be ok !! I'm going to add that !)

Have a look at this.

Code:
Global $VK_TAB          =  0x09
Global $VK_CLEAR        =  0x0C
Global $VK_RETURN       =  0x0D
Global $VK_SHIFT        =  0x10
Global $VK_CONTROL      =  0x11
Global $VK_ESCAPE       =  0x1B
Global $VK_SPACE        =  0x20
Global $VK_LEFT         =  0x25
Global $VK_UP           =  0x26
Global $VK_RIGHT        =  0x27
Global $VK_DOWN         =  0x28
Global $VK_DELETE       =  0x2E
Global $VK_0            =  0x30
Global $VK_1            =  0x31
Global $VK_2            =  0x32
Global $VK_3            =  0x33
Global $VK_4            =  0x34
Global $VK_5            =  0x35
Global $VK_6            =  0x36
Global $VK_7            =  0x37
Global $VK_8            =  0x38
Global $VK_9            =  0x39
Global $VK_A            =  0x41
Global $VK_B            =  0x42
Global $VK_C            =  0x43
Global $VK_D            =  0x44
Global $VK_E            =  0x45
Global $VK_F            =  0x46
Global $VK_G            =  0x47
Global $VK_H            =  0x48
Global $VK_I            =  0x49
Global $VK_J            =  0x4A
Global $VK_K            =  0x4B
Global $VK_L            =  0x4C
Global $VK_M            =  0x4D
Global $VK_N            =  0x4E
Global $VK_O            =  0x4F
Global $VK_P            =  0x50
Global $VK_Q            =  0x51
Global $VK_R            =  0x52
Global $VK_S            =  0x53
Global $VK_T            =  0x54
Global $VK_U            =  0x55
Global $VK_V            =  0x56
Global $VK_W            =  0x57
Global $VK_X            =  0x58
Global $VK_Y            =  0x59
Global $VK_Z            =  0x5A
Global $VK_NUMPAD0      =  0x60
Global $VK_NUMPAD1      =  0x61
Global $VK_NUMPAD2      =  0x62
Global $VK_NUMPAD3      =  0x63
Global $VK_NUMPAD4      =  0x64
Global $VK_NUMPAD5      =  0x65
Global $VK_NUMPAD6      =  0x66
Global $VK_NUMPAD7      =  0x67
Global $VK_NUMPAD8      =  0x68
Global $VK_NUMPAD9      =  0x69
Global $VK_MULTIPLY     =  0x6A
Global $VK_ADD          =  0x6B
Global $VK_SEPARATOR    =  0x6C
Global $VK_SUBTRACT     =  0x6D
Global $VK_DECIMAL      =  0x6E
Global $VK_DIVIDE       =  0x6F
Global $VK_F1           =  0x70
Global $VK_F2           =  0x71
Global $VK_F3           =  0x72
Global $VK_F4           =  0x73
Global $VK_F5           =  0x74
Global $VK_F6           =  0x75
Global $VK_F7           =  0x76
Global $VK_F8           =  0x77
Global $VK_F9           =  0x78
Global $VK_F10          =  0x79
Global $VK_F11          =  0x7A
Global $VK_F12          =  0x7B
Global $VK_F13          =  0x7C
Global $VK_F14          =  0x7D
Global $VK_F15          =  0x7E
Global $VK_F16          =  0x7F
Global $VK_F17          =  0x80
Global $VK_F18          =  0x81
Global $VK_F19          =  0x82
Global $VK_F20          =  0x83
Global $VK_F21          =  0x84
Global $VK_F22          =  0x85
Global $VK_F23          =  0x86
Global $VK_F24          =  0x87
Global $VK_NUMLOCK      =  0x90
Global $VK_SCROLL       =  0x91

Global $VK_OEM_NEC_EQUAL = 0x92   ;// '=' key on numpad

Global $VK_OEM_1         = 0xBA   ;// ';:' for US
Global $VK_OEM_PLUS      = 0xBB   ;// '+' any country
Global $VK_OEM_COMMA     = 0xBC   ;// ',' any country
Global $VK_OEM_MINUS     = 0xBD   ;// '-' any country
Global $VK_OEM_PERIOD    = 0xBE   ;// '.' any country
Global $VK_OEM_2         = 0xBF   ;// '/?' for US
Global $VK_OEM_3         = 0xC0   ;// '`~' for US

Global $VK_OEM_4         = 0xDB  ;//  '[{' for US
Global $VK_OEM_5         = 0xDC  ;//  '\|' for US
Global $VK_OEM_6         = 0xDD  ;//  ']}' for US
Global $VK_OEM_7         = 0xDE  ;//  ''"' for US
Global $VK_OEM_8         = 0xDF

Global $VK_OEM_102       = 0xE2  ;//  "<>" or "\|" on RT 102-key kbd.
Global $VK_ICO_HELP      = 0xE3  ;//  Help key on ICO
Global $VK_ICO_00        = 0xE4  ;//  00 key on ICO
Global $VK_OEM_BACKTAB   = 0xF5


Global $WM_KEYDOWN       = 0x100 ;;declared in WindowConstants.au3
Global $WM_KEYUP         = 0x101 ;;declared in WindowConstants.au3

Func _SendMinimizedMessage($winhandle,$msgstring,$raw = 0)
    If $winhandle = "" Then
        ;; illegal number of parameters?
        MsgBox(32, "KCH: Problem", "SendMinimizedMessage() called with bad number of params?")
        Return
    EndIf
    Local $i = 0
    while $i < StringLen($msgstring)
        $i = $i + 1
        Local $var = StringMid($msgstring,$i,1)
        if $raw = 1 Then
            _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
        Else
            if $var = "{" Then
                Local $var2 = StringInStr(StringMid($msgstring,$i+1),"}",2)
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i+1,$var2-1))
                $i = $i + $var2
            Else
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
            EndIf
        EndIf
        Sleep(50)
    WEnd
    Return
EndFunc

Func _SendMinimizedVK($winhandle,$vkstring)
    Local $var = _GetHexByKey_Switch($vkstring)
    if Not ($var = -1) Then
        DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $winhandle, _
        "int", $WM_KEYDOWN, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0)
        DllCall("user32.dll", "int", "SendMessage", _ ;SendMessage only works ingame, not in lobby
        "hwnd", $winhandle, _
        "int", $WM_KEYUP, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0) 
     ConsoleWrite(1 & @CRLF) ;debug Success
        Return 1
    EndIf
 ConsoleWrite(0 & @CRLF) ;debug Failed
    Return 0
EndFunc

Func _GetHexByKey_Switch($sKey)
    Switch $sKey
        Case "LeftMouse"            
            Return 0x01 
        Case "RightMouse"           
            Return 0x02     
        Case "MiddleMouse"          
            Return 0x04     
        Case "X1Mouse"          
            Return 0x05     
        Case "X2Mouse"          
            Return 0x06     
        Case "BACKSPACE"            
            Return 0x08     
        Case "TAB"          
            Return 0x09     
        Case "CLEAR"            
            Return 0x0C     
        Case "ENTER"            
            Return 0x0D     
        Case "SHIFT"            
            Return 0x10     
        Case "CTRL"         
            Return 0x11     
        Case "ALT"          
            Return 0x12     
        Case "PAUSE"            
            Return 0x13     
        Case "CAPSLOCK"         
            Return 0x14     
        Case "ESC"          
            Return 0x1B     
        Case " "            
            Return 0x20 
        Case "SPACE"            
            Return 0x20     
        Case "PAGE UP"          
            Return 0x21     
        Case "PAGE DOWN"            
            Return 0x22     
        Case "END"          
            Return 0x23     
        Case "HOME"         
            Return 0x24     
        Case "LEFT"         
            Return 0x25     
        Case "UP"           
            Return 0x26     
        Case "RIGHT"            
            Return 0x27     
        Case "DOWN"         
            Return 0x28     
        Case "SELECT"           
            Return 0x29     
        Case "PRINT"            
            Return 0x2A     
        Case "EXECUTE"          
            Return 0x2B     
        Case "PRINT SCREEN"         
            Return 0x2C     
        Case "INS"          
            Return 0x2D     
        Case "DEL"          
            Return 0x2E     
        Case "0"            
            Return 0x30     
        Case "1"            
            Return 0x31     
        Case "2"            
            Return 0x32     
        Case "3"            
            Return 0x33     
        Case "4"            
            Return 0x34     
        Case "5"            
            Return 0x35     
        Case "6"            
            Return 0x36     
        Case "7"            
            Return 0x37     
        Case "8"            
            Return 0x38     
        Case "9"            
            Return 0x39     
        Case "A"            
            Return 0x41     
        Case "B"            
            Return 0x42     
        Case "C"            
            Return 0x43     
        Case "D"            
            Return 0x44     
        Case "E"            
            Return 0x45     
        Case "F"        
            Return 0x46     
        Case "G"            
            Return 0x47     
        Case "H"            
            Return 0x48     
        Case "I"            
            Return 0x49     
        Case "J"            
            Return 0x4A     
        Case "K"            
            Return 0x4B     
        Case "L"            
            Return 0x4C     
        Case "M"            
            Return 0x4D     
        Case "N"            
            Return 0x4E     
        Case "O"            
            Return 0x4F     
        Case "P"            
            Return 0x50     
        Case "Q"            
            Return 0x51     
        Case "R"            
            Return 0x52     
        Case "S"            
            Return 0x53     
        Case "T"            
            Return 0x54     
        Case "U"            
            Return 0x55     
        Case "V"            
            Return 0x56     
        Case "W"            
            Return 0x57     
        Case "X"            
            Return 0x58     
        Case "Y"            
            Return 0x59     
        Case "Z"            
            Return 0x5A     
        Case "LWin"         
            Return 0x5B     
        Case "RWin"         
            Return 0x5C     
        Case "NUMPAD0"          
            Return 0x60     
        Case "NUMPAD1"          
            Return 0x61     
        Case "NUMPAD2"          
            Return 0x62     
        Case "NUMPAD3"          
            Return 0x63     
        Case "NUMPAD4"          
            Return 0x64     
        Case "NUMPAD5"          
            Return 0x65     
        Case "NUMPAD6"          
            Return 0x66     
        Case "NUMPAD7"          
            Return 0x67     
        Case "NUMPAD8"          
            Return 0x68     
        Case "NUMPAD9"          
            Return 0x69     
        Case "Multiply"         
            Return 0x6A     
        Case "Add"          
            Return 0x6B     
        Case "Separator"            
            Return 0x6C     
        Case "Subtract"         
            Return 0x6D     
        Case "Decimal"          
            Return 0x6E     
        Case "Divide"           
            Return 0x6F     
        Case "F1"           
            Return 0x70     
        Case "F2"           
            Return 0x71     
        Case "F3"           
            Return 0x72     
        Case "F4"           
            Return 0x73     
        Case "F5"           
            Return 0x74     
        Case "F6"           
            Return 0x75     
        Case "F7"           
            Return 0x76     
        Case "F8"           
            Return 0x77     
        Case "F9"           
            Return 0x78     
        Case "F10"          
            Return 0x79     
        Case "F11"          
            Return 0x7A     
        Case "F12"          
            Return 0x7B     
        Case "F13"          
            Return 0x7C     
        Case "F16"          
            Return 0x7F     
        Case "F17"          
            Return 0x80 
        Case "F18"          
            Return 0x81
        Case "F19"          
            Return 0x82 
        Case "F20"          
            Return 0x83 
        Case "F21"          
            Return 0x84 
        Case "F22"          
            Return 0x85 
        Case "F23"          
            Return 0x86     
        Case "F24"          
            Return 0x87     
        Case "NUM LOCK"         
            Return 0x90 
        Case "SCROLL LOCK"          
            Return 0x91     
        Case "LSHIFT"           
            Return 0xA0     
        Case "RSHIFT"           
            Return 0xA1     
        Case "LCTRL"            
            Return 0xA2     
        Case "RCTRL"            
            Return 0xA3     
        Case "LMENU"            
            Return 0xA4     
        Case "RMENU"            
            Return 0xA5     
        Case "="
            Return 0x92
        Case ";"
            Return 0xBA
        Case ":"
            Return 0xBA
        Case "+"
            Return 0xBB
        Case ","
            Return 0xBC
        Case "-"
            Return 0xBD
        Case "."
            Return 0xBE
        Case "/"
            Return 0xBF
        Case "?"
            Return 0xBF
        Case "`"
            Return 0xC0
        Case "~"
            Return 0xC0
        Case "["
            Return 0xDB
        Case "{"
            Return 0xDB
        Case "\"
            Return 0xDC
        Case "|"
            Return 0xDC
        Case "]"
            Return 0xDD
        Case "}"
            Return 0xDD
        Case "'"
            Return 0xDE
        Case '"'
            Return 0xDE
        Case "<"
            Return 0xE2
        Case ">"
            Return 0xE2
    EndSwitch
    Return -1
EndFunc   ;==>_GetHexByKey_Switch

;===============================================================================
;
; Function Name:  _MouseClickMinimized()
; 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 (cpf: or 2???) to use this without bugs.
; Author(s):      Insolence <>
;
;===============================================================================
Func _MouseClickMinimized($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1, $handle = 0)
    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
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    Select
        Case $Button = "right"
            $Button = $MK_RBUTTON
            $ButtonDown = $WM_RBUTTONDOWN
            $ButtonUp = $WM_RBUTTONUP
        Case $Button = "left"
            $Button = $MK_LBUTTON
            $ButtonDown = $WM_LBUTTONDOWN
            $ButtonUp = $WM_LBUTTONUP
        Case Else  ;; CPF
            ;; illegal number of parameters?
;~             MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
            Return
    EndSelect
    ;; makes no sense to send click to minimized window with current mouse coordinates
    If $X = "" Or $Y = "" Then
        ;; illegal number of parameters?
;~         MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
        Return
    EndIf
    For $i = 1 To $Clicks
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $WM_MOUSEMOVE, _
                "int", 0, _
                "long", _MakeLong($X, $Y))
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonDown, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
        Sleep(10)
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonUp, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
    Next
EndFunc   ;==>_MouseClickMinimized

;===============================================================================
;
; Function Name:  _MouseMoveMinimized()
; Version added:  0.1
; Description:    Sends a move message to window, works minimized.
; Parameter(s):   $Window     =  Title of the window to send click to
;                 $X          =  X coordinate
;                 $Y          =  Y coordinate
; Remarks:        You MUST be in "MouseCoordMode" 0 (cpf: or 2???) to use this without bugs.
; Author(s):      Cris Fuhrman (based on code by Insolence <>)
;
;===============================================================================
Func _MouseMoveMinimized($Window, $X = "", $Y = "", $handle = 0)
    Local $WM_MOUSEMOVE = 0x0200
    Local $i = 0
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    
    If $X = "" Or $Y = "" Then
;~         MsgBox(32, "KCH: Problem", "_MouseMovePlus() called with bad number of params?")
        Return
    EndIf
    
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd", $winhandle, _
            "int", $WM_MOUSEMOVE, _
            "int", 0, _
            "long", _MakeLong($X, $Y)) 
EndFunc   ;==>_MouseMoveMinimized

Func _MakeLong($LoWord, $HiWord)
    Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc   ;==>_MakeLong
The guy who wrote that piece for AutoIt wrote it for Diablo 2.
The send keys works fine for Diablo as the client has control ids.

The Mouse Click section on the other hand works fine for ESO. SO convert...
Code:
Global $VK_TAB          =  0x09
Global $VK_CLEAR        =  0x0C
Global $VK_RETURN       =  0x0D
Global $VK_SHIFT        =  0x10
Global $VK_CONTROL      =  0x11
Global $VK_ESCAPE       =  0x1B
Global $VK_SPACE        =  0x20
Global $VK_LEFT         =  0x25
Global $VK_UP           =  0x26
Global $VK_RIGHT        =  0x27
Global $VK_DOWN         =  0x28
Global $VK_DELETE       =  0x2E
Global $VK_0            =  0x30
Global $VK_1            =  0x31
Global $VK_2            =  0x32
Global $VK_3            =  0x33
Global $VK_4            =  0x34
Global $VK_5            =  0x35
Global $VK_6            =  0x36
Global $VK_7            =  0x37
Global $VK_8            =  0x38
Global $VK_9            =  0x39
Global $VK_A            =  0x41
Global $VK_B            =  0x42
Global $VK_C            =  0x43
Global $VK_D            =  0x44
Global $VK_E            =  0x45
Global $VK_F            =  0x46
Global $VK_G            =  0x47
Global $VK_H            =  0x48
Global $VK_I            =  0x49
Global $VK_J            =  0x4A
Global $VK_K            =  0x4B
Global $VK_L            =  0x4C
Global $VK_M            =  0x4D
Global $VK_N            =  0x4E
Global $VK_O            =  0x4F
Global $VK_P            =  0x50
Global $VK_Q            =  0x51
Global $VK_R            =  0x52
Global $VK_S            =  0x53
Global $VK_T            =  0x54
Global $VK_U            =  0x55
Global $VK_V            =  0x56
Global $VK_W            =  0x57
Global $VK_X            =  0x58
Global $VK_Y            =  0x59
Global $VK_Z            =  0x5A
Global $VK_NUMPAD0      =  0x60
Global $VK_NUMPAD1      =  0x61
Global $VK_NUMPAD2      =  0x62
Global $VK_NUMPAD3      =  0x63
Global $VK_NUMPAD4      =  0x64
Global $VK_NUMPAD5      =  0x65
Global $VK_NUMPAD6      =  0x66
Global $VK_NUMPAD7      =  0x67
Global $VK_NUMPAD8      =  0x68
Global $VK_NUMPAD9      =  0x69
Global $VK_MULTIPLY     =  0x6A
Global $VK_ADD          =  0x6B
Global $VK_SEPARATOR    =  0x6C
Global $VK_SUBTRACT     =  0x6D
Global $VK_DECIMAL      =  0x6E
Global $VK_DIVIDE       =  0x6F
Global $VK_F1           =  0x70
Global $VK_F2           =  0x71
Global $VK_F3           =  0x72
Global $VK_F4           =  0x73
Global $VK_F5           =  0x74
Global $VK_F6           =  0x75
Global $VK_F7           =  0x76
Global $VK_F8           =  0x77
Global $VK_F9           =  0x78
Global $VK_F10          =  0x79
Global $VK_F11          =  0x7A
Global $VK_F12          =  0x7B
Global $VK_F13          =  0x7C
Global $VK_F14          =  0x7D
Global $VK_F15          =  0x7E
Global $VK_F16          =  0x7F
Global $VK_F17          =  0x80
Global $VK_F18          =  0x81
Global $VK_F19          =  0x82
Global $VK_F20          =  0x83
Global $VK_F21          =  0x84
Global $VK_F22          =  0x85
Global $VK_F23          =  0x86
Global $VK_F24          =  0x87
Global $VK_NUMLOCK      =  0x90
Global $VK_SCROLL       =  0x91

Global $VK_OEM_NEC_EQUAL = 0x92   ;// '=' key on numpad

Global $VK_OEM_1         = 0xBA   ;// ';:' for US
Global $VK_OEM_PLUS      = 0xBB   ;// '+' any country
Global $VK_OEM_COMMA     = 0xBC   ;// ',' any country
Global $VK_OEM_MINUS     = 0xBD   ;// '-' any country
Global $VK_OEM_PERIOD    = 0xBE   ;// '.' any country
Global $VK_OEM_2         = 0xBF   ;// '/?' for US
Global $VK_OEM_3         = 0xC0   ;// '`~' for US

Global $VK_OEM_4         = 0xDB  ;//  '[{' for US
Global $VK_OEM_5         = 0xDC  ;//  '\|' for US
Global $VK_OEM_6         = 0xDD  ;//  ']}' for US
Global $VK_OEM_7         = 0xDE  ;//  ''"' for US
Global $VK_OEM_8         = 0xDF

Global $VK_OEM_102       = 0xE2  ;//  "<>" or "\|" on RT 102-key kbd.
Global $VK_ICO_HELP      = 0xE3  ;//  Help key on ICO
Global $VK_ICO_00        = 0xE4  ;//  00 key on ICO
Global $VK_OEM_BACKTAB   = 0xF5


Global $WM_KEYDOWN       = 0x100 ;;declared in WindowConstants.au3
Global $WM_KEYUP         = 0x101 ;;declared in WindowConstants.au3


Func _GetHexByKey_Switch($sKey)
    Switch $sKey
        Case "LeftMouse"            
            Return 0x01 
        Case "RightMouse"           
            Return 0x02     
        Case "MiddleMouse"          
            Return 0x04     
        Case "X1Mouse"          
            Return 0x05     
        Case "X2Mouse"          
            Return 0x06     
        Case "BACKSPACE"            
            Return 0x08     
        Case "TAB"          
            Return 0x09     
        Case "CLEAR"            
            Return 0x0C     
        Case "ENTER"            
            Return 0x0D     
        Case "SHIFT"            
            Return 0x10     
        Case "CTRL"         
            Return 0x11     
        Case "ALT"          
            Return 0x12     
        Case "PAUSE"            
            Return 0x13     
        Case "CAPSLOCK"         
            Return 0x14     
        Case "ESC"          
            Return 0x1B     
        Case " "            
            Return 0x20 
        Case "SPACE"            
            Return 0x20     
        Case "PAGE UP"          
            Return 0x21     
        Case "PAGE DOWN"            
            Return 0x22     
        Case "END"          
            Return 0x23     
        Case "HOME"         
            Return 0x24     
        Case "LEFT"         
            Return 0x25     
        Case "UP"           
            Return 0x26     
        Case "RIGHT"            
            Return 0x27     
        Case "DOWN"         
            Return 0x28     
        Case "SELECT"           
            Return 0x29     
        Case "PRINT"            
            Return 0x2A     
        Case "EXECUTE"          
            Return 0x2B     
        Case "PRINT SCREEN"         
            Return 0x2C     
        Case "INS"          
            Return 0x2D     
        Case "DEL"          
            Return 0x2E     
        Case "0"            
            Return 0x30     
        Case "1"            
            Return 0x31     
        Case "2"            
            Return 0x32     
        Case "3"            
            Return 0x33     
        Case "4"            
            Return 0x34     
        Case "5"            
            Return 0x35     
        Case "6"            
            Return 0x36     
        Case "7"            
            Return 0x37     
        Case "8"            
            Return 0x38     
        Case "9"            
            Return 0x39     
        Case "A"            
            Return 0x41     
        Case "B"            
            Return 0x42     
        Case "C"            
            Return 0x43     
        Case "D"            
            Return 0x44     
        Case "E"            
            Return 0x45     
        Case "F"        
            Return 0x46     
        Case "G"            
            Return 0x47     
        Case "H"            
            Return 0x48     
        Case "I"            
            Return 0x49     
        Case "J"            
            Return 0x4A     
        Case "K"            
            Return 0x4B     
        Case "L"            
            Return 0x4C     
        Case "M"            
            Return 0x4D     
        Case "N"            
            Return 0x4E     
        Case "O"            
            Return 0x4F     
        Case "P"            
            Return 0x50     
        Case "Q"            
            Return 0x51     
        Case "R"            
            Return 0x52     
        Case "S"            
            Return 0x53     
        Case "T"            
            Return 0x54     
        Case "U"            
            Return 0x55     
        Case "V"            
            Return 0x56     
        Case "W"            
            Return 0x57     
        Case "X"            
            Return 0x58     
        Case "Y"            
            Return 0x59     
        Case "Z"            
            Return 0x5A     
        Case "LWin"         
            Return 0x5B     
        Case "RWin"         
            Return 0x5C     
        Case "NUMPAD0"          
            Return 0x60     
        Case "NUMPAD1"          
            Return 0x61     
        Case "NUMPAD2"          
            Return 0x62     
        Case "NUMPAD3"          
            Return 0x63     
        Case "NUMPAD4"          
            Return 0x64     
        Case "NUMPAD5"          
            Return 0x65     
        Case "NUMPAD6"          
            Return 0x66     
        Case "NUMPAD7"          
            Return 0x67     
        Case "NUMPAD8"          
            Return 0x68     
        Case "NUMPAD9"          
            Return 0x69     
        Case "Multiply"         
            Return 0x6A     
        Case "Add"          
            Return 0x6B     
        Case "Separator"            
            Return 0x6C     
        Case "Subtract"         
            Return 0x6D     
        Case "Decimal"          
            Return 0x6E     
        Case "Divide"           
            Return 0x6F     
        Case "F1"           
            Return 0x70     
        Case "F2"           
            Return 0x71     
        Case "F3"           
            Return 0x72     
        Case "F4"           
            Return 0x73     
        Case "F5"           
            Return 0x74     
        Case "F6"           
            Return 0x75     
        Case "F7"           
            Return 0x76     
        Case "F8"           
            Return 0x77     
        Case "F9"           
            Return 0x78     
        Case "F10"          
            Return 0x79     
        Case "F11"          
            Return 0x7A     
        Case "F12"          
            Return 0x7B     
        Case "F13"          
            Return 0x7C     
        Case "F16"          
            Return 0x7F     
        Case "F17"          
            Return 0x80 
        Case "F18"          
            Return 0x81
        Case "F19"          
            Return 0x82 
        Case "F20"          
            Return 0x83 
        Case "F21"          
            Return 0x84 
        Case "F22"          
            Return 0x85 
        Case "F23"          
            Return 0x86     
        Case "F24"          
            Return 0x87     
        Case "NUM LOCK"         
            Return 0x90 
        Case "SCROLL LOCK"          
            Return 0x91     
        Case "LSHIFT"           
            Return 0xA0     
        Case "RSHIFT"           
            Return 0xA1     
        Case "LCTRL"            
            Return 0xA2     
        Case "RCTRL"            
            Return 0xA3     
        Case "LMENU"            
            Return 0xA4     
        Case "RMENU"            
            Return 0xA5     
        Case "="
            Return 0x92
        Case ";"
            Return 0xBA
        Case ":"
            Return 0xBA
        Case "+"
            Return 0xBB
        Case ","
            Return 0xBC
        Case "-"
            Return 0xBD
        Case "."
            Return 0xBE
        Case "/"
            Return 0xBF
        Case "?"
            Return 0xBF
        Case "`"
            Return 0xC0
        Case "~"
            Return 0xC0
        Case "["
            Return 0xDB
        Case "{"
            Return 0xDB
        Case "\"
            Return 0xDC
        Case "|"
            Return 0xDC
        Case "]"
            Return 0xDD
        Case "}"
            Return 0xDD
        Case "'"
            Return 0xDE
        Case '"'
            Return 0xDE
        Case "<"
            Return 0xE2
        Case ">"
            Return 0xE2
    EndSwitch
    Return -1
EndFunc   ;==>_GetHexByKey_Switch

;===============================================================================
;
; Function Name:  _MouseClickMinimized()
; 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 (cpf: or 2???) to use this without bugs.
; Author(s):      Insolence <>
;
;===============================================================================
Func _MouseClickMinimized($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1, $handle = 0)
    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
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    Select
        Case $Button = "right"
            $Button = $MK_RBUTTON
            $ButtonDown = $WM_RBUTTONDOWN
            $ButtonUp = $WM_RBUTTONUP
        Case $Button = "left"
            $Button = $MK_LBUTTON
            $ButtonDown = $WM_LBUTTONDOWN
            $ButtonUp = $WM_LBUTTONUP
        Case Else  ;; CPF
            ;; illegal number of parameters?
;~             MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
            Return
    EndSelect
    ;; makes no sense to send click to minimized window with current mouse coordinates
    If $X = "" Or $Y = "" Then
        ;; illegal number of parameters?
;~         MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
        Return
    EndIf
    For $i = 1 To $Clicks
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $WM_MOUSEMOVE, _
                "int", 0, _
                "long", _MakeLong($X, $Y))
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonDown, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
        Sleep(10)
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonUp, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
    Next
EndFunc   ;==>_MouseClickMinimized

;===============================================================================
;
; Function Name:  _MouseMoveMinimized()
; Version added:  0.1
; Description:    Sends a move message to window, works minimized.
; Parameter(s):   $Window     =  Title of the window to send click to
;                 $X          =  X coordinate
;                 $Y          =  Y coordinate
; Remarks:        You MUST be in "MouseCoordMode" 0 (cpf: or 2???) to use this without bugs.
; Author(s):      Cris Fuhrman (based on code by Insolence <>)
;
;===============================================================================
Func _MouseMoveMinimized($Window, $X = "", $Y = "", $handle = 0)
    Local $WM_MOUSEMOVE = 0x0200
    Local $i = 0
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    
    If $X = "" Or $Y = "" Then
;~         MsgBox(32, "KCH: Problem", "_MouseMovePlus() called with bad number of params?")
        Return
    EndIf
    
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd", $winhandle, _
            "int", $WM_MOUSEMOVE, _
            "int", 0, _
            "long", _MakeLong($X, $Y)) 
EndFunc   ;==>_MouseMoveMinimized

Func _MakeLong($LoWord, $HiWord)
    Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc   ;==>_MakeLong
to C#
blinko is offline  
Old   #23
 
elite*gold: 0
Join Date: Jan 2010
Posts: 18
Received Thanks: 2
Quote:
Originally Posted by blinko View Post
I'm not much of a C# programmer, however, AutoIt is very similar to C#.
I'll have a look at it though as I know enough to get around while using the C# language. I'm sure we can get it sending keys to an inactive window very easily.
Only thing we'd need to worry about is the control ids. Last I checked ESO did not have any client control ids to attach to or hook. Then I figured out that AutoIt's function ControlClick (mouse clicking) sent the mouse click to the recorded mouse coordinates and executed a click within the Clients window even while minimized; the ControlSend (keyboard) functions simply do not work. So I do not know about sending keys, But you could definately send mouse clicks to the target window at the given coordinates (unfortunately this means we must place our client in a certain area, and then set the hotkeys separate. Unless of course you made an .ini file and stored the window position as well as the mouse coords..o.o then it'd be ok !! I'm going to add that !)

Have a look at this.

Code:
Global $VK_TAB          =  0x09
Global $VK_CLEAR        =  0x0C
Global $VK_RETURN       =  0x0D
Global $VK_SHIFT        =  0x10
Global $VK_CONTROL      =  0x11
Global $VK_ESCAPE       =  0x1B
Global $VK_SPACE        =  0x20
Global $VK_LEFT         =  0x25
Global $VK_UP           =  0x26
Global $VK_RIGHT        =  0x27
Global $VK_DOWN         =  0x28
Global $VK_DELETE       =  0x2E
Global $VK_0            =  0x30
Global $VK_1            =  0x31
Global $VK_2            =  0x32
Global $VK_3            =  0x33
Global $VK_4            =  0x34
Global $VK_5            =  0x35
Global $VK_6            =  0x36
Global $VK_7            =  0x37
Global $VK_8            =  0x38
Global $VK_9            =  0x39
Global $VK_A            =  0x41
Global $VK_B            =  0x42
Global $VK_C            =  0x43
Global $VK_D            =  0x44
Global $VK_E            =  0x45
Global $VK_F            =  0x46
Global $VK_G            =  0x47
Global $VK_H            =  0x48
Global $VK_I            =  0x49
Global $VK_J            =  0x4A
Global $VK_K            =  0x4B
Global $VK_L            =  0x4C
Global $VK_M            =  0x4D
Global $VK_N            =  0x4E
Global $VK_O            =  0x4F
Global $VK_P            =  0x50
Global $VK_Q            =  0x51
Global $VK_R            =  0x52
Global $VK_S            =  0x53
Global $VK_T            =  0x54
Global $VK_U            =  0x55
Global $VK_V            =  0x56
Global $VK_W            =  0x57
Global $VK_X            =  0x58
Global $VK_Y            =  0x59
Global $VK_Z            =  0x5A
Global $VK_NUMPAD0      =  0x60
Global $VK_NUMPAD1      =  0x61
Global $VK_NUMPAD2      =  0x62
Global $VK_NUMPAD3      =  0x63
Global $VK_NUMPAD4      =  0x64
Global $VK_NUMPAD5      =  0x65
Global $VK_NUMPAD6      =  0x66
Global $VK_NUMPAD7      =  0x67
Global $VK_NUMPAD8      =  0x68
Global $VK_NUMPAD9      =  0x69
Global $VK_MULTIPLY     =  0x6A
Global $VK_ADD          =  0x6B
Global $VK_SEPARATOR    =  0x6C
Global $VK_SUBTRACT     =  0x6D
Global $VK_DECIMAL      =  0x6E
Global $VK_DIVIDE       =  0x6F
Global $VK_F1           =  0x70
Global $VK_F2           =  0x71
Global $VK_F3           =  0x72
Global $VK_F4           =  0x73
Global $VK_F5           =  0x74
Global $VK_F6           =  0x75
Global $VK_F7           =  0x76
Global $VK_F8           =  0x77
Global $VK_F9           =  0x78
Global $VK_F10          =  0x79
Global $VK_F11          =  0x7A
Global $VK_F12          =  0x7B
Global $VK_F13          =  0x7C
Global $VK_F14          =  0x7D
Global $VK_F15          =  0x7E
Global $VK_F16          =  0x7F
Global $VK_F17          =  0x80
Global $VK_F18          =  0x81
Global $VK_F19          =  0x82
Global $VK_F20          =  0x83
Global $VK_F21          =  0x84
Global $VK_F22          =  0x85
Global $VK_F23          =  0x86
Global $VK_F24          =  0x87
Global $VK_NUMLOCK      =  0x90
Global $VK_SCROLL       =  0x91

Global $VK_OEM_NEC_EQUAL = 0x92   ;// '=' key on numpad

Global $VK_OEM_1         = 0xBA   ;// ';:' for US
Global $VK_OEM_PLUS      = 0xBB   ;// '+' any country
Global $VK_OEM_COMMA     = 0xBC   ;// ',' any country
Global $VK_OEM_MINUS     = 0xBD   ;// '-' any country
Global $VK_OEM_PERIOD    = 0xBE   ;// '.' any country
Global $VK_OEM_2         = 0xBF   ;// '/?' for US
Global $VK_OEM_3         = 0xC0   ;// '`~' for US

Global $VK_OEM_4         = 0xDB  ;//  '[{' for US
Global $VK_OEM_5         = 0xDC  ;//  '\|' for US
Global $VK_OEM_6         = 0xDD  ;//  ']}' for US
Global $VK_OEM_7         = 0xDE  ;//  ''"' for US
Global $VK_OEM_8         = 0xDF

Global $VK_OEM_102       = 0xE2  ;//  "<>" or "\|" on RT 102-key kbd.
Global $VK_ICO_HELP      = 0xE3  ;//  Help key on ICO
Global $VK_ICO_00        = 0xE4  ;//  00 key on ICO
Global $VK_OEM_BACKTAB   = 0xF5


Global $WM_KEYDOWN       = 0x100 ;;declared in WindowConstants.au3
Global $WM_KEYUP         = 0x101 ;;declared in WindowConstants.au3

Func _SendMinimizedMessage($winhandle,$msgstring,$raw = 0)
    If $winhandle = "" Then
        ;; illegal number of parameters?
        MsgBox(32, "KCH: Problem", "SendMinimizedMessage() called with bad number of params?")
        Return
    EndIf
    Local $i = 0
    while $i < StringLen($msgstring)
        $i = $i + 1
        Local $var = StringMid($msgstring,$i,1)
        if $raw = 1 Then
            _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
        Else
            if $var = "{" Then
                Local $var2 = StringInStr(StringMid($msgstring,$i+1),"}",2)
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i+1,$var2-1))
                $i = $i + $var2
            Else
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
            EndIf
        EndIf
        Sleep(50)
    WEnd
    Return
EndFunc

Func _SendMinimizedVK($winhandle,$vkstring)
    Local $var = _GetHexByKey_Switch($vkstring)
    if Not ($var = -1) Then
        DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $winhandle, _
        "int", $WM_KEYDOWN, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0)
        DllCall("user32.dll", "int", "SendMessage", _ ;SendMessage only works ingame, not in lobby
        "hwnd", $winhandle, _
        "int", $WM_KEYUP, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0) 
     ConsoleWrite(1 & @CRLF) ;debug Success
        Return 1
    EndIf
 ConsoleWrite(0 & @CRLF) ;debug Failed
    Return 0
EndFunc

Func _GetHexByKey_Switch($sKey)
    Switch $sKey
        Case "LeftMouse"            
            Return 0x01 
        Case "RightMouse"           
            Return 0x02     
        Case "MiddleMouse"          
            Return 0x04     
        Case "X1Mouse"          
            Return 0x05     
        Case "X2Mouse"          
            Return 0x06     
        Case "BACKSPACE"            
            Return 0x08     
        Case "TAB"          
            Return 0x09     
        Case "CLEAR"            
            Return 0x0C     
        Case "ENTER"            
            Return 0x0D     
        Case "SHIFT"            
            Return 0x10     
        Case "CTRL"         
            Return 0x11     
        Case "ALT"          
            Return 0x12     
        Case "PAUSE"            
            Return 0x13     
        Case "CAPSLOCK"         
            Return 0x14     
        Case "ESC"          
            Return 0x1B     
        Case " "            
            Return 0x20 
        Case "SPACE"            
            Return 0x20     
        Case "PAGE UP"          
            Return 0x21     
        Case "PAGE DOWN"            
            Return 0x22     
        Case "END"          
            Return 0x23     
        Case "HOME"         
            Return 0x24     
        Case "LEFT"         
            Return 0x25     
        Case "UP"           
            Return 0x26     
        Case "RIGHT"            
            Return 0x27     
        Case "DOWN"         
            Return 0x28     
        Case "SELECT"           
            Return 0x29     
        Case "PRINT"            
            Return 0x2A     
        Case "EXECUTE"          
            Return 0x2B     
        Case "PRINT SCREEN"         
            Return 0x2C     
        Case "INS"          
            Return 0x2D     
        Case "DEL"          
            Return 0x2E     
        Case "0"            
            Return 0x30     
        Case "1"            
            Return 0x31     
        Case "2"            
            Return 0x32     
        Case "3"            
            Return 0x33     
        Case "4"            
            Return 0x34     
        Case "5"            
            Return 0x35     
        Case "6"            
            Return 0x36     
        Case "7"            
            Return 0x37     
        Case "8"            
            Return 0x38     
        Case "9"            
            Return 0x39     
        Case "A"            
            Return 0x41     
        Case "B"            
            Return 0x42     
        Case "C"            
            Return 0x43     
        Case "D"            
            Return 0x44     
        Case "E"            
            Return 0x45     
        Case "F"        
            Return 0x46     
        Case "G"            
            Return 0x47     
        Case "H"            
            Return 0x48     
        Case "I"            
            Return 0x49     
        Case "J"            
            Return 0x4A     
        Case "K"            
            Return 0x4B     
        Case "L"            
            Return 0x4C     
        Case "M"            
            Return 0x4D     
        Case "N"            
            Return 0x4E     
        Case "O"            
            Return 0x4F     
        Case "P"            
            Return 0x50     
        Case "Q"            
            Return 0x51     
        Case "R"            
            Return 0x52     
        Case "S"            
            Return 0x53     
        Case "T"            
            Return 0x54     
        Case "U"            
            Return 0x55     
        Case "V"            
            Return 0x56     
        Case "W"            
            Return 0x57     
        Case "X"            
            Return 0x58     
        Case "Y"            
            Return 0x59     
        Case "Z"            
            Return 0x5A     
        Case "LWin"         
            Return 0x5B     
        Case "RWin"         
            Return 0x5C     
        Case "NUMPAD0"          
            Return 0x60     
        Case "NUMPAD1"          
            Return 0x61     
        Case "NUMPAD2"          
            Return 0x62     
        Case "NUMPAD3"          
            Return 0x63     
        Case "NUMPAD4"          
            Return 0x64     
        Case "NUMPAD5"          
            Return 0x65     
        Case "NUMPAD6"          
            Return 0x66     
        Case "NUMPAD7"          
            Return 0x67     
        Case "NUMPAD8"          
            Return 0x68     
        Case "NUMPAD9"          
            Return 0x69     
        Case "Multiply"         
            Return 0x6A     
        Case "Add"          
            Return 0x6B     
        Case "Separator"            
            Return 0x6C     
        Case "Subtract"         
            Return 0x6D     
        Case "Decimal"          
            Return 0x6E     
        Case "Divide"           
            Return 0x6F     
        Case "F1"           
            Return 0x70     
        Case "F2"           
            Return 0x71     
        Case "F3"           
            Return 0x72     
        Case "F4"           
            Return 0x73     
        Case "F5"           
            Return 0x74     
        Case "F6"           
            Return 0x75     
        Case "F7"           
            Return 0x76     
        Case "F8"           
            Return 0x77     
        Case "F9"           
            Return 0x78     
        Case "F10"          
            Return 0x79     
        Case "F11"          
            Return 0x7A     
        Case "F12"          
            Return 0x7B     
        Case "F13"          
            Return 0x7C     
        Case "F16"          
            Return 0x7F     
        Case "F17"          
            Return 0x80 
        Case "F18"          
            Return 0x81
        Case "F19"          
            Return 0x82 
        Case "F20"          
            Return 0x83 
        Case "F21"          
            Return 0x84 
        Case "F22"          
            Return 0x85 
        Case "F23"          
            Return 0x86     
        Case "F24"          
            Return 0x87     
        Case "NUM LOCK"         
            Return 0x90 
        Case "SCROLL LOCK"          
            Return 0x91     
        Case "LSHIFT"           
            Return 0xA0     
        Case "RSHIFT"           
            Return 0xA1     
        Case "LCTRL"            
            Return 0xA2     
        Case "RCTRL"            
            Return 0xA3     
        Case "LMENU"            
            Return 0xA4     
        Case "RMENU"            
            Return 0xA5     
        Case "="
            Return 0x92
        Case ";"
            Return 0xBA
        Case ":"
            Return 0xBA
        Case "+"
            Return 0xBB
        Case ","
            Return 0xBC
        Case "-"
            Return 0xBD
        Case "."
            Return 0xBE
        Case "/"
            Return 0xBF
        Case "?"
            Return 0xBF
        Case "`"
            Return 0xC0
        Case "~"
            Return 0xC0
        Case "["
            Return 0xDB
        Case "{"
            Return 0xDB
        Case "\"
            Return 0xDC
        Case "|"
            Return 0xDC
        Case "]"
            Return 0xDD
        Case "}"
            Return 0xDD
        Case "'"
            Return 0xDE
        Case '"'
            Return 0xDE
        Case "<"
            Return 0xE2
        Case ">"
            Return 0xE2
    EndSwitch
    Return -1
EndFunc   ;==>_GetHexByKey_Switch

;===============================================================================
;
; Function Name:  _MouseClickMinimized()
; 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 (cpf: or 2???) to use this without bugs.
; Author(s):      Insolence <>
;
;===============================================================================
Func _MouseClickMinimized($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1, $handle = 0)
    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
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    Select
        Case $Button = "right"
            $Button = $MK_RBUTTON
            $ButtonDown = $WM_RBUTTONDOWN
            $ButtonUp = $WM_RBUTTONUP
        Case $Button = "left"
            $Button = $MK_LBUTTON
            $ButtonDown = $WM_LBUTTONDOWN
            $ButtonUp = $WM_LBUTTONUP
        Case Else  ;; CPF
            ;; illegal number of parameters?
;~             MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
            Return
    EndSelect
    ;; makes no sense to send click to minimized window with current mouse coordinates
    If $X = "" Or $Y = "" Then
        ;; illegal number of parameters?
;~         MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
        Return
    EndIf
    For $i = 1 To $Clicks
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $WM_MOUSEMOVE, _
                "int", 0, _
                "long", _MakeLong($X, $Y))
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonDown, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
        Sleep(10)
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonUp, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
    Next
EndFunc   ;==>_MouseClickMinimized

;===============================================================================
;
; Function Name:  _MouseMoveMinimized()
; Version added:  0.1
; Description:    Sends a move message to window, works minimized.
; Parameter(s):   $Window     =  Title of the window to send click to
;                 $X          =  X coordinate
;                 $Y          =  Y coordinate
; Remarks:        You MUST be in "MouseCoordMode" 0 (cpf: or 2???) to use this without bugs.
; Author(s):      Cris Fuhrman (based on code by Insolence <>)
;
;===============================================================================
Func _MouseMoveMinimized($Window, $X = "", $Y = "", $handle = 0)
    Local $WM_MOUSEMOVE = 0x0200
    Local $i = 0
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    
    If $X = "" Or $Y = "" Then
;~         MsgBox(32, "KCH: Problem", "_MouseMovePlus() called with bad number of params?")
        Return
    EndIf
    
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd", $winhandle, _
            "int", $WM_MOUSEMOVE, _
            "int", 0, _
            "long", _MakeLong($X, $Y)) 
EndFunc   ;==>_MouseMoveMinimized

Func _MakeLong($LoWord, $HiWord)
    Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc   ;==>_MakeLong
The guy who wrote that piece for AutoIt wrote it for Diablo 2.
The send keys works fine for Diablo as the client has control ids.

The Mouse Click section on the other hand works fine for ESO. SO convert...
Code:
Global $VK_TAB          =  0x09
Global $VK_CLEAR        =  0x0C
Global $VK_RETURN       =  0x0D
Global $VK_SHIFT        =  0x10
Global $VK_CONTROL      =  0x11
Global $VK_ESCAPE       =  0x1B
Global $VK_SPACE        =  0x20
Global $VK_LEFT         =  0x25
Global $VK_UP           =  0x26
Global $VK_RIGHT        =  0x27
Global $VK_DOWN         =  0x28
Global $VK_DELETE       =  0x2E
Global $VK_0            =  0x30
Global $VK_1            =  0x31
Global $VK_2            =  0x32
Global $VK_3            =  0x33
Global $VK_4            =  0x34
Global $VK_5            =  0x35
Global $VK_6            =  0x36
Global $VK_7            =  0x37
Global $VK_8            =  0x38
Global $VK_9            =  0x39
Global $VK_A            =  0x41
Global $VK_B            =  0x42
Global $VK_C            =  0x43
Global $VK_D            =  0x44
Global $VK_E            =  0x45
Global $VK_F            =  0x46
Global $VK_G            =  0x47
Global $VK_H            =  0x48
Global $VK_I            =  0x49
Global $VK_J            =  0x4A
Global $VK_K            =  0x4B
Global $VK_L            =  0x4C
Global $VK_M            =  0x4D
Global $VK_N            =  0x4E
Global $VK_O            =  0x4F
Global $VK_P            =  0x50
Global $VK_Q            =  0x51
Global $VK_R            =  0x52
Global $VK_S            =  0x53
Global $VK_T            =  0x54
Global $VK_U            =  0x55
Global $VK_V            =  0x56
Global $VK_W            =  0x57
Global $VK_X            =  0x58
Global $VK_Y            =  0x59
Global $VK_Z            =  0x5A
Global $VK_NUMPAD0      =  0x60
Global $VK_NUMPAD1      =  0x61
Global $VK_NUMPAD2      =  0x62
Global $VK_NUMPAD3      =  0x63
Global $VK_NUMPAD4      =  0x64
Global $VK_NUMPAD5      =  0x65
Global $VK_NUMPAD6      =  0x66
Global $VK_NUMPAD7      =  0x67
Global $VK_NUMPAD8      =  0x68
Global $VK_NUMPAD9      =  0x69
Global $VK_MULTIPLY     =  0x6A
Global $VK_ADD          =  0x6B
Global $VK_SEPARATOR    =  0x6C
Global $VK_SUBTRACT     =  0x6D
Global $VK_DECIMAL      =  0x6E
Global $VK_DIVIDE       =  0x6F
Global $VK_F1           =  0x70
Global $VK_F2           =  0x71
Global $VK_F3           =  0x72
Global $VK_F4           =  0x73
Global $VK_F5           =  0x74
Global $VK_F6           =  0x75
Global $VK_F7           =  0x76
Global $VK_F8           =  0x77
Global $VK_F9           =  0x78
Global $VK_F10          =  0x79
Global $VK_F11          =  0x7A
Global $VK_F12          =  0x7B
Global $VK_F13          =  0x7C
Global $VK_F14          =  0x7D
Global $VK_F15          =  0x7E
Global $VK_F16          =  0x7F
Global $VK_F17          =  0x80
Global $VK_F18          =  0x81
Global $VK_F19          =  0x82
Global $VK_F20          =  0x83
Global $VK_F21          =  0x84
Global $VK_F22          =  0x85
Global $VK_F23          =  0x86
Global $VK_F24          =  0x87
Global $VK_NUMLOCK      =  0x90
Global $VK_SCROLL       =  0x91

Global $VK_OEM_NEC_EQUAL = 0x92   ;// '=' key on numpad

Global $VK_OEM_1         = 0xBA   ;// ';:' for US
Global $VK_OEM_PLUS      = 0xBB   ;// '+' any country
Global $VK_OEM_COMMA     = 0xBC   ;// ',' any country
Global $VK_OEM_MINUS     = 0xBD   ;// '-' any country
Global $VK_OEM_PERIOD    = 0xBE   ;// '.' any country
Global $VK_OEM_2         = 0xBF   ;// '/?' for US
Global $VK_OEM_3         = 0xC0   ;// '`~' for US

Global $VK_OEM_4         = 0xDB  ;//  '[{' for US
Global $VK_OEM_5         = 0xDC  ;//  '\|' for US
Global $VK_OEM_6         = 0xDD  ;//  ']}' for US
Global $VK_OEM_7         = 0xDE  ;//  ''"' for US
Global $VK_OEM_8         = 0xDF

Global $VK_OEM_102       = 0xE2  ;//  "<>" or "\|" on RT 102-key kbd.
Global $VK_ICO_HELP      = 0xE3  ;//  Help key on ICO
Global $VK_ICO_00        = 0xE4  ;//  00 key on ICO
Global $VK_OEM_BACKTAB   = 0xF5


Global $WM_KEYDOWN       = 0x100 ;;declared in WindowConstants.au3
Global $WM_KEYUP         = 0x101 ;;declared in WindowConstants.au3


Func _GetHexByKey_Switch($sKey)
    Switch $sKey
        Case "LeftMouse"            
            Return 0x01 
        Case "RightMouse"           
            Return 0x02     
        Case "MiddleMouse"          
            Return 0x04     
        Case "X1Mouse"          
            Return 0x05     
        Case "X2Mouse"          
            Return 0x06     
        Case "BACKSPACE"            
            Return 0x08     
        Case "TAB"          
            Return 0x09     
        Case "CLEAR"            
            Return 0x0C     
        Case "ENTER"            
            Return 0x0D     
        Case "SHIFT"            
            Return 0x10     
        Case "CTRL"         
            Return 0x11     
        Case "ALT"          
            Return 0x12     
        Case "PAUSE"            
            Return 0x13     
        Case "CAPSLOCK"         
            Return 0x14     
        Case "ESC"          
            Return 0x1B     
        Case " "            
            Return 0x20 
        Case "SPACE"            
            Return 0x20     
        Case "PAGE UP"          
            Return 0x21     
        Case "PAGE DOWN"            
            Return 0x22     
        Case "END"          
            Return 0x23     
        Case "HOME"         
            Return 0x24     
        Case "LEFT"         
            Return 0x25     
        Case "UP"           
            Return 0x26     
        Case "RIGHT"            
            Return 0x27     
        Case "DOWN"         
            Return 0x28     
        Case "SELECT"           
            Return 0x29     
        Case "PRINT"            
            Return 0x2A     
        Case "EXECUTE"          
            Return 0x2B     
        Case "PRINT SCREEN"         
            Return 0x2C     
        Case "INS"          
            Return 0x2D     
        Case "DEL"          
            Return 0x2E     
        Case "0"            
            Return 0x30     
        Case "1"            
            Return 0x31     
        Case "2"            
            Return 0x32     
        Case "3"            
            Return 0x33     
        Case "4"            
            Return 0x34     
        Case "5"            
            Return 0x35     
        Case "6"            
            Return 0x36     
        Case "7"            
            Return 0x37     
        Case "8"            
            Return 0x38     
        Case "9"            
            Return 0x39     
        Case "A"            
            Return 0x41     
        Case "B"            
            Return 0x42     
        Case "C"            
            Return 0x43     
        Case "D"            
            Return 0x44     
        Case "E"            
            Return 0x45     
        Case "F"        
            Return 0x46     
        Case "G"            
            Return 0x47     
        Case "H"            
            Return 0x48     
        Case "I"            
            Return 0x49     
        Case "J"            
            Return 0x4A     
        Case "K"            
            Return 0x4B     
        Case "L"            
            Return 0x4C     
        Case "M"            
            Return 0x4D     
        Case "N"            
            Return 0x4E     
        Case "O"            
            Return 0x4F     
        Case "P"            
            Return 0x50     
        Case "Q"            
            Return 0x51     
        Case "R"            
            Return 0x52     
        Case "S"            
            Return 0x53     
        Case "T"            
            Return 0x54     
        Case "U"            
            Return 0x55     
        Case "V"            
            Return 0x56     
        Case "W"            
            Return 0x57     
        Case "X"            
            Return 0x58     
        Case "Y"            
            Return 0x59     
        Case "Z"            
            Return 0x5A     
        Case "LWin"         
            Return 0x5B     
        Case "RWin"         
            Return 0x5C     
        Case "NUMPAD0"          
            Return 0x60     
        Case "NUMPAD1"          
            Return 0x61     
        Case "NUMPAD2"          
            Return 0x62     
        Case "NUMPAD3"          
            Return 0x63     
        Case "NUMPAD4"          
            Return 0x64     
        Case "NUMPAD5"          
            Return 0x65     
        Case "NUMPAD6"          
            Return 0x66     
        Case "NUMPAD7"          
            Return 0x67     
        Case "NUMPAD8"          
            Return 0x68     
        Case "NUMPAD9"          
            Return 0x69     
        Case "Multiply"         
            Return 0x6A     
        Case "Add"          
            Return 0x6B     
        Case "Separator"            
            Return 0x6C     
        Case "Subtract"         
            Return 0x6D     
        Case "Decimal"          
            Return 0x6E     
        Case "Divide"           
            Return 0x6F     
        Case "F1"           
            Return 0x70     
        Case "F2"           
            Return 0x71     
        Case "F3"           
            Return 0x72     
        Case "F4"           
            Return 0x73     
        Case "F5"           
            Return 0x74     
        Case "F6"           
            Return 0x75     
        Case "F7"           
            Return 0x76     
        Case "F8"           
            Return 0x77     
        Case "F9"           
            Return 0x78     
        Case "F10"          
            Return 0x79     
        Case "F11"          
            Return 0x7A     
        Case "F12"          
            Return 0x7B     
        Case "F13"          
            Return 0x7C     
        Case "F16"          
            Return 0x7F     
        Case "F17"          
            Return 0x80 
        Case "F18"          
            Return 0x81
        Case "F19"          
            Return 0x82 
        Case "F20"          
            Return 0x83 
        Case "F21"          
            Return 0x84 
        Case "F22"          
            Return 0x85 
        Case "F23"          
            Return 0x86     
        Case "F24"          
            Return 0x87     
        Case "NUM LOCK"         
            Return 0x90 
        Case "SCROLL LOCK"          
            Return 0x91     
        Case "LSHIFT"           
            Return 0xA0     
        Case "RSHIFT"           
            Return 0xA1     
        Case "LCTRL"            
            Return 0xA2     
        Case "RCTRL"            
            Return 0xA3     
        Case "LMENU"            
            Return 0xA4     
        Case "RMENU"            
            Return 0xA5     
        Case "="
            Return 0x92
        Case ";"
            Return 0xBA
        Case ":"
            Return 0xBA
        Case "+"
            Return 0xBB
        Case ","
            Return 0xBC
        Case "-"
            Return 0xBD
        Case "."
            Return 0xBE
        Case "/"
            Return 0xBF
        Case "?"
            Return 0xBF
        Case "`"
            Return 0xC0
        Case "~"
            Return 0xC0
        Case "["
            Return 0xDB
        Case "{"
            Return 0xDB
        Case "\"
            Return 0xDC
        Case "|"
            Return 0xDC
        Case "]"
            Return 0xDD
        Case "}"
            Return 0xDD
        Case "'"
            Return 0xDE
        Case '"'
            Return 0xDE
        Case "<"
            Return 0xE2
        Case ">"
            Return 0xE2
    EndSwitch
    Return -1
EndFunc   ;==>_GetHexByKey_Switch

;===============================================================================
;
; Function Name:  _MouseClickMinimized()
; 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 (cpf: or 2???) to use this without bugs.
; Author(s):      Insolence <>
;
;===============================================================================
Func _MouseClickMinimized($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1, $handle = 0)
    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
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    Select
        Case $Button = "right"
            $Button = $MK_RBUTTON
            $ButtonDown = $WM_RBUTTONDOWN
            $ButtonUp = $WM_RBUTTONUP
        Case $Button = "left"
            $Button = $MK_LBUTTON
            $ButtonDown = $WM_LBUTTONDOWN
            $ButtonUp = $WM_LBUTTONUP
        Case Else  ;; CPF
            ;; illegal number of parameters?
;~             MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
            Return
    EndSelect
    ;; makes no sense to send click to minimized window with current mouse coordinates
    If $X = "" Or $Y = "" Then
        ;; illegal number of parameters?
;~         MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
        Return
    EndIf
    For $i = 1 To $Clicks
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $WM_MOUSEMOVE, _
                "int", 0, _
                "long", _MakeLong($X, $Y))
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonDown, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
        Sleep(10)
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonUp, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
    Next
EndFunc   ;==>_MouseClickMinimized

;===============================================================================
;
; Function Name:  _MouseMoveMinimized()
; Version added:  0.1
; Description:    Sends a move message to window, works minimized.
; Parameter(s):   $Window     =  Title of the window to send click to
;                 $X          =  X coordinate
;                 $Y          =  Y coordinate
; Remarks:        You MUST be in "MouseCoordMode" 0 (cpf: or 2???) to use this without bugs.
; Author(s):      Cris Fuhrman (based on code by Insolence <>)
;
;===============================================================================
Func _MouseMoveMinimized($Window, $X = "", $Y = "", $handle = 0)
    Local $WM_MOUSEMOVE = 0x0200
    Local $i = 0
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    
    If $X = "" Or $Y = "" Then
;~         MsgBox(32, "KCH: Problem", "_MouseMovePlus() called with bad number of params?")
        Return
    EndIf
    
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd", $winhandle, _
            "int", $WM_MOUSEMOVE, _
            "int", 0, _
            "long", _MakeLong($X, $Y)) 
EndFunc   ;==>_MouseMoveMinimized

Func _MakeLong($LoWord, $HiWord)
    Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc   ;==>_MakeLong
to C#
Are sure that mouse click work on minimized client? I'll check into it and see about rewriting my entire bot to use mouse clicks on screen coords and do some calculations.

EDIT: How do you target for minimized client? I only know of a way via 'tab' key. Unless you're talking about scanning the memory for mobs???
mibiz1 is offline  
Old   #24
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by mibiz1 View Post
Are sure that mouse click work on minimized client? I'll check into it and see about rewriting my entire bot to use mouse clicks on screen coords and do some calculations.

EDIT: How do you target for minimized client? I only know of a way via 'tab' key. Unless you're talking about scanning the memory for mobs???
Well first off we are scanning the memory for the target.

When you press TAB and check the Player Target address value, you might see a huge number
such as 201018456 this is only an example but it would be the ID number of this particular mob.
The next mob might be 201018457 <-- the next mob in the area. But if the value is 0 then the player has no target. Also clicking your character portait to target yourself also returns you an ID. This is your player ID, so you could eventually be able to set your bot to watch for specific players/mobs.

This will prolly never be needed, however, should you have trouble with one certain player who always tries to pk you. Make it watch for thier player ID, if they come close to you simply ProcessClose("elementclient.exe") XD (only in C# :P). You could probably even setup your own auto-route functions for your bots as well. Using the Id's returned for npc's etc..anything you can click will have an ID.

So basically how I currently have my bot setup it performs this function.
This Checks for HP/MP should u set it to then performs the Mouseclicks for the HotKey (skill hotkey in game), then if Target = 0 it'll send the TAB key to re-target.

Code:
Func _RunBot()

	$running = NOT $running

	While $running

if _GetPlayer("target") <> 0 Then

	If $checkhp = true then
		_CheckHP()
	EndIf

        if $checkmp = true Then
		_CheckMP()
        EndIf

 ;$ATK_X and $ATK_Y is actually my pre-recorded screen coords.

		ControlClick("Ether Saga", "", "", "left",1 , $ATK_X, $ATK_Y)
		sleep(200)
	Else
;This works fine since it's only called once.
		ControlSend("Ether Saga","","","{TAB}")
EndIf

WEnd

EndFunc
The problem I was having was ControlSend is basically a DLL (user32.dll) SendMessage function. And calling ControlSend("Ether Saga","" ,"" "{TAB}") works fine to target the mob, then attempting to use ControlSend("Ether Saga","","","{F1}") for my skill hotkey was not working. It did the TAB key only...then sat idle. The same for the SendMessage API. It will send the key once, just not over and over. So you'll have to use the full code.

Code:
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------
#include-once

; Script Start - Add your code below here


Global $VK_TAB          =  0x09
Global $VK_CLEAR        =  0x0C
Global $VK_RETURN       =  0x0D
Global $VK_SHIFT        =  0x10
Global $VK_CONTROL      =  0x11
Global $VK_ESCAPE       =  0x1B
Global $VK_SPACE        =  0x20
Global $VK_LEFT         =  0x25
Global $VK_UP           =  0x26
Global $VK_RIGHT        =  0x27
Global $VK_DOWN         =  0x28
Global $VK_DELETE       =  0x2E
Global $VK_0            =  0x30
Global $VK_1            =  0x31
Global $VK_2            =  0x32
Global $VK_3            =  0x33
Global $VK_4            =  0x34
Global $VK_5            =  0x35
Global $VK_6            =  0x36
Global $VK_7            =  0x37
Global $VK_8            =  0x38
Global $VK_9            =  0x39
Global $VK_A            =  0x41
Global $VK_B            =  0x42
Global $VK_C            =  0x43
Global $VK_D            =  0x44
Global $VK_E            =  0x45
Global $VK_F            =  0x46
Global $VK_G            =  0x47
Global $VK_H            =  0x48
Global $VK_I            =  0x49
Global $VK_J            =  0x4A
Global $VK_K            =  0x4B
Global $VK_L            =  0x4C
Global $VK_M            =  0x4D
Global $VK_N            =  0x4E
Global $VK_O            =  0x4F
Global $VK_P            =  0x50
Global $VK_Q            =  0x51
Global $VK_R            =  0x52
Global $VK_S            =  0x53
Global $VK_T            =  0x54
Global $VK_U            =  0x55
Global $VK_V            =  0x56
Global $VK_W            =  0x57
Global $VK_X            =  0x58
Global $VK_Y            =  0x59
Global $VK_Z            =  0x5A
Global $VK_NUMPAD0      =  0x60
Global $VK_NUMPAD1      =  0x61
Global $VK_NUMPAD2      =  0x62
Global $VK_NUMPAD3      =  0x63
Global $VK_NUMPAD4      =  0x64
Global $VK_NUMPAD5      =  0x65
Global $VK_NUMPAD6      =  0x66
Global $VK_NUMPAD7      =  0x67
Global $VK_NUMPAD8      =  0x68
Global $VK_NUMPAD9      =  0x69
Global $VK_MULTIPLY     =  0x6A
Global $VK_ADD          =  0x6B
Global $VK_SEPARATOR    =  0x6C
Global $VK_SUBTRACT     =  0x6D
Global $VK_DECIMAL      =  0x6E
Global $VK_DIVIDE       =  0x6F
Global $VK_F1           =  0x70
Global $VK_F2           =  0x71
Global $VK_F3           =  0x72
Global $VK_F4           =  0x73
Global $VK_F5           =  0x74
Global $VK_F6           =  0x75
Global $VK_F7           =  0x76
Global $VK_F8           =  0x77
Global $VK_F9           =  0x78
Global $VK_F10          =  0x79
Global $VK_F11          =  0x7A
Global $VK_F12          =  0x7B
Global $VK_F13          =  0x7C
Global $VK_F14          =  0x7D
Global $VK_F15          =  0x7E
Global $VK_F16          =  0x7F
Global $VK_F17          =  0x80
Global $VK_F18          =  0x81
Global $VK_F19          =  0x82
Global $VK_F20          =  0x83
Global $VK_F21          =  0x84
Global $VK_F22          =  0x85
Global $VK_F23          =  0x86
Global $VK_F24          =  0x87
Global $VK_NUMLOCK      =  0x90
Global $VK_SCROLL       =  0x91

Global $VK_OEM_NEC_EQUAL = 0x92   ;// '=' key on numpad

Global $VK_OEM_1         = 0xBA   ;// ';:' for US
Global $VK_OEM_PLUS      = 0xBB   ;// '+' any country
Global $VK_OEM_COMMA     = 0xBC   ;// ',' any country
Global $VK_OEM_MINUS     = 0xBD   ;// '-' any country
Global $VK_OEM_PERIOD    = 0xBE   ;// '.' any country
Global $VK_OEM_2         = 0xBF   ;// '/?' for US
Global $VK_OEM_3         = 0xC0   ;// '`~' for US

Global $VK_OEM_4         = 0xDB  ;//  '[{' for US
Global $VK_OEM_5         = 0xDC  ;//  '\|' for US
Global $VK_OEM_6         = 0xDD  ;//  ']}' for US
Global $VK_OEM_7         = 0xDE  ;//  ''"' for US
Global $VK_OEM_8         = 0xDF

Global $VK_OEM_102       = 0xE2  ;//  "<>" or "\|" on RT 102-key kbd.
Global $VK_ICO_HELP      = 0xE3  ;//  Help key on ICO
Global $VK_ICO_00        = 0xE4  ;//  00 key on ICO
Global $VK_OEM_BACKTAB   = 0xF5


Global $WM_KEYDOWN       = 0x100 ;;declared in WindowConstants.au3
Global $WM_KEYUP         = 0x101 ;;declared in WindowConstants.au3

Func _SendMinimizedMessage($winhandle,$msgstring,$raw = 0)
    If $winhandle = "" Then
        ;; illegal number of parameters?
        MsgBox(32, "KCH: Problem", "SendMinimizedMessage() called with bad number of params?")
        Return
    EndIf
    Local $i = 0
    while $i < StringLen($msgstring)
        $i = $i + 1
        Local $var = StringMid($msgstring,$i,1)
        if $raw = 1 Then
            _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
        Else
            if $var = "{" Then
                Local $var2 = StringInStr(StringMid($msgstring,$i+1),"}",2)
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i+1,$var2-1))
                $i = $i + $var2
            Else
                _SendMinimizedVK($winhandle,StringMid($msgstring,$i,1))
            EndIf
        EndIf
        Sleep(50)
    WEnd
    Return
EndFunc

Func _SendMinimizedVK($winhandle,$vkstring)
    Local $var = _GetHexByKey_Switch($vkstring)
    if Not ($var = -1) Then
        DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $winhandle, _
        "int", $WM_KEYDOWN, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0)
        DllCall("user32.dll", "int", "SendMessage", _ ;SendMessage only works ingame, not in lobby
        "hwnd", $winhandle, _
        "int", $WM_KEYUP, _
        "int", _GetHexByKey_Switch($vkstring), _
        "long", 0) 
     ConsoleWrite(1 & @CRLF) ;debug Success
        Return 1
    EndIf
 ConsoleWrite(0 & @CRLF) ;debug Failed
    Return 0
EndFunc

Func _GetHexByKey_Switch($sKey)
    Switch $sKey
        Case "LeftMouse"            
            Return 0x01 
        Case "RightMouse"           
            Return 0x02     
        Case "MiddleMouse"          
            Return 0x04     
        Case "X1Mouse"          
            Return 0x05     
        Case "X2Mouse"          
            Return 0x06     
        Case "BACKSPACE"            
            Return 0x08     
        Case "TAB"          
            Return 0x09     
        Case "CLEAR"            
            Return 0x0C     
        Case "ENTER"            
            Return 0x0D     
        Case "SHIFT"            
            Return 0x10     
        Case "CTRL"         
            Return 0x11     
        Case "ALT"          
            Return 0x12     
        Case "PAUSE"            
            Return 0x13     
        Case "CAPSLOCK"         
            Return 0x14     
        Case "ESC"          
            Return 0x1B     
        Case " "            
            Return 0x20 
        Case "SPACE"            
            Return 0x20     
        Case "PAGE UP"          
            Return 0x21     
        Case "PAGE DOWN"            
            Return 0x22     
        Case "END"          
            Return 0x23     
        Case "HOME"         
            Return 0x24     
        Case "LEFT"         
            Return 0x25     
        Case "UP"           
            Return 0x26     
        Case "RIGHT"            
            Return 0x27     
        Case "DOWN"         
            Return 0x28     
        Case "SELECT"           
            Return 0x29     
        Case "PRINT"            
            Return 0x2A     
        Case "EXECUTE"          
            Return 0x2B     
        Case "PRINT SCREEN"         
            Return 0x2C     
        Case "INS"          
            Return 0x2D     
        Case "DEL"          
            Return 0x2E     
        Case "0"            
            Return 0x30     
        Case "1"            
            Return 0x31     
        Case "2"            
            Return 0x32     
        Case "3"            
            Return 0x33     
        Case "4"            
            Return 0x34     
        Case "5"            
            Return 0x35     
        Case "6"            
            Return 0x36     
        Case "7"            
            Return 0x37     
        Case "8"            
            Return 0x38     
        Case "9"            
            Return 0x39     
        Case "A"            
            Return 0x41     
        Case "B"            
            Return 0x42     
        Case "C"            
            Return 0x43     
        Case "D"            
            Return 0x44     
        Case "E"            
            Return 0x45     
        Case "F"        
            Return 0x46     
        Case "G"            
            Return 0x47     
        Case "H"            
            Return 0x48     
        Case "I"            
            Return 0x49     
        Case "J"            
            Return 0x4A     
        Case "K"            
            Return 0x4B     
        Case "L"            
            Return 0x4C     
        Case "M"            
            Return 0x4D     
        Case "N"            
            Return 0x4E     
        Case "O"            
            Return 0x4F     
        Case "P"            
            Return 0x50     
        Case "Q"            
            Return 0x51     
        Case "R"            
            Return 0x52     
        Case "S"            
            Return 0x53     
        Case "T"            
            Return 0x54     
        Case "U"            
            Return 0x55     
        Case "V"            
            Return 0x56     
        Case "W"            
            Return 0x57     
        Case "X"            
            Return 0x58     
        Case "Y"            
            Return 0x59     
        Case "Z"            
            Return 0x5A     
        Case "LWin"         
            Return 0x5B     
        Case "RWin"         
            Return 0x5C     
        Case "NUMPAD0"          
            Return 0x60     
        Case "NUMPAD1"          
            Return 0x61     
        Case "NUMPAD2"          
            Return 0x62     
        Case "NUMPAD3"          
            Return 0x63     
        Case "NUMPAD4"          
            Return 0x64     
        Case "NUMPAD5"          
            Return 0x65     
        Case "NUMPAD6"          
            Return 0x66     
        Case "NUMPAD7"          
            Return 0x67     
        Case "NUMPAD8"          
            Return 0x68     
        Case "NUMPAD9"          
            Return 0x69     
        Case "Multiply"         
            Return 0x6A     
        Case "Add"          
            Return 0x6B     
        Case "Separator"            
            Return 0x6C     
        Case "Subtract"         
            Return 0x6D     
        Case "Decimal"          
            Return 0x6E     
        Case "Divide"           
            Return 0x6F     
        Case "F1"           
            Return 0x70     
        Case "F2"           
            Return 0x71     
        Case "F3"           
            Return 0x72     
        Case "F4"           
            Return 0x73     
        Case "F5"           
            Return 0x74     
        Case "F6"           
            Return 0x75     
        Case "F7"           
            Return 0x76     
        Case "F8"           
            Return 0x77     
        Case "F9"           
            Return 0x78     
        Case "F10"          
            Return 0x79     
        Case "F11"          
            Return 0x7A     
        Case "F12"          
            Return 0x7B     
        Case "F13"          
            Return 0x7C     
        Case "F16"          
            Return 0x7F     
        Case "F17"          
            Return 0x80 
        Case "F18"          
            Return 0x81
        Case "F19"          
            Return 0x82 
        Case "F20"          
            Return 0x83 
        Case "F21"          
            Return 0x84 
        Case "F22"          
            Return 0x85 
        Case "F23"          
            Return 0x86     
        Case "F24"          
            Return 0x87     
        Case "NUM LOCK"         
            Return 0x90 
        Case "SCROLL LOCK"          
            Return 0x91     
        Case "LSHIFT"           
            Return 0xA0     
        Case "RSHIFT"           
            Return 0xA1     
        Case "LCTRL"            
            Return 0xA2     
        Case "RCTRL"            
            Return 0xA3     
        Case "LMENU"            
            Return 0xA4     
        Case "RMENU"            
            Return 0xA5     
        Case "="
            Return 0x92
        Case ";"
            Return 0xBA
        Case ":"
            Return 0xBA
        Case "+"
            Return 0xBB
        Case ","
            Return 0xBC
        Case "-"
            Return 0xBD
        Case "."
            Return 0xBE
        Case "/"
            Return 0xBF
        Case "?"
            Return 0xBF
        Case "`"
            Return 0xC0
        Case "~"
            Return 0xC0
        Case "["
            Return 0xDB
        Case "{"
            Return 0xDB
        Case "\"
            Return 0xDC
        Case "|"
            Return 0xDC
        Case "]"
            Return 0xDD
        Case "}"
            Return 0xDD
        Case "'"
            Return 0xDE
        Case '"'
            Return 0xDE
        Case "<"
            Return 0xE2
        Case ">"
            Return 0xE2
    EndSwitch
    Return -1
EndFunc   ;==>_GetHexByKey_Switch

;===============================================================================
;
; Function Name:  _MouseClickMinimized()
; 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 (cpf: or 2???) to use this without bugs.
; Author(s):      Insolence <>
;
;===============================================================================
Func _MouseClickMinimized($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1, $handle = 0)
    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
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    Select
        Case $Button = "right"
            $Button = $MK_RBUTTON
            $ButtonDown = $WM_RBUTTONDOWN
            $ButtonUp = $WM_RBUTTONUP
        Case $Button = "left"
            $Button = $MK_LBUTTON
            $ButtonDown = $WM_LBUTTONDOWN
            $ButtonUp = $WM_LBUTTONUP
        Case Else  ;; CPF
            ;; illegal number of parameters?
;~             MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
            Return
    EndSelect
    ;; makes no sense to send click to minimized window with current mouse coordinates
    If $X = "" Or $Y = "" Then
        ;; illegal number of parameters?
;~         MsgBox(32, "KCH: Problem", "_MouseClickPlus() called with bad number of params?")
        Return
    EndIf
    For $i = 1 To $Clicks
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $WM_MOUSEMOVE, _
                "int", 0, _
                "long", _MakeLong($X, $Y))
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonDown, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
        Sleep(10)
        DllCall("user32.dll", "int", "SendMessage", _
                "hwnd", $winhandle, _
                "int", $ButtonUp, _
                "int", $Button, _
                "long", _MakeLong($X, $Y)) 
    Next
EndFunc   ;==>_MouseClickMinimized

;===============================================================================
;
; Function Name:  _MouseMoveMinimized()
; Version added:  0.1
; Description:    Sends a move message to window, works minimized.
; Parameter(s):   $Window     =  Title of the window to send click to
;                 $X          =  X coordinate
;                 $Y          =  Y coordinate
; Remarks:        You MUST be in "MouseCoordMode" 0 (cpf: or 2???) to use this without bugs.
; Author(s):      Cris Fuhrman (based on code by Insolence <>)
;
;===============================================================================
Func _MouseMoveMinimized($Window, $X = "", $Y = "", $handle = 0)
    Local $WM_MOUSEMOVE = 0x0200
    Local $i = 0
    if $handle = 1 Then
        Local $winhandle = $Window
    Elseif $handle = 0 Then
        Local $winhandle = WinGetHandle($Window)
    EndIf
    
    If $X = "" Or $Y = "" Then
;~         MsgBox(32, "KCH: Problem", "_MouseMovePlus() called with bad number of params?")
        Return
    EndIf
    
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd", $winhandle, _
            "int", $WM_MOUSEMOVE, _
            "int", 0, _
            "long", _MakeLong($X, $Y)) 
EndFunc   ;==>_MouseMoveMinimized

Func _MakeLong($LoWord, $HiWord)
    Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc   ;==>_MakeLong
So basically once you convert this over to C# using all the appropriate DLL calls. You can simply do something similar to this.

Code:
My C# is like NOT good atm lol but here's an idea
Let's assume you use a function similar to mine for getting memory values.
Like _GetPlayer("target")

And I'm not sure how to perform a looping funciton using C# without the use of a timer. So here's a simple script you can work with perhaps. It's hard to explain this _SendMinimizedVK() function, as well as the ControlSend function from autoit. I know they both use the user32.dll api SendMessage function.
And they both only send the key press one time to the window. It wont work in a loop, unless maybe setting a timer between clicks is needed.

Public void RunBot ()
{
string pTarget = _GetPlayer("target")

if (pTarget == "")
{
     _SendMinimizedVK(WinGetHandle("EtherSaga"),"TAB")
else
{
     _MouseClickMinimized($Window, "left", $X, $Y,1, 0)
}
}
blinko is offline  
Old   #25
 
elite*gold: 0
Join Date: Jan 2010
Posts: 18
Received Thanks: 2
hmm.... I couldn't get the {TAB} key to send, when window is not active, in my code. I'll take a look at it later again. Thx.
mibiz1 is offline  
Old   #26
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by mibiz1 View Post
hmm.... I couldn't get the {TAB} key to send, when window is not active, in my code. I'll take a look at it later again. Thx.
You can if you have the Window Tile. ControlSend("Ether Saga","","","{TAB}") will send the TAB key, however, this seems to use the SendMessage function from the user32.dll, and it does not send a Key_Up function to release the key. This is why when you send a raw key to the client it will execute the HotKey one time. Like you can tab to target, then the bot sits idle. This is because the key stays in a "pressed" state and does not release itself. But it seems to work fine when used along side the ControlClick, using ControlCLick somehow releases the pressed Key and does a mouse click, then the key can be used again. Sending the key over and over in a loop will not work without the key_up function. Which evidently is handled separately.
blinko is offline  
Old   #27
 
elite*gold: 0
Join Date: Dec 2007
Posts: 17
Received Thanks: 1
Ya if i using controlsend i can't minimize game ether saga online, but before i using that i can minimize game n bot still running in game. but now program still running n hotkey still run to. anyone know what using new functions for mouse clicked active only in game if we minimize that games.
pkobot is offline  
Old   #28
 
elite*gold: 0
Join Date: Aug 2005
Posts: 499
Received Thanks: 130
Quote:
Originally Posted by pkobot View Post
Ya if i using controlsend i can't minimize game ether saga online, but before i using that i can minimize game n bot still running in game. but now program still running n hotkey still run to. anyone know what using new functions for mouse clicked active only in game if we minimize that games.
If you're using AutoIt then you'll want to use the ControlClick function.
This works by clicking the mouse @ the given screen coordinates inside the window (even if its minimized) It'll just act as if it were the active window and will send the mouse click directly to the target window.

so ControlClick("Ether Saga", "", "", "left",1 , $ATK_X, $ATK_Y)
where $ATK_X, and $ATK_Y are the coordinates of the hotkey used inside the game client. I don't know how exactly...because it doesn't sound logical but it does work. and the {TAB} only works if using autoit the TAB key is 0x09 in hex, so when using C# or another programming language to either SendMessage or PostMessage you'll want to have the correct key being sent into the game window. Since the client has no control ids to hook onto it'll send the key raw to the client. I haven't been playing Ether Saga anymore, but I'll be more than glad to help anyone who needs it.
blinko is offline  
Old   #29
 
elite*gold: 0
Join Date: Jun 2009
Posts: 11
Received Thanks: 0
hihi! can you please teach me how to use your bot?o.o

It only have 3 file in it and no .exe o.o
hello999 is offline  
Old   #30
 
elite*gold: 0
Join Date: Nov 2008
Posts: 1,645
Received Thanks: 229
some questions is level hack( elementclient.ct ... (is pacfhed ik but i can find the id self.. ) cs (client sidet..?) and gold hack sc ? because there are gold level at co. Oo and i dont thinc eny game have an level hack xD because the level data ar in the server not on the computer and to hack the server is inposible... with out a place in the root firma O.o


LucySw is offline  
Closed Thread



« Previous Thread | Next Thread »

Similar Threads
Ether Saga Online Bot
sorry for my post now mixlife cant support for u
317 Replies - General Gaming Discussion
Ether saga online
Hi, ich denke mal manche von euch kennen Ether Saga online nun wollte ich mir (free zen) holen und was ingame (E-Buck) heißt ... nun habe ich das...
0 Replies - Main
Ether Saga Online - my 1st bot
The reason for this bot is the limitations I encountered with Possessor. This is actually my 2nd bot :p The 1st bot was in pure AutoIt. It was slow...
15 Replies - General Gaming Discussion
Ether Saga Online...
Hmm... I've been reading posts and it seems people have posted that people get 200g in 2 - 3 days... I have been playing about 3 days and I have only...
0 Replies - General Gaming Discussion



All times are GMT +1. The time now is 13:46.


Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2016 elitepvpers All Rights Reserved.