Sign in to follow this  
Followers 0
Azothoras

ControlClick with ctrl button pressed.

3 posts in this topic

I've searched this forum for over a year and I've almost always found an answer although I don't now.

I want to use the controlclick function in my script but the tricky part is that I wish to have ctrl pressed while I controlclick.

$Rand1 = Random($size[0] / 2 - $win, $size[0] / 2 + $win)
$Rand2 = Random($size[1] / 2 - $win, $size[1] / 2 + $win)

Send("{CTRLDOWN}")

ControlClick($Conquer_Handle, "", "[CLASS:#32770; INSTANCE:1]", "left", 1, $Rand1, $Rand2)

Send("{CTRLUP}")

With this code the controlclick works but my in-game character won't jump as it does if you press ctrl and then click.

If I use the regular

MouseClick("left",$Rand1, $Rand2,1,0)
function then it jumps although this way I can't minimize the window hehe.

Anyone got any solution.

ps I've also tried using

ControlSend($Conquer_Handle, "", "[CLASS:#32770; INSTANCE:1]", "{CTRLDOWN}")

Doesn't work either.

I've also tried using the MouseClickPlus but this function doesn't work at all...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is just my 2 cents but I would say

$Rand1 = Random($size[0] / 2 - $win, $size[0] / 2 + $win)
$Rand2 = Random($size[1] / 2 - $win, $size[1] / 2 + $win)

Send("{CTRL DOWN}")
Sleep (75)
ControlClick($Conquer_Handle, "", "[CLASS:#32770; INSTANCE:1]", "left", 1, $Rand1, $Rand2)

Send("{CTRL UP}")

I dunno just throwing it out there . . . maybe play with that sleep. I mean it's possible it's clicking too fast for the game engine to recognize.

Edited by Styles2304

Share this post


Link to post
Share on other sites

$Rand1 = Random($size[0] / 2 - $win, $size[0] / 2 + $win)
$Rand2 = Random($size[1] / 2 - $win, $size[1] / 2 + $win)

Send("{CTRLDOWN}")

MouseClick("left",$Rand1, $Rand2,1,0)

Send("{CTRLUP}")

This works... Although ControlClick doesn't work and the sleep thingy doesn't work either :)

Ty anyway mate

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  
Followers 0