LSS 'Type' vs AutoIT 'send'

Need Help With an Existing Feature in Memory Hacking Software? Ask Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

LSS 'Type' vs AutoIT 'send'

Postby mezzo » Tue Apr 08, 2008 2:29 pm

Got a small question.
I was under the impression that the game I'm working with blocks input send by 'scripts' instead of the real keyboard
(I used the LSS Type function, which doesn't work).
But I read on elitepvpers that AutoIT does in fact send keystrokes to it.

Any idea what the difference could be between the 'send' from autoit and the type command in LSS?
And how would I be able to emulate pushing 'spacebar' or 'm' to more closely ressemble autoIT functionality
(given that the Type command doesn't seem to work in that game)

I'm looking at the description of 'SendInput' in the helpfile, but can't rly say if that would work. (is the underlying code the same as 'Type' ?)
Can that funtion send 1 keystroke ? And if so, how would I simulate spacebar ? Small example would be nice :p
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby L. Spiro » Tue Apr 08, 2008 3:28 pm

I don’t know how AutoIT sends its keystrokes so I wouldn’t know how they are different.

MHS has a half bypass for its input-sending functions so it is still possible to block them, but difficult. AutoIT most likely does not have this feature, so anything that works in AutoIT should work in MHS.


And given your type_command() and press_enter() functions one would suspect that the KeyboardEvent() function in MHS is working, and that is the only function Type() uses (except VkKeyScan()).

If KeyboardEvent() is working, keep using it. View MSDN examples if you need an example of how to use SendInput(). KeyboardEvent() calls SendInput() anyway.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby mezzo » Tue Apr 08, 2008 4:10 pm

L.Spiro wrote:so anything that works in AutoIT should work in MHS.

Yup, that was my idea exactly.

And given your type_command() and press_enter() functions one would suspect that the KeyboardEvent() function in MHS is working, and that is the only function Type() uses (except VkKeyScan()).

Yes, those functions do work in regular windows applications, as I use them in quite a lot of other tools,
but they don't work as expected in GuildWars. I will give it another go this evening, perhaps I did something dumb .

As for the MSDN site, ye, I'm a lazy git :-)
I'll try to keep focussed long enough to read through their examples *yawn*
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby mezzo » Wed Apr 09, 2008 3:32 pm

Okay, I gave it another shot last night and there is a few strange things:

when I use 'Type' or my 'type_command' function, nothing seems to happen..
HOWEVER, when I first click on the chatbar, and then call the function, it
does effectively type the command.
Strange thing is when whatever I want to print contains special characters (exclamation marks, etc),
it prints those as the number (as in typed on the keyboard without holding shift)..
ie:
char * teststring = "hello!"; //would print out Hello1

Just as a test, I configured '1' to be a hotkey in game (! is normally chat),
and tried to send that through my script, but it doesn't send 1 or !
It only seems to want to accept my input when I have clicked the chat bar
before.

(against my will I installed autoIT, it does work there.. but I hate the tool,
so any MHS ways would be nice). I'm thinking it has something to do with dxinput, could that be ?

Any ideas/hints/... would be great.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby L. Spiro » Wed Apr 09, 2008 3:59 pm

It may be a DirectInput thing but here again I would not consider AutoIT so advanced as to handle those special cases.

Do be aware that when you press your Hotkey you are holding Ctrl or Shift and these will be held while the text is typed.
Which means you may be hitting Ctrl-H, Ctrl-E, Ctrl-L, etc.

Use KeyboardEvent() to release all special keys before typing things.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby mezzo » Wed Apr 09, 2008 4:57 pm

I figured that the hotkey could impact that, so I made a button on
my little frontend that gives focus to the game, sleeps for X time and then Type or type_command whatever I needed to type..
but it only accepts it when the chatbox is 'highlighted'.

It's not a big issue, as I can get around most of it by simply butting extra 'buttons' on the games interface,
but a few functions are ingame hotkey only, for example the 'target next NPC' keystroke = ';' ,
which I need to accept a quest and reward.
I can work around it with scanning the screen for certain colored pixels, but I would much rather understand what this game
is doing to block/ignore text input when the chatbox is not highlighted.

On a sidenote, when I make a macro for my G15 keyboard to send keystrokes to the game, it does work..
But it might well be that the G15 keyboard driver does stuff differently..

I'll work around it for now until I come up with a different idea :-)
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby L. Spiro » Wed Apr 09, 2008 5:53 pm

Because the textbox uses Windows input while the game manages input itself using DirectInput.

I will have to research how to simulate input in DirectInput.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests