Free AutoLock script

LaserBeam

New Member
Sep 17, 2023
1
0
1
Here is a free auto lock script.

Installation:
turn your computer on, log into your account, open terminal.
create a new file, enter "file create AutoLock.msc", then copy and paste this code into the file and press save.
now lets compile the code, enter "mnscript compile AutoLock.msc AutoLock", to execute the code, enter "mnscript exec AutoLock.mscx"
a new application will appear on your desktop, enter "gui" to exit terminal, left click on the application to run it, grant admin rights.

change string ownerid to your own steamid.
change string walletid to your own VentzCoin wallet id or leave empty.



using Application;
using Console;
using Event;
using Firewall;
using Math;
using Peripheral;
using Player;
using String;
using System;
using VentzCoin;

Application.CreateDesktopIcon("https://i.ibb.co/mqW8SB8/lockimage.jpg");

Application.RequestAdminPrivilege();

string ownerid = "STEAM_0:0:707443237";
string userid = System.GetUserSteamID();
string walletid = "";

function OnPlayerStartedUsing(Player ply) {
if (userid != ownerid) {
Console.WriteLine("System lockdown. Intruder: "..ply);
System.Lock();
}
}
Event.AddListener("PlayerStartedUsing", "using", "OnPlayerStartedUsing");

function OnPlayerStoppedUsing(Player ply) {
Console.WriteLine(ply.GetName().." has stopped using the terminal.");
System.Lock();
}
Event.AddListener("PlayerStoppedUsing", "using", "OnPlayerStoppedUsing");

function OnConsoleCommand(string command){
if (userid != ownerid) {
System.RunCommand("cls");
Console.WriteLine("Critical unauthorized access.");
System.Shutdown();
}
}
Event.AddListener("ConsoleCommand", "input", "OnConsoleCommand");

function OnVCMinerStarted(VCMiner miner){
Console.WriteLine("A VCMiner was started!");
System.RunCommand("vcmine set_wallet "..walletid);
}
Event.AddListener("VCMinerStarted", "vcminer_stopped", "OnVCMinerStarted");

function OnVCMinerWalletChanged(VCMiner miner, string newWallet, bool isWalletValid){
Console.WriteLine("A VCMiner wallet changed.");
System.RunCommand("vcmine set_wallet "..walletid);
}
Event.AddListener("VCMinerWalletChanged", "vcminer_stopped", "OnVCMinerWalletChanged");

// Firewall:
string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_";

function<string> getRandomString(number len, string charList)
{
string pass;
while(String.Length(pass) <= len)
{
pass = pass .. String.CharAt(charList, Math.RandomRange(1, String.Length(charList)));
}
return pass;
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);
System.RunCommand("router settings admin_password "..randomPass);
System.RunCommand("router login "..randomPass);
System.RunCommand("router settings hide_terminals true");
System.RunCommand("router settings firewall_enabled true");
System.RunCommand("firewall enable");
System.RunCommand("router firewall block MN_PROTOCOL_REMOTE");
System.RunCommand("router firewall block MN_PROTOCOL_REMOTE_ATTEMPT");
System.RunCommand("router firewall block MN_PROTOCOL_MESSAGE");
System.RunCommand("router firewall block MN_PROTOCOL_MANAGER_SCAN");

while(true) {

if (System.HasPeripheral("unlocker")) {
System.RunCommand("cls");
Console.WriteLine("Critical unauthorized access.");
System.Shutdown();
}

Event.Process();
}
 
Last edited: