quote:
Originally posted by Matti
Now that is very strange!
Could you please post your complete code here, preferably in [code]...[/code] tags?
Sure thing.
Bear in mind it's only basic at the moment and very insecure
There probably has been a major oversight on my part, the script is being hacked together with guesses of how Jscript works when I don't have the code from that tutorial
When I run a message through the script:
code:
Script is starting
Script is now loaded and ready
Function called: OnEvent_ChatWndSendMessage
1
jscript code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
for(var e = new Enumerator(ChatWnd.Contacts);!e.atEnd();e.moveNext()){
rEmail = (e.item().Email);
}
// return Email;
// ^ use to echo contacts email address
// return Messenger.MyName;
// ^ use to echo current users name
if(Message.substr(0, 2) === "+1") {
var name = Messenger.MyName;
var gEmail = Messenger.MyEmail;
var rMessage = (name + ' has rewarded you with a +1!');
// database call
var url = "http://plusone.samryan.co.uk/test.php";
var data = ('rEmail= ' + rEmail + '&gEmail=' + gEmail);
Interop.Call("wininet.dll", "DeleteUrlCacheEntryW", url);
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", url, true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", data.length);
xmlhttp.send(data);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4)
if (xmlhttp.status == 200) {
// Data from URL was retrieved successfully
// Data is saved in the variable xmlhttp.responseText
} else {
// The server returned an HTTP code other than 200
}
}
// end database call
return xmlhttp.responseText;
// else
}else{
return Message;
}
Debug.Trace(xmlhttp.readyState);
// ending of script
}