Scan watch with names by Tresh

From Hack Wars Wiki

Jump to: navigation, search
Information for the Editing Scan watch with names Script
Script Editing Scan watch with names
API Watch
Cost $355
Level 1 Watch
CPU Usage 5
Description This script does the same thing as this one, but it's a bit easier to understand (I think).

If you want to use this as a Health Watch, you will only need to make a few simple changes. (I'm using this for my site too, for instance).

Output N/A


First of all, your IP List will need to have this format (Of course, this is editable):

900.800.6.500:1337 Hacker:
IP : Name :
Note the : after both


void log(string msg) {logMessage(msg);} 
void msg(string ip, string msg) {message(ip, msg);} 
int main(){
 
    string scannerip = getTargetIP();
    string list = "YourFileNameHere";
 
    string split1[];
    split1 = split(readFile(list),scannerip);
    string split1b = split1[1];
 
if (length(split1) == 1) //IP UNKNOWN
{
    msg(scannerip,scannerip + ", your actions are being logged, you might want to stop it.");
    log("[" + scannerip + "]     scanned you!!");
}
 
else
{
    string split2[];
    split2 = split(split1b,":");
    string scannername = split2[1];   
 
    msg(scannerip,scannername + ", your actions are being logged, you might want to stop it.");
    log("[" + scannerip + "]     scanned you!! [" + scannername + "]");
 
}
}


I'll explain it a bit.

These are custom functions, so you don't have to pay more than once for a function you use a lot.

void log(string msg) {logMessage(msg);} 
void msg(string ip, string msg) {message(ip, msg);} 
int main(){


Same thing for getTargetIP(); Don't forget to change the file name.

string scannerip = getTargetIP();
    string list = "YourFileNameHere";


Here's the first split; It chops the file in two, using the IP as the argument. Now you have an array with a string that has everything before the ip, and a string that has everything AFTER the IP.

string split1[];
    split1 = split(readFile(list),scannerip);
    string split1b = split1[1];


lenght(); checks how many strings does the array have. If it's only one, then the IP wasn't found. If it has 2, the ip was found. If it has 3 or more, you have a duplicated IP.

if (length(split1) == 1) //IP UNKNOWN
{
    msg(scannerip,scannerip + ", your actions are being logged, you might want to stop it.");
    log("[" + scannerip + "]     scanned you!!");
}
 
else
{
    string split2[];
    split2 = split(split1b,":");
    string scannername = split2[1];   
 
    msg(scannerip,scannername + ", your actions are being logged, you might want to stop it.");
    log("[" + scannerip + "]     scanned you!! [" + scannername + "]");
 
}
}


If you want to change the way you list IPs, just change the : in

string split2[];
    split2 = split(split1b,":");
    string scannername = split2[1];

for whatever symbol you want. Check the Split() function for more data.

Hope you guys like it. Thanks to aoi222 for the help in creating this.

Personal tools