Jump to content
Sign in to follow this  
Miranda

ControlSend not working with a game when Send does

Recommended Posts

Miranda

Hey there,

I've got a small script here:

_tip("3")
_tip("2")
_tip("1")
$handle=WinGetHandle("")
_tip("3")
_tip("2")
_tip("1")

ControlSend("","",$handle,"{5}")

ControlSend("","",$handle,"{5}")

ControlSend("","",$handle,"{5}")

ControlFocus("","",$handle)

Sleep(500)
ControlSend("","",$handle,"{5}")

_tip("$handle=" & $handle)

Func _Tip($i)
    ToolTip($i)
    Sleep(1000)
    ToolTip("")
EndFunc ;==>_Tip

5 is never pressed in the game. The handle however works properly, Send()ing directly works aswell.

Does anyone have a clue how I could try to fix this?

The game in question is EverQuest II btw.

Thanks if anyone can, or at least tries to help ;)

Kind regards,

Miranda

Edit: I wanted to add that at the second countdown I switched away from the window, and control send wouldn't work, yet a WinActivate($handle) works. Also if the window has control nothing will be sent...

Edited by Miranda

Share this post


Link to post
Share on other sites
AwAke

I may be wrong as im quite a newb.

But I was looking at how you have your handle set.

Wouldnt it be better to have it as.

$handle = WinGetHandle("EverQuest II")

Or perhaps if EverQuest has a control you can send it

with the ControlSend along with the control of the game.

As the helpfile shows when regarding 'WinGetHandle'.

$handle = WinGetHandle("classname=Notepad", "this one")

However I may be wrong in what ive said, if thats the case. Sorry. =]

Edited by AwAke

Share this post


Link to post
Share on other sites
Miranda

$handle=WinGetHandle("") gets the currently active's window's handle, so that's not an issue. Also other operations with the windowhandle work fine, such as activating the window, just controlsend wont work. I'd say this was a protective measure from EQ2, if Send() didn't work, but since it works I'm just thinking it's their pisspoor coding messing something up...

Does anyone have a workaround? Maybe a different programming language? really all I need to do is send the window keypresses at certain intervals, without it being active however.

Share this post


Link to post
Share on other sites
Miranda

Anyone?

Share this post


Link to post
Share on other sites
crovex

ControlSend($title,"","","0")

i use it like this but i face bugs like random holding of shifts,ctrl,alt and unfocuses window.

Any1 can enlighten me on this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×