hi I’m trying to use InputSimulator in a C# eve online Bot that I’m working on.
I’m tying to open the probe scanner with alt-p, the game gets the alt key and holds it but that’s it.
I have tried:
InputSimulator sim = new InputSimulator();
sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.MENU, VirtualKeyCode.VK_P);
and
InputSimulator sim = new InputSimulator();
sim.Keyboard.ModifiedKeyStroke(VirtualKeyCode.MENU, new[] { VirtualKeyCode.VK_P });
classes:
using WindowsInput.Native;
using WindowsInput;
any help you guys can give would be appreciated.
1 Like
more infos you find here ( if you want to use on A-bot): Avoiding to struggle - a guide for beginers
yield return new BotTask //open windowprobes
{
Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[]
{
VirtualKeyCode.LMENU, VirtualKeyCode.VK_P
}) }
};
if you want to use on a Sanderling script,
if (probeScannerWindow == null)
Sanderling.KeyboardPressCombined(new { VirtualKeyCode.LMENU, VirtualKeyCode.VK_P });
more examples for a sanderling script you finde at ( and check the master branch/last commit on git):
Here you have a bot script for Sanderling to ratting anomaly and/or asteroids. Configurations from settings for almost everything.
So:
The asteroids are taken from list surroundings button, and you warp at 20 km ( configurable in code), on anomaly at 50 km ( configurable in code)
orbit from the keyboard or from the overview;
activate/stop afterburner and armor repairer automatically ;
loot wrecks, go “home” when the cargo is full;
go “home” when are neutrals/hostiles in local chat.
In test…
and here
UPDATE 2v3:
To be honest there are some more changes, but since I’ve done them in time, I cannot track them exactly.
At the suggestion of @ Maniac in pm’s I’ve shorted the codelines, using Dictionary ( for warping to anomaly)
The second notable change is at the retreat level. I changed the “protocol” so now while the retreat string is not null, if the drones in space are 0, he warp directly, else he retreat the drones. This change, placed in the same loop, cut the time to reload the script an…
2 Likes
pikacuq
October 22, 2018, 10:23am
3
if you want to avoid spagetti code, I’d recommend to define shortcut class something like:
public class KeyShortcuts
{
public static VirtualKeyCode[]
Key_ProbeScanner = { VirtualKeyCode.MENU, VirtualKeyCode.VK_P },
}
and then when you need it simply call
if (null == MemoryMeasurement?.WindowProbeScanner)
yield return KeyShortcuts.Key_ProbeScanner.KeyboardPressCombined();
then you can maintain all your shorcut keys at one place instead of searching whole code over and over again.
Cheers
2 Likes
Cool Thx, ya I’m trying some bots out. lots of good ones here. lol most of the ones i see are from you guys.