Lethal Company

Lethal Company

(Servono più voti)
Using macros to speed up terminal use (no mods)
Da Kuku
This guide shows how to install and use a C# script that makes the F1-F10 keys enter repetitive terminal commands quickly.
   
Premio
Aggiungi ai preferiti
Preferito
Rimuovi dai preferiti
Intro
This guide is for anyone wanting to play the role ship guy and who wants to make their job a lot more comfortable and snappy. For an overview of what a player's terminal duties are I recommend watching this video first, by Wurps.

The sections below provide an option for Windows users to get macros up and running that can help type repetitive terminal commands way faster.
Installation & Use
1. Download and Install LibreAutomate[www.libreautomate.com]

2. Download this script file[drive.google.com]

3. Open LibreAutomate, select File> Export, import> Import zip… and select the downloaded zip file.


4. Find the “LETHAL COMPANY TERMINAL SHORTCUTS” script and press RUN


5. Open Lethal Company, make sure you are playing in Windowed Fullscreen (or Windowed) in settings.


6. In game, use the keys F1 through F10 and Shift+F1 through Shift+F10 to accelerate terminal commands.

7. When done playing, end the script or close LibreAutomate to revert functionality of the F keys.
List of functions included
F1: SWITCH
F2: VIEW MONITOR
Shift+F1: SWITCH playername
Shift+F2: pop-up dialog to input playername

F3: disable list of turrets
Shift+F3: pop-up dialog to input list of turrets
Shift+F7: Forbidden macro from the Wurps video (nonrepeating). Avoid using if possible.

F4: PING radar-booster
Shift+F4: pop-up dialog to input radar-booster name(s)
F5 and Shift+F5: FLASH radar-booster (shift is a bit slower but works better)

F6: TRANSMIT _
Shift+F6: clears command line

F7: SCAN
F8: STORE
Shift+F8: pop-up dialog to input full shopping list
F9: MOONS
Shift+F9: MOONS then COMPANY then CONFIRM (w/o enter)
F10: STORAGE
Shift+F10: BESTIARY
full C# script
The full C# LibreAutomate script, which can be copy-pasted into LibreAutomate, as an alternative to importing the zip file from the google drive.


/*
LETHAL COMPANY TERMINAL SCRIPTS
by @zywu on Discord, @zywuu on Tumblr, id/zyrkane on Steam.

Script that rebinds keys F1-F10 to written commands to accelerate terminal use in Lethal company. Playing in windowed fullscreen is reccomended while using this script.

shortcut command action performed

==Monitor commands==
F1: SWITCH Switches between the player trackers
F2: VIEW MONITOR Enables/disables the monitor in terminal
Shift+F1: SWITCH playername Switches the monitor to the player specified as of key interest
Shift+F2: input key viewed player Opens a dialog box to input player of most interest

==Turret disabling==
Shift+F3: turret recorder popup Pops up a dialog box to list turrets the player sees. The dialog identifies every letter,number pairing in the input text
F3: mass-disable turrets Disables all the turrets listed in the popup dialog in quick succession

==Radar-boosters==
Shift+F4: input radar name popup Pops up a dialog box to provide name of targeted radar-booster. Multiple radars can be listed seperated by spaces or commas.
F4: PING radar-booster Causes the targeted radar-booster to make a hello noise.
F5: FLASH radar-booster Causes the targeted radar-booster to make a birgt flash, functioning as a reusable flashbang-lite. Has a short, but noticeable cooldown.
Shift+F5: FLASH radar-booster * Also performs a flash but accounts for the possibility that targeted radar booster is disabled. Spamming F5 while a radar-booster is disabled
may result in accidental purchase of a flashlight due to the game misconstruding the flash command as an abbreviation for flashlight.

==Signal transmitter==
F6: TRANSMIT ? Begins the prompt for the transmit command, that can broadcast all players nine-character messages. Requires signal transmitter upgrade.
Shift+F6: cancel written command Inputs a bunch of backspaces, erasing whatever the player typed. Can be used to correct a fatfingered F6.

==Regular commands==
F7: SCAN Lists quantity and value of scrap outside the ship
F8: STORE Opens the store menu
F9: MOONS Opens the list of moons
F10: STORAGE Opens the list of stashed ship furniture
Shift+F10: BESTIARY Opens the bestiary

==Regular command assistance==
Shift+F8: shopping list popup Opens a dialog to enter a shopping list and buys all the items listed in quick succession. Used to comprise all items into one order consistently
or as a shortcut to deploy a distraction shipment
Shift+F9: MOONS>COMPANY Routes the ship to The Company

Shift+F7: every turret combi Cycles through every possible code a turret can have. Takes a while and is unreliable. Would not reccomend using. Only use I could precieve is
if a turret is located on a staircase, such that your team can see it but you can't see the code due to elevation difference.
*/

