Created
February 11, 2012 12:31
-
-
Save e-jigsaw/1799206 to your computer and use it in GitHub Desktop.
Skype bot a.k.a. ukeip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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