Are you using sendkeys.send?
There are some diffrent ways you can do it
I think crossfire have blocked sendkeys.send like nexon did on combat arms!
If you want to do it the easy way ask WPS(warpathsin)
It was suggested on another thread that you guys could help me with a little problem... please see
https://www.mpgh.net/forum/175-crossf...crossfire.html
Are you using sendkeys.send?
There are some diffrent ways you can do it
I think crossfire have blocked sendkeys.send like nexon did on combat arms!
If you want to do it the easy way ask WPS(warpathsin)
-Rest in peace leechers-
Your PM box is 100% full.
Are you actually using API....
Crossfire may be one of those applications that block keystrokes
If it is, Then you are in for a long road and lots of rewriting
Which Includes Bytes , and user32 Keyb Events, Not a "easy task. "
I found something promising in the SendInput API, which apparently will dump the input directly into the input stream.... Any of you guys heard anything about it?
yes they have completely stopped allowing sending keys on there, So here is your answer:
You Cannot do this, try a different game
[IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]
Thanks all for your help, I am currently trying the Sendinput API which should drop it right into the input stream, but it keeps erroring out due to some small inconsistency....
Ok, here is my code.
In the declarations:
Code:Const KEYEVENTF_KEYUP = &H2 Const INPUT_MOUSE = 0 Const INPUT_KEYBOARD = 1 Const INPUT_HARDWARE = 2 Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move 32768 Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down 2 Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up 4 Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down 32 Private Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up 64 Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move 1 Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down 8 Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up 16 Private Structure MOUSEINPUT Public dx As Long Public dy As Long Public mouseData As Long Public dwFlags As Long Public time As Long Public dwExtraInfo As Long End Structure Private Structure KEYBDINPUT Public wVk As Integer Public wScan As Integer Public dwFlags As Long Public time As Long Public dwExtraInfo As Long End Structure Private Structure HARDWAREINPUT Public uMsg As Long Public wParamL As Integer Public wParamH As Integer End Structure Private Structure GENERALINPUT Public dwType As Long Public xi() As Byte End Structure Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, ByVal pInputs As GENERALINPUT, ByVal cbSize As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDst, ByVal pSrc, ByVal ByteLen) 'I cant type these as Visul Studio doesn't support the Any type
And the sub thats erroring
It says "*********enceexeption: object reference not set to an instance of the object" I can get it to go away by dimentioning ginput(0).xi like soCode:Sub ClickMouse(ByVal x As Long, ByVal y As Long) Dim GInput(0 To 1) As GENERALINPUT Dim MINPUT As New MOUSEINPUT MINPUT.dx = x MINPUT.dy = y '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel MINPUT.mouseData = 0 MINPUT.dwFlags = MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTDOWN MINPUT.time = 0 MINPUT.dwExtraInfo = 0 GInput(0).dwType = INPUT_MOUSE CopyMemory(GInput(0).xi(0), MINPUT, Len(MINPUT)) ' errors here ********************************* MINPUT.dx = x MINPUT.dy = y '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel MINPUT.mouseData = 0 MINPUT.dwFlags = MOUSEEVENTF_LEFTUP + MOUSEEVENTF_MOVE MINPUT.time = 0 MINPUT.dwExtraInfo = 0 GInput(1).dwType = INPUT_MOUSE ' keyboard input CopyMemory(GInput(1).xi(0), MINPUT, Len(MINPUT)) Call SendInput(2, GInput(0), Len(GInput(0))) End Sub
But then it tells me I'm trying to access protected memory.Code:Redim Ginput(0).xi(len(MINPUT))
This Code
Has 0 errors, Running or Debugging....Code:Public Class Form1 Const KEYEVENTF_KEYUP = &H2 Const INPUT_MOUSE = 0 Const INPUT_KEYBOARD = 1 Const INPUT_HARDWARE = 2 Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move 32768 Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down 2 Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up 4 Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down 32 Private Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up 64 Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move 1 Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down 8 Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up 16 Private Structure MOUSEINPUT Public dx As Long Public dy As Long Public mouseData As Long Public dwFlags As Long Public time As Long Public dwExtraInfo As Long End Structure Private Structure KEYBDINPUT Public wVk As Integer Public wScan As Integer Public dwFlags As Long Public time As Long Public dwExtraInfo As Long End Structure Private Structure HARDWAREINPUT Public uMsg As Long Public wParamL As Integer Public wParamH As Integer End Structure Private Structure GENERALINPUT Public dwType As Long Public xi() As Byte End Structure Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, ByVal pInputs As GENERALINPUT, ByVal cbSize As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDst, ByVal pSrc, ByVal ByteLen) 'I cant type these as Visul Studio doesn't support the Any type Sub ClickMouse(ByVal x As Long, ByVal y As Long) Dim GInput(0 To 1) As GENERALINPUT Dim MINPUT As New MOUSEINPUT MINPUT.dx = x MINPUT.dy = y '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel MINPUT.mouseData = 0 MINPUT.dwFlags = MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTDOWN MINPUT.time = 0 MINPUT.dwExtraInfo = 0 GInput(0).dwType = INPUT_MOUSE CopyMemory(GInput(0).xi(0), MINPUT, Len(MINPUT)) ' errors here ********************************* MINPUT.dx = x MINPUT.dy = y '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel MINPUT.mouseData = 0 MINPUT.dwFlags = MOUSEEVENTF_LEFTUP + MOUSEEVENTF_MOVE MINPUT.time = 0 MINPUT.dwExtraInfo = 0 GInput(1).dwType = INPUT_MOUSE ' keyboard input CopyMemory(GInput(1).xi(0), MINPUT, Len(MINPUT)) Call SendInput(2, GInput(0), Len(GInput(0))) End Sub End Class
What else is in your code, the null exception maybe coming from another part of the code,
It can't be; theres no other code. I'll attach a screenshot of the error message. A point of interest; when I view the contents of Ginput(0), it says "Nothing" for xi. Maybe something with visual studio?
OS + SP(If any) + Framwork?
If you have framework 2.0 update to 3.5 (not 4 beta)
I know there was a issue with null reference exceptions that was resolved in 3.5 or with a hotfix in 2.0 , and as far as your users go, make sure network 3.5 is a prerequisite
OK, i solved my earlier two problems... but now I've got another one!
Code changes:
Code:Public Structure MOUSEINPUT Public dx As Integer Public dy As Integer Public mouseData As Integer Public dwFlags As Integer Public dwtime As Integer Public dwExtraInfo As Integer End Structure Public Structure INPUT_TYPE Public dwType As Integer Public xi As MOUSEINPUT End Structure Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Integer, ByRef pInputs As INPUT_TYPE, ByVal cbSize As Integer) As Integer
The function call works fine, but the mouse just sits there. I figured out the API was returning 0 (the error code) and that I had to get the last win32error code. This told me it was code 87, orCode:Sub ClickMouse(ByVal x As Long, ByVal y As Long) Dim inputEvents As INPUT_TYPE inputEvents.xi.dx = x inputEvents.xi.dy = y inputEvents.xi.mouseData = 0 inputEvents.xi.dwFlags = MOUSEEVENTF_MOVE inputEvents.xi.dwtime = 0 inputEvents.xi.dwExtraInfo = 0 inputEvents.dwType = INPUT_MOUSE Dim s = System.Runtime.InteropServices.Marshal.SizeOf(GetType(INPUT_TYPE)) If SendInput(1, inputEvents, s) = 0 Then MsgBox(System.Runtime.InteropServices.Marshal.GetLastWin32Error.ToString) End Sub
So now I'm back to square one!!87 The parameter is incorrect. ERROR_INVALID_PARAMETER