Skip to content

Instantly share code, notes, and snippets.

@e-jigsaw
Created February 11, 2012 12:31
Show Gist options
  • Save e-jigsaw/1799206 to your computer and use it in GitHub Desktop.
Save e-jigsaw/1799206 to your computer and use it in GitHub Desktop.
Skype bot a.k.a. ukeip
var skype = new ActiveXObject("Skype4COM.Skype");
WScript.ConnectObject(skype, "Skype_");
skype.Attach();
while(true){
WScript.Sleep(1000);
}
function Skype_MessageStatus(msg, status){
if(status == skype.Convert.TextToChatMessageStatus("RECEIVED")){
var chat = msg.Chat;
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
var uri = "Bot's URL here!";
var d = new Date();
xmlhttp.open("GET", uri+parseInt(d/1000));
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
chat.SendMessage(xmlhttp.responseText);
}
}
xmlhttp.send(null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment