2017-02-28 22:20:37 +01:00
|
|
|
/* Create programs */
|
2017-04-11 22:42:06 +02:00
|
|
|
Programs = {
|
2017-05-24 23:35:24 +02:00
|
|
|
NukeProgram: "NUKE.exe",
|
|
|
|
BruteSSHProgram: "BruteSSH.exe",
|
|
|
|
FTPCrackProgram: "FTPCrack.exe",
|
|
|
|
RelaySMTPProgram: "relaySMTP.exe",
|
|
|
|
HTTPWormProgram: "HTTPWorm.exe",
|
|
|
|
SQLInjectProgram: "SQLInject.exe",
|
|
|
|
DeepscanV1: "DeepscanV1.exe",
|
|
|
|
DeepscanV2: "DeepscanV2.exe",
|
2017-04-11 22:42:06 +02:00
|
|
|
}
|
|
|
|
|
2017-04-19 23:39:25 +02:00
|
|
|
//TODO Right now the times needed to complete work are hard-coded...
|
|
|
|
//maybe later make this dependent on hacking level or something
|
2017-02-28 22:20:37 +01:00
|
|
|
function displayCreateProgramContent() {
|
2017-05-08 16:33:26 +02:00
|
|
|
var nukeALink = document.getElementById("create-program-nuke");
|
2017-03-31 14:32:04 +02:00
|
|
|
var bruteSshALink = document.getElementById("create-program-brutessh");
|
|
|
|
var ftpCrackALink = document.getElementById("create-program-ftpcrack");
|
|
|
|
var relaySmtpALink = document.getElementById("create-program-relaysmtp");
|
|
|
|
var httpWormALink = document.getElementById("create-program-httpworm");
|
|
|
|
var sqlInjectALink = document.getElementById("create-program-sqlinject");
|
2017-05-24 23:35:24 +02:00
|
|
|
var deepscanv1ALink = document.getElementById("create-program-deepscanv1");
|
|
|
|
var deepscanv2ALink = document.getElementById("create-program-deepscanv2");
|
2017-03-31 14:32:04 +02:00
|
|
|
|
2017-05-08 16:33:26 +02:00
|
|
|
nukeALink.style.display = "none";
|
2017-03-31 14:32:04 +02:00
|
|
|
bruteSshALink.style.display = "none";
|
|
|
|
ftpCrackALink.style.display = "none";
|
|
|
|
relaySmtpALink.style.display = "none";
|
|
|
|
httpWormALink.style.display = "none";
|
|
|
|
sqlInjectALink.style.display = "none";
|
2017-05-24 23:35:24 +02:00
|
|
|
deepscanv1ALink.style.display = "none";
|
|
|
|
deepscanv2ALink.style.display = "none";
|
2017-05-05 20:13:31 +02:00
|
|
|
|
2017-05-11 06:20:17 +02:00
|
|
|
//NUKE.exe (in case you delete it lol)
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.NukeProgram) == -1) {
|
2017-05-23 21:26:52 +02:00
|
|
|
nukeALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
//BruteSSH
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.BruteSSHProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 50) {
|
2017-05-23 21:26:52 +02:00
|
|
|
bruteSshALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
//FTPCrack
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.FTPCrackProgram) == -1 &&
|
2017-05-02 19:06:46 +02:00
|
|
|
Player.hacking_skill >= 100) {
|
2017-05-23 21:26:52 +02:00
|
|
|
ftpCrackALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
//relaySMTP
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.RelaySMTPProgram) == -1 &&
|
2017-05-02 19:06:46 +02:00
|
|
|
Player.hacking_skill >= 250) {
|
2017-05-23 21:26:52 +02:00
|
|
|
relaySmtpALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
//HTTPWorm
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.HTTPWormProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 500) {
|
2017-05-23 21:26:52 +02:00
|
|
|
httpWormALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
//SQLInject
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.SQLInjectProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 750) {
|
2017-05-23 21:26:52 +02:00
|
|
|
sqlInjectALink.style.display = "inline-block";
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-05-24 23:35:24 +02:00
|
|
|
//Deepscan V1 and V2
|
|
|
|
if (!Player.hasProgram(Programs.DeepscanV1) && Player.hacking_skill >= 75) {
|
|
|
|
deepscanv1ALink.style.display = "inline-block";
|
|
|
|
}
|
|
|
|
if (!Player.hasProgram(Programs.DeepscanV2) && Player.hacking_skill >= 400) {
|
|
|
|
deepscanv2ALink.style.display = "inline-block";
|
|
|
|
}
|
2017-05-05 18:52:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//Returns the number of programs that are currently available to be created
|
|
|
|
function getNumAvailableCreateProgram() {
|
|
|
|
var count = 0;
|
|
|
|
|
|
|
|
//PortHack.exe (in case you delete it lol)
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.NukeProgram) == -1) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
//BruteSSH
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.BruteSSHProgram) == -1 &&
|
|
|
|
Player.hacking_skill >= 50) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
//FTPCrack
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.FTPCrackProgram) == -1 &&
|
|
|
|
Player.hacking_skill >= 100) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
//relaySMTP
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.RelaySMTPProgram) == -1 &&
|
|
|
|
Player.hacking_skill >= 250) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
//HTTPWorm
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.HTTPWormProgram) == -1 &&
|
|
|
|
Player.hacking_skill >= 500) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
//SQLInject
|
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.SQLInjectProgram) == -1 &&
|
|
|
|
Player.hacking_skill >= 750) {
|
|
|
|
++count;
|
|
|
|
}
|
2017-05-24 23:35:24 +02:00
|
|
|
|
|
|
|
//Deepscan V1 and V2
|
|
|
|
if (!Player.hasProgram(Programs.DeepscanV1) && Player.hacking_skill >= 75) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Player.hasProgram(Programs.DeepscanV2) && Player.hacking_skill >= 400) {
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
2017-05-05 18:52:48 +02:00
|
|
|
return count;
|
2017-02-28 22:20:37 +01:00
|
|
|
}
|