Skip to content

Commit b968b13

Browse files
committed
Commit for release 1.5
1 parent fed4969 commit b968b13

File tree

2 files changed

+80
-53
lines changed

2 files changed

+80
-53
lines changed

TemplateMod/Commands.cs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static bool AddIRCMessage(Hacknet.OS os, string[] args)
154154
string author = args[2];
155155
string message = args[3];
156156

157-
if (args.Length < 5)
157+
if (args.Length < 3)
158158
{
159159
os.write("Usage: addIRCMessage (ComputerID) (Author) (Message)");
160160
return false;
@@ -300,7 +300,7 @@ public static bool GenerateExampleMedicalRecord(Hacknet.OS os, string[] args)
300300
{
301301
Computer computer = os.thisComputer;
302302
Folder folder = os.thisComputer.files.root.searchForFolder("home");
303-
string File = "FIRST NAME HERE\n--------------------\nLAST NAME HERE\n--------------------\n male OR female\n--------------------\nDATE OF BIRTH HERE TIME OF BIRTH HERE\n--------------------\nMedical Record\nDate of Birth :: DATE OF BIRTH HERE TIME OF BIRTH HERE\nBlood Type :: BLOOD TYPE HERE\nHeight :: HEIGHT HERE IN CM\n Allergies\nActive Prescriptions :: ACTIVE PRESCRIPTSION HERE\nRecorded Visits :: RECORDED VISTS HERE\nNotes :: NOTES HERE";
303+
string File = "FIRST NAME HERE\n--------------------\nLAST NAME HERE\n--------------------\nmale OR female\n--------------------\nDATE OF BIRTH HERE TIME OF BIRTH HERE\n--------------------\nMedical Record\nDate of Birth :: DATE OF BIRTH HERE TIME OF BIRTH HERE\nBlood Type :: BLOOD TYPE HERE\nHeight :: HEIGHT HERE IN CM\n Allergies :: ALLERGIES HERE\nActive Prescriptions :: ACTIVE PRESCRIPTSION HERE\nRecorded Visits :: RECORDED VISTS HERE\nNotes :: NOTES HERE";
304304
folder.files.Add(new FileEntry(File, "LASTNAMEHERE FIRSTNAMEHERE"));
305305
return false;
306306
}
@@ -321,13 +321,13 @@ public static bool DeleteWhitelistDLL(Hacknet.OS os, string[] args)
321321
List<int> FolderPath = new List<int>();
322322
FolderPath.Add(5);
323323
Folder folder = computer.files.root.searchForFolder("Whitelist");
324-
folder.files.Remove(folder.files[1]);
324+
folder.files.Remove(folder.files[0]);
325325
return false;
326326
}
327327
public static bool ChangeMusic(Hacknet.OS os, string[] args)
328328
{
329329
string song = args[1];
330-
MusicManager.playSongImmediatley("Content/" + song);
330+
MusicManager.playSongImmediatley("Content\\" + song);
331331
return false;
332332
}
333333
public static bool CrashComputer(Hacknet.OS os, string[] args)
@@ -447,7 +447,7 @@ public static bool CloseAllPorts(Hacknet.OS os, string[] args)
447447
public static bool ClosePort(Hacknet.OS os, string[] args)
448448
{
449449
Computer computer = os.connectedComp;
450-
if (args.Length > 1)
450+
if (args.Length < 1)
451451
{
452452
os.write("Usage: closePort (PortToClose)");
453453
return false;
@@ -491,6 +491,25 @@ public static bool AddComputer(Hacknet.OS os, string[] args)
491491
string ID = args[5];
492492
Computer computer = new Computer(Name, IP, os.netMap.getRandomPosition(), SecurityLevel, CompType, os);
493493
computer.idName = ID;
494+
os.netMap.nodes.Add(computer); // If you are adding a new computer, you must add the object to nodes list
495+
return false;
496+
}
497+
public static bool DefineComputer(Hacknet.OS os, string[] args)
498+
{
499+
Computer computer = Programs.getComputer(os, args[1]);
500+
string Action = args[2];
501+
string ActionArgs = args[3];
502+
503+
if (Action == "tracetime")
504+
{
505+
float TraceTime;
506+
float.TryParse(ActionArgs, out TraceTime);
507+
computer.traceTime = TraceTime;
508+
} else if (Action == "isadminsuper"){
509+
bool TrueOrFalse;
510+
bool.TryParse(ActionArgs, out TrueOrFalse);
511+
computer.admin.IsSuper = TrueOrFalse ? true : false;
512+
}
494513
return false;
495514
}
496515
public static bool PlaySFX(Hacknet.OS os, string[] args)
@@ -542,10 +561,6 @@ public static bool OxygencraftStorageFaciltyCache(Hacknet.OS os, string[] args)
542561
computer.addProxy(3600);
543562
computer.HasTracker = true;
544563
computer.traceTime = 45f;
545-
computer.ports.Add(25);
546-
computer.ports.Add(22);
547-
computer.ports.Add(21);
548-
computer.ports.Add(80);
549564
computer.ports.Add(1433);
550565
computer.ports.Add(104);
551566
computer.ports.Add(3724);
@@ -600,6 +615,7 @@ public static bool OxygencraftStorageFaciltyCache(Hacknet.OS os, string[] args)
600615
bin.files.Add(new FileEntry(PortExploits.DangerousPacemakerFirmware, Utils.GetNonRepeatingFilename("PacemakerDangerous", ".dll", bin)));
601616
bin.files.Add(new FileEntry(PortExploits.ValidPacemakerFirmware, Utils.GetNonRepeatingFilename("PacemakerWorking", ".exe", bin)));
602617
bin.files.Add(new FileEntry(PortExploits.ValidAircraftOperatingDLL, Utils.GetNonRepeatingFilename("747FlightSystem", ".dll", bin)));
618+
os.netMap.nodes.Add(computer);
603619
return false;
604620
}
605621
public static bool DisableEmailIcon(Hacknet.OS os, string[] args)
@@ -627,8 +643,9 @@ public static bool WhitelistBypass(Hacknet.OS os, string[] args)
627643
{
628644
Computer computer = Programs.getComputer(os, args[1]);
629645
Folder folder = computer.files.root.searchForFolder("Whitelist");
630-
folder.files.Remove(folder.files[2]);
646+
folder.files.Remove(folder.files[1]);
631647
folder.files.Add(new FileEntry(os.thisComputer.ip, "list.txt"));
648+
os.execute("connect " + computer.ip);
632649
return false;
633650
}
634651
}

TemplateMod/OpenAllPortsMod.cs

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using Command = Pathfinder.Command;
33

4-
54
namespace OpenAllPortsMod
65
{
76
public class OpenAllPortsMod : Pathfinder.PathfinderMod
@@ -19,50 +18,61 @@ public override void Load()
1918
public override void LoadContent()
2019
{
2120
bool DebugEnabled = true;
22-
Command.Handler.AddCommand("openAllPorts", Commands.OpenAllPorts, true);
23-
Command.Handler.AddCommand("bypassProxy", Commands.BypassProxy, true);
24-
Command.Handler.AddCommand("solveFirewall", Commands.SolveFirewall, true);
25-
Command.Handler.AddCommand("getAdmin", Commands.GetAdmin, true);
26-
Command.Handler.AddCommand("loseAdmin", Commands.LoseAdmin, true);
21+
Command.Handler.AddCommand("openAllPorts", Commands.OpenAllPorts, true); // Works
22+
Command.Handler.AddCommand("bypassProxy", Commands.BypassProxy, true); // Works
23+
Command.Handler.AddCommand("solveFirewall", Commands.SolveFirewall, true); // Works
24+
Command.Handler.AddCommand("getAdmin", Commands.GetAdmin, true); // Works
25+
Command.Handler.AddCommand("loseAdmin", Commands.LoseAdmin, true); // Works
2726
if (DebugEnabled)
2827
{
29-
Command.Handler.AddCommand("startDeathSeq", Commands.DeathSeq, false);
30-
Command.Handler.AddCommand("cancelDeathSeq", Commands.CancelDeathSeq, false);
31-
Command.Handler.AddCommand("setHomeNodeServer", Commands.SetHomeNodeServer, false);
32-
Command.Handler.AddCommand("setHomeAssetServer", Commands.SetHomeAssetServer, false);
33-
Command.Handler.AddCommand("debug", Commands.Debug, false);
34-
Command.Handler.AddCommand("revealAll", Commands.RevealAll, false);
35-
Command.Handler.AddCommand("addIRCMessage", Commands.AddIRCMessage, false);
36-
Command.Handler.AddCommand("strikerAttack", Commands.StrikerAttack, false);
37-
Command.Handler.AddCommand("themeAttack", Commands.ThemeAttack, false);
38-
Command.Handler.AddCommand("callThePoliceSoTheyCanTraceYou", Commands.CallThePoliceSoTheyCanTraceYou, false);
39-
Command.Handler.AddCommand("reportYourselfToFBI", Commands.ReportYourselfToFBI, false);
40-
Command.Handler.AddCommand("traceYourselfIn", Commands.TraceYourselfIn, false);
41-
Command.Handler.AddCommand("warningFlash", Commands.WarningFlash, false);
42-
Command.Handler.AddCommand("stopTrace", Commands.StopTrace, false);
43-
Command.Handler.AddCommand("hideDisplay", Commands.HideDisplay, false);
44-
Command.Handler.AddCommand("hideNetMap", Commands.HideNetMap, false);
45-
Command.Handler.AddCommand("hideTerminal", Commands.HideTerminal, false);
46-
Command.Handler.AddCommand("hideRAM", Commands.HideRAM, false);
47-
Command.Handler.AddCommand("showDisplay", Commands.ShowDisplay, false);
48-
Command.Handler.AddCommand("showNetMap", Commands.ShowNetMap, false);
49-
Command.Handler.AddCommand("showTerminal", Commands.ShowTerminal, false);
50-
Command.Handler.AddCommand("showRAM", Commands.ShowRAM, false);
51-
Command.Handler.AddCommand("getUniversalAdmin", Commands.GetUniversalAdmin, false);
52-
Command.Handler.AddCommand("changeUserDetails", Commands.ChangeUserDetails, false);
53-
Command.Handler.AddCommand("executeHack", Commands.ExecuteHack, false);
54-
Command.Handler.AddCommand("generateExampleAcademicRecord", Commands.GenerateExampleAcadmicRecord, false);
55-
Command.Handler.AddCommand("generateExampleMedicalRecord", Commands.GenerateExampleMedicalRecord, false);
56-
Command.Handler.AddCommand("changeMusic", Commands.ChangeMusic, false);
57-
Command.Handler.AddCommand("crashComputer", Commands.CrashComputer, false);
58-
Command.Handler.AddCommand("addProxy", Commands.AddProxy, false);
59-
Command.Handler.AddCommand("addFirewall", Commands.AddFirewall, false);
60-
Command.Handler.AddCommand("addUser", Commands.AddUser, false);
61-
Command.Handler.AddCommand("openPort", Commands.OpenPort, false);
62-
Command.Handler.AddCommand("closeAllPorts", Commands.CloseAllPorts, false);
63-
Command.Handler.AddCommand("closePort", Commands.ClosePort, false);
64-
Command.Handler.AddCommand("removeProxy", Commands.RemoveProxy, false);
65-
Command.Handler.AddCommand("playSFX", Commands.PlaySFX, false);
28+
Command.Handler.AddCommand("startDeathSeq", Commands.DeathSeq, false); // Works
29+
Command.Handler.AddCommand("cancelDeathSeq", Commands.CancelDeathSeq, false); // Works
30+
Command.Handler.AddCommand("setHomeNodeServer", Commands.SetHomeNodeServer, false); // Works
31+
Command.Handler.AddCommand("setHomeAssetServer", Commands.SetHomeAssetServer, false); // Works
32+
Command.Handler.AddCommand("debug", Commands.Debug, false); // Works
33+
Command.Handler.AddCommand("revealAll", Commands.RevealAll, false); // Works
34+
Command.Handler.AddCommand("addIRCMessage", Commands.AddIRCMessage, false); // Works
35+
Command.Handler.AddCommand("strikerAttack", Commands.StrikerAttack, false); // Works
36+
Command.Handler.AddCommand("themeAttack", Commands.ThemeAttack, false); // Works
37+
Command.Handler.AddCommand("callThePoliceSoTheyCanTraceYou", Commands.CallThePoliceSoTheyCanTraceYou, false); // Works
38+
Command.Handler.AddCommand("reportYourselfToFBI", Commands.ReportYourselfToFBI, false); // Works
39+
Command.Handler.AddCommand("traceYourselfIn", Commands.TraceYourselfIn, false); // Works
40+
Command.Handler.AddCommand("warningFlash", Commands.WarningFlash, false); // Works
41+
Command.Handler.AddCommand("stopTrace", Commands.StopTrace, false); // Works
42+
Command.Handler.AddCommand("hideDisplay", Commands.HideDisplay, false); // Works
43+
Command.Handler.AddCommand("hideNetMap", Commands.HideNetMap, false); // Works
44+
Command.Handler.AddCommand("hideTerminal", Commands.HideTerminal, false); // Works
45+
Command.Handler.AddCommand("hideRAM", Commands.HideRAM, false); // Works
46+
Command.Handler.AddCommand("showDisplay", Commands.ShowDisplay, false); // Works
47+
Command.Handler.AddCommand("showNetMap", Commands.ShowNetMap, false); // Works
48+
Command.Handler.AddCommand("showTerminal", Commands.ShowTerminal, false); // Unknown
49+
Command.Handler.AddCommand("showRAM", Commands.ShowRAM, false); // Works
50+
Command.Handler.AddCommand("getUniversalAdmin", Commands.GetUniversalAdmin, false); // Works
51+
Command.Handler.AddCommand("changeUserDetails", Commands.ChangeUserDetails, false); // Partial
52+
//Command.Handler.AddCommand("executeHack", Commands.ExecuteHack, false);
53+
Command.Handler.AddCommand("generateExampleAcademicRecord", Commands.GenerateExampleAcadmicRecord, false); // Works
54+
Command.Handler.AddCommand("generateExampleMedicalRecord", Commands.GenerateExampleMedicalRecord, false); // Fixed
55+
//Command.Handler.AddCommand("changeMusic", Commands.ChangeMusic, false); // Fixed
56+
Command.Handler.AddCommand("crashComputer", Commands.CrashComputer, false); // Works
57+
Command.Handler.AddCommand("addProxy", Commands.AddProxy, false); // Works
58+
Command.Handler.AddCommand("addFirewall", Commands.AddFirewall, false); // Works
59+
Command.Handler.AddCommand("addUser", Commands.AddUser, false); // Works
60+
//Command.Handler.AddCommand("openPort", Commands.OpenPort, false);
61+
Command.Handler.AddCommand("closeAllPorts", Commands.CloseAllPorts, false); // Works
62+
Command.Handler.AddCommand("closePort", Commands.ClosePort, false); // Fixed
63+
Command.Handler.AddCommand("removeProxy", Commands.RemoveProxy, false); // Works
64+
Command.Handler.AddCommand("playSFX", Commands.PlaySFX, false); // Works
65+
Command.Handler.AddCommand("DeleteWhitelistDLL", Commands.DeleteWhitelistDLL, false); // Works
66+
Command.Handler.AddCommand("addComputer", Commands.AddComputer, false); // Works
67+
Command.Handler.AddCommand("getMoreRAM", Commands.GetMoreRAM, false); // Works
68+
Command.Handler.AddCommand("setFaction", Commands.SetFaction, false); // Works
69+
Command.Handler.AddCommand("tracedBehind250Proxies", Commands.TracedBehind250Proxies, false); // Works
70+
Command.Handler.AddCommand("oxygencraftStorageFacilityCache", Commands.OxygencraftStorageFaciltyCache, false); // Don't tell anyone about this command, keep it a secret
71+
Command.Handler.AddCommand("disableEmailIcon", Commands.DisableEmailIcon, false); // Works
72+
Command.Handler.AddCommand("enableEmailIcon", Commands.EnableEmailIcon, false); // Works
73+
Command.Handler.AddCommand("nodeRestore", Commands.NodeRestore, false); // Unknown
74+
Command.Handler.AddCommand("addWhiteCircle", Commands.AddRestoreCircle, false); // Works
75+
Command.Handler.AddCommand("whitelistBypass", Commands.WhitelistBypass, false);
6676
}
6777

6878
}

0 commit comments

Comments
 (0)