using Au.Triggers;
using System.Windows;

const int CalmDelay = 15;
ActionTriggers Triggers = new();
// Data for variables customizable through popup
string TurretNames="", RadarNames ="", PlayerName = "";
string[] Radars=[], ShoppingList=[];
string ViewingLead = "";
MatchCollection Turrets = Regex.Matches("",".");

//use when chaining multiple commands due to finnicky command input delay. If entering one command keys.sendt("cmd\n") works fine.
void calmInput(string cmd) { keys.sendt(cmd); keys.send("Enter"); CalmDelay.ms(); }
void calmerInput(string cmd) { keys.sendt(cmd); (CalmDelay*15).ms(); keys.send("Enter"); (CalmDelay*15).ms(); }



// MONITORING
Triggers.Hotkey["F1"] = o => keys.sendt($"switch\n");
Triggers.Hotkey["F2"] = o => keys.sendt($"view monitor\n");

Triggers.Hotkey["Shift+F1"] = o => keys.sendt($"switch" + ViewingLead + "\n");
Triggers.Hotkey["Shift+F2"] = o => { if(dialog.showInput(out PlayerName, "Player viewed when pressing Shift+F1:", editText: PlayerName)) ViewingLead = " " + PlayerName; };

//TURRETS
void setTurrets(){ if(dialog.showInput(out TurretNames, "Set turrets to disable:", editText: TurretNames)) Turrets = Regex.Matches(TurretNames, @"[a-zA-Z][0-9]"); }

Triggers.Hotkey["Shift+F3"] = o => setTurrets();
Triggers.Hotkey["F3"] = o => {
foreach(Match t in Turrets) calmInput(t.Value);
if(Turrets.Count==0) setTurrets();
};
//RADAR-BOOSTER
void setRadars() { if(dialog.showInput(out RadarNames, "Set radar booster name(s):", editText: RadarNames)) Radars = RadarNames.RxSplit(@"\W+"); }

Triggers.Hotkey["Shift+F4"] = o => setRadars();
void runRadars(string command) {
foreach(string r in Radars) calmInput(command + r);
if(Radars.Length==0) setRadars();
}
Triggers.Hotkey["F4"] = o => runRadars("ping ");
Triggers.Hotkey["F5"] = o => runRadars("flash ");

Triggers.Hotkey["Shift+F5"] = o => { foreach(string r in Radars) { calmInput("flash " + r); calmInput("deny"); } };

//SIGNAL TRANSMITTER
Triggers.Hotkey["F6"] = o => keys.sendt($"transmit ");

Triggers.Hotkey["Shift+F6"] = o => keys.send($"Back*36");

//REGULAR COMMANDS
Triggers.Hotkey["F7"] = o => keys.sendt($"scan\n");
Triggers.Hotkey["F8"] = o => keys.sendt($"store\n");
Triggers.Hotkey["F9"] = o => keys.sendt($"moons\n");
Triggers.Hotkey["F10"] = o => keys.sendt($"storage\n");
Triggers.Hotkey["Shift+F10"] = o => keys.sendt($"bestiary\n");

//QUICK ITEM BUY - designed primarily to distract dogs with drop, shortening input to Shift+F8, Enter

void quickBuy(string item){ calmerInput(item); calmerInput("C"); };
Triggers.Hotkey["Shift+F8"] = o => {
if(!dialog.showInput(out string buyX, "Buy single:", editText: "walkie")) return;
ShoppingList = buyX.RxSplit(@"\W+");
for(int i=0; i<ShoppingList.Length; ++i)
if(i+1<ShoppingList.Length && int.TryParse(ShoppingList[i+1], out int amount)) quickBuy(ShoppingList[i] + " " + ShoppingList[++i]);
else quickBuy(ShoppingList[i]);
};

//GO TO COMPANY
Triggers.Hotkey["Shift+F9"] = o => { calmerInput($"company"); keys.sendt("confirm"); };

//FORBIDDEN MACRO (don't use it, it sucks.)
Triggers.Hotkey["Shift+F7"] = o => { for(int i=0; i<26; ++i) for(int j=0; j<10; ++j) calmInput(((char)(i+65)).ToString() + j.ToString()); };

Triggers.Run();
8 commenti
Meinhart S Rohr 9 set 2024, ore 11:34 
what do i need to change so i can use as Hotkeys Numpad1 if i change F1 to Numpad1 it doesnt work
krowsf2 11 mar 2024, ore 18:06 
Here's also the last 4 error lines there are
"LETHAL COMPANY TERMINAL SHORTCUTS.cs(101,37): error CS0103: The name 'keys' does not exist in the current context
LETHAL COMPANY TERMINAL SHORTCUTS.cs(107,6): error CS0103: The name 'dialog' does not exist in the current context
LETHAL COMPANY TERMINAL SHORTCUTS.cs(108,22): error CS1061: 'string' does not contain a definition for 'RxSplit' and no accessible extension method 'RxSplit' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
LETHAL COMPANY TERMINAL SHORTCUTS.cs(115,63): error CS0103: The name 'keys' does not exist in the current context" maybe they updated Libre or something idk
krowsf2 11 mar 2024, ore 17:59 
found a mistake in code thingy idk what it means,
I would add more errors of it but it's too much and over the 1000 characters limit so yeah
"Compilation: 28 errors
LETHAL COMPANY TERMINAL SHORTCUTS.cs(55,1): error CS0246: The type or namespace name 'MatchCollection' could not be found (are you missing a using directive or an assembly reference?)
LETHAL COMPANY TERMINAL SHORTCUTS.cs(55,27): error CS0103: The name 'Regex' does not exist in the current context
LETHAL COMPANY TERMINAL SHORTCUTS.cs(58,30): error CS0103: The name 'keys' does not exist in the current context
LETHAL COMPANY TERMINAL SHORTCUTS.cs(58,47): error CS0103: The name 'keys' does not exist in the current context..."
krowsf2 11 mar 2024, ore 17:43 
My Antivirus hates LibreAutomate
Extramrdo 2 gen 2024, ore 17:08 
limonka while I love typing games, when the game consists 99% of the word "switch", you get a macro.
Kuku  [autore] 2 gen 2024, ore 16:18 
@Extramrdo Fixed. I forgot to put noparse on the script and part of it was interpreted as formatting instructions.
Limonka 2 gen 2024, ore 8:59 
never thought anyone would have that bad of an attention span to macro typing
Extramrdo 1 gen 2024, ore 19:48 
Copied it from the text above rather than downloading the file.

Compilation: 1 errors
LethalCompany Terminal Shortcuts.cs(111,36): error CS1503: Argument 1: cannot convert from 'string[]' to 'string'

It's the line in quickBuy after the else. Changing quickBuy(ShoppingList); to quickBuy(ShoppingList + ""); forces it to convert the list to a flat string.