|
You last visited: Today at 11:45
Advertisement
Warhammer Online / Taste Simulieren / Vb.Net
Discussion on Warhammer Online / Taste Simulieren / Vb.Net within the General Gaming Discussion forum part of the General Gaming category.
10/19/2008, 15:27
|
#1
|
elite*gold: 0
Join Date: Oct 2008
Posts: 7
Received Thanks: 0
|
Warhammer Online / Taste Simulieren / Vb.Net
Hallo alle zusammen,
ich verzweifel momentan daran, an dem versuch erfolgreich eine Taste an das Spiel „Warhammer Online“ zu senden.
Ich habe es mit allen Möglichkeiten versucht die ich im Internet finden konnte → Ich konnte hier im Forum einen Beitrag finden, wie es eigentlich funktionieren sollte:
Link:
Hier mal ein kleiner Ausschnitt:
Quote:
Hi folks,
usually I am not releasing my stuff. But here is a small hint for "do it yourself" people, how to simulate keystrokes for Warhammer Online.
The usual way to do that via Postmessage or kbdevent does NOT work here, because Warhammer is a DirectInput game.
It cost me some hours to figure out a proper but easy way how to do it:
INPUT input;
memset(&input,0,sizeof(INPUT));
input.type=INPUT_KEYBOARD;
input.ki.wScan =DIKEYBOARD_1; // direct-input scancode for key '1'
if(press_key) input.ki.dwFlags=0;
else input.ki.dwFlags=KEYEVENTF_KEYUP;
SendInput(1,&input,sizeof(INPUT));
This example will properly work for XT and Vista.
The trick is simply NOT to use VK_'s, but the lower 16 bits of DirectX scancodes. Try to google for DIKEYBOARD_1 and you will find them all.
Have Fun with it.
apollo
PS: It seems to be hard to find the right one, so I post those scancodes here:
#ifndef DIRECT_X_KEYS_HPP_DEFINED
#define DIRECT_X_KEYS_HPP_DEFINED
#define DIKEYBOARD_ESCAPE 0x0401 //
#define DIKEYBOARD_1 0x0402 //
#define DIKEYBOARD_2 0x0403 //
#define DIKEYBOARD_3 0x0404 //
|
Da ich der sprache C / C++ leider nicht mächtig bin, habe ich das ganze in Vb.Net Versucht:
Code:
Option Explicit Off
Public Class Form1
Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Long, ByRef pInputs As MyInput, ByVal cbSize As Long) As Long
Private Structure KEYBDINPUT
Dim wVk As Integer
Dim wScan As Long
Dim dwFlags As Long
Dim time As Long
Dim dwExtraInfo As Long
Dim unused1 As Long
Dim unused2 As Long
End Structure
Private Structure MyInput
Dim Type As Long
Dim ki As KEYBDINPUT
End Structure
Private Const KEYEVENTF_KEYUP As Long = &H2
Private Const INPUT_KEYBOARD As Long = 1
Private Const DIKEYBOARD_1 As Long = &H402 '0x0402
Private Sub Form_Load()
Dim inp As MyInput
inp.Type = INPUT_KEYBOARD
inp.ki.wScan = DIKEYBOARD_1
If Not press_key Then
inp.ki.dwFlags = KEYEVENTF_KEYUP
End If
SendInput(1, inp, Len(inp))
End Sub
End Class
Leider passiert genau nichts – Hat jemand vielleicht noch eine Idee (wenn mögich in Vb.Net) was an diesem Code falsch ist oder eine andere möglichkeit?
Ein Beispiel in Vb.Net wäre super.
Hoffe jemand kann mir helfen - Danke voraus
|
|
|
10/19/2008, 17:15
|
#2
|
elite*gold: 4
Join Date: Aug 2008
Posts: 6,783
Received Thanks: 4,992
|
#moved to warhammer section
|
|
|
10/20/2008, 20:52
|
#3
|
elite*gold: 0
Join Date: Oct 2008
Posts: 7
Received Thanks: 0
|
Hallo,
hat keiner eine Idee hier? Irgendiwe müssen doch alle "Bots" ihre Tasten Simulieren.
Ich hab inzwischen auch folgendes versucht:
Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYBOARD_1 As Byte = &H49
Private Const KEYEVENTF_KEYUP As Byte = &H2
Public Sub KeySend()
keybd_event(KEYBOARD_1, 0, 0, 0)
keybd_event(KEYBOARD_1, 0, KEYEVENTF_KEYUP, 0)
End Sub
Aber natürlich auch ohne erfolg!
|
|
|
10/21/2008, 14:58
|
#4
|
elite*gold: 0
Join Date: Nov 2007
Posts: 81
Received Thanks: 33
|
HMm mit autoIT ist das ganz easy.
send("2")
Funzt in War aber nur wenn war aktiv ist
|
|
|
10/23/2008, 22:44
|
#5
|
elite*gold: 0
Join Date: Oct 2008
Posts: 7
Received Thanks: 0
|
Hallo,
leider funktioniert es mit der Vb.Net eigene Funktion:
auch nicht. Habe inzwischen auch versucht per Googel zu erfahren wie Autoit die Tasten Simuliert aber auch ohne erfolg!
Keiner eine Idee?
Wäre auch schon hilfreich wenn es ein Open Source Programm geben wird, welches in Warhammer eine Taste sendet (egal welche Sprache).
|
|
|
10/29/2008, 23:02
|
#6
|
elite*gold: 0
Join Date: Dec 2004
Posts: 118
Received Thanks: 42
|
Bin mir nicht sicher, aber bei
Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Long, ByRef pInputs As MyInput, ByVal cbSize As Long) As Long
könnte die falsche Deklaration vielleicht sein. Da steht Long als parameter Typ und in der MSDN steht
UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
also UINT (unsigned integer, normalerweise 32 Bit Wert) während Long (Entspricht Int64 in .NET) ein 64 Bit Wert ist. Solltest mal vielleicht UInteger als Wert statt Long versuchen
|
|
|
10/31/2008, 23:07
|
#7
|
elite*gold: 0
Join Date: Oct 2008
Posts: 7
Received Thanks: 0
|
Hallo,
danke für deinen Tipp - Aber leider funktioniert es nicht!
Hat vielleicht jemand noch eine Idee -> Mir würde auch ein Sourc (egal welche Sprache) schon sehr viel weiterhelfen.
Danke im voraus
|
|
|
01/05/2010, 09:57
|
#8
|
elite*gold: 407
Join Date: May 2009
Posts: 1,574
Received Thanks: 728
|
Quote:
Originally Posted by Pwneres
HMm mit autoIT ist das ganz easy.
send("2")
Funzt in War aber nur wenn war aktiv ist
|
So^^ mit Visual basic heißt es Sendkeys.Send("{2}")
Das war doch deine Frage oder?
Das geht mit eig. allen tasten^^
auch
Sendkeys.Send("{ENTER}") u.s.w
|
|
|
01/05/2010, 10:30
|
#9
|
♥ Yuuki Asuna ♥
elite*gold: 45
Join Date: Jun 2005
Posts: 54,877
Received Thanks: 8,573
|
Der letzte Post ist über 1 Jahr alt.... oO
|
|
|
Similar Threads
|
Warhammer Online: AoR
02/10/2009 - General Gaming Discussion - 7 Replies
Hey people,
Me and a friend were interested in trying out this game, but we didn't want to go out and buy the game cold turkey, since it'd be pretty hard to re-sell it in our country (Portugal), in case we didn't like it. So I was wondering if there are any players around who could hook us up with trial keys?
Thanks in advance :)
|
[VB6/c++]Taste simulieren ohne sendkey?
10/03/2005 - C/C++ - 4 Replies
Gibts ne Möglichkeit nen tastendruck zu simulieren ohne sendkey?
|
All times are GMT +1. The time now is 11:47.
|
|