Code:
var readline = require('readline');
var request = require('request');
var net = require('net');
var IP = "75.126.77.10", Password = "", Email = "", strToken = "";
var playerID = 0, MASID = 0, port = 843;
var client = new net.Socket();
LetsLogin("Your Email / Username", "Your Password");
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function ConnectOS() {
LetsConnect();
client.on('data', function (data) {
console.log('[RECEIVED]: ' + data);
handlePackets(data);
});
ConnectAgain();
}
function LetsConnect() {
clien*****nnect(port, IP, function () {
console.log('Connected To ' + IP + ":" + port + "\n");
sendPacket("<policy-file-request/>");
});
}
function LetsClose() {
client.on('close', function () {
client.destroy();
console.log('Connection closed');
process.exit(1);
});
}
function ConnectAgain() {
client.on('close', function () {
client.destroy();
console.log('Connection closed');
LetsConnect();
});
}
function sendPacket(data) {
var NewData = data.toString();
var Packet = NewData + "\x00";
client.write(Packet);
console.log("[SENT]: " + Packet + "\n")
}
function handlePackets(packet) {
if (checkString(packet, "<cross-domain-policy>")) {
sendPacket('{"Token":"' + strToken + '","id":' + playerID + ',"type":"login"}');
} else if (checkString(packet, 'status":1')) {
rl.question("", function (answer) {
if (checkUIn(answer, "chatspam")) {
console.log("Simple Chat Spam.");
var i = 0, spam = 100;
while (i < spam) {
sendPacket('{"type":"chat","cmd":"m","senderName":"Troll","roomID":2,"body":"Why So Mad?"}');
sendPacket('{"type":"chat","cmd":"m","senderName":"Troll","roomID":2,"body":"Sux?"}');
sendPacket('{"type":"chat","cmd":"m","senderName":"Troll","roomID":2,"body":"ME?"}');
i++;
}
} else if (checkUIn(answer, "quit")) {
rl.close();
console.log("closed input.");
LetsClose();
} else if (checkUIn(answer, "battle")) {
console.log("Starting A Battle");
sendPacket('{"body":55,"type":"join","cmd":"region"}');
}
});
}
}
function checkUIn(answer, data) {
return answer === data;
}
function checkString(packet, strings) {
var Data = packet.toString();
return Data.indexOf(strings) > -1;
}
function LetsLogin(Emails, password) {
Password = password.toString();
Email = Emails.toString();
console.log("Email: " + Email);
console.log("Password: " + Password);
request.post({url:'https://oversoul.arti*****m/web/AccountLoad.aspx',
headers: {
'Host': 'oversoul.arti*****m',
'Origin': 'https://oversoulcdn.arti*****m',
'Referer': 'https://oversoulcdn.arti*****m/game/OSGame0_9_4d21.swf',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36',
'X-Requested-With': 'ShockwaveFlash/18.0.0.209',
'Content-Type': 'application/x-www-form-urlencoded'},
json: {
strPassword: password.toString(),
strUsername: Emails.toString()
}},
function(err,httpResponse,body){
if (body.toString().indexOf("Ok")) {
playerID = body['playerID'];
MASID = body['MASID'];
strToken = body['strToken'];
ConnectOS();
}
});
}
Enjoy nothing is impossible just keep that in mind.