/*
based off of a creation By: Jamjardavies
*/
// Settings to change!
string IPList = "iIPList"; // This is your list of IPs
string logs = "system.logs";
//end of settings
//DO NOT EDIT (based for non donators)
string newcontent(string file, string text) {
string a = readFile(file);
int b = strlen(a);
int c = strlen(text);
if (c+b >= 60000) {
string e = ""+text+""+a+"";
string f = substr(e, 0, 60000);
writeFile(file, f);
string q = strlen(readFile(logs));
message(getSourceIP(), q);
} else {
string content = ""+text+"<br>"+a+"";
writeFile(file, content);
}
}
int main()
{
string vIP = getTargetIP();
string b = getTargetPort();
string c = getPort();
int size = countLines(IPList);
int i = 0;
string Player[];
Player[0] = vIP;
Player[1] = "Unknown name";
Player[2] = "Unknown type";
while(i < size)
{
if(indexOf(readLine(IPList, i), vIP, 0) >= 0)
{
spl(Player, readLine(IPList, i), " <-- ");
i = size;
}
i++;
}
//END OF DO NOT EDIT
logMessage("Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+"");
string sub=substr(vIP, 0, 7);
if (sub != "900.800") { // they an NPC????, if not then ill tell you.
sendEmail("("+getDate()+" "+getTime()+") Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+"");
}
newcontent(logs, "("+getDate()+" "+getTime()+") Your were attacked by "+Player[1]+"(" + vIP + ") they hit port "+c+" using port "+b+"<br>");
}
//AGAIN DO NOT EDIT BELOW
void spl(string arr[], string inString, string charSplit)
{
string tString = inString;
int delimLen = strlen(charSplit);
int i = 0;
int x = 0;
while(indexOf(tString, charSplit, 0) > 0)
{
i = indexOf(tString, charSplit, 0);
arr[x] = substr(tString, 0, i);
tString = substr(tString, i + delimLen, strlen(tString));
x++;
}
arr[x] = tString;
}