Virtual Key Codes

Is there a simple way to have the script use virtualkeycodes?

I am playing with Abot …

if (droneInLocalSpaceIdle)
//yield return droneGroupInLocalSpace.ClickMenuEntryByRegexPattern(bot, @"engage");
						
yield return VirtualKeyCode.VK_F;

Basically rather than have the script right click drone window and engage … i want it to simply press the f key …

using WindowsInput.Native;

..............................................................................
yield return new BotTask //
{
Effects = new[] { MotionParamExtension.KeyboardPress(VirtualKeyCode.VK_F) }
};
 or combined ctrl/shift + left click 
var lockTargetKeyCode = VirtualKeyCode.LCONTROL;// lock targhet

var targetLockedKeyCode = VirtualKeyCode.SHIFT;//locked targhet
and  for target lock:
yield return new BotTask
{
Effects = new[]
{
MotionParamExtension.KeyDown(lockTargetKeyCode),
overviewEntryLockTarget.MouseClick(MouseButtonIdEnum.Left),
MotionParamExtension.KeyUp(lockTargetKeyCode)
}
};

or  press combined keys
yield return new BotTask //return to bay drone
{
Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] {
VirtualKeyCode.SHIFT, VirtualKeyCode.VK_R
}) }
};
just be care the  chat window ARE NOT focused ( if you use F, W etc)

thanks for the help … will try it out

You have now all variants: combined shift+R for return drones;
ctrl +leftclick for locking targets
avoid to focus chat window and be carefull with shift+R, sometimes drones stay sticked betwen rocks, rats, wrecks and they dont come ( thats why is better to use click right return to cargo , it seems it work better)

Its working …

Now I have to figure out how to get the bot to recognize rats on grid … and launch drones immediately before orbiting and targetting …

looking into that