-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcod4stats.wsf
35 lines (26 loc) · 975 Bytes
/
cod4stats.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<package id = "cod4stats">
<job id = "main">
<script type="text/javascript">
var cod4StatsURL = "http://theblog.de/wp-content/themes/responsive/cod4stats/update.php";
var cod4CDKey = ""; //first 16 chars
var cod4MpdataPath = "C:\\games\\cod4\\players\\profiles\\OGC";
var pw = "test";
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("cod4stats.exe "+cod4MpdataPath+"\\mpdata "+cod4CDKey);
var input = "";
while (oExec.Status == 0)
{
input = oExec.StdOut.ReadAll();
WScript.sleep(100);
}
var stats = input.split("\n");
var kills = parseInt(stats[0], 16);
var deaths = parseInt(stats[1], 16);
var dt = Math.round(new Date().getTime()/1000);
var objXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
//update stats
objXMLHTTP.open("GET", cod4StatsURL+"?kills="+kills+"&deaths="+deaths+"&pw="+pw+"&date="+dt, false);
objXMLHTTP.send();
</script>
</job>
</package>