Hey guys, I'm new here and I'm pretty excited about finding this for Windows Live, auto responders and stuff are so cool
I'm trying to write a simple log in script so that I will eventually be able to send commands to my computer over Windows Live, but I've hit a small roadblock.
I have a global variable named admin, that will hold the user name of the person who is logged in as the admin and can execute command, this is what I have so far:
code:
var admin = String("");
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
switch (Message) {
case ".hello":
if (MsgPlus.RemoveFormatCodes(Origin) == admin) {
ChatWnd.SendMessage("Hello ");
ChatWnd.SendMessage("/close");
} else {
ChatWnd.SendMessage("You are not an admin! Admin:" + admin);
ChatWnd.SendMessage("/close");
}
case ".login":
admin = MsgPlus.RemoveFormatCodes(Origin);
ChatWnd.SendMessage("Password accepted admin:" + admin);
ChatWnd.SendMessage("/close");
case ".logout":
admin="";
}
}
My problem is that when the '.login' command is executed the value 'Origin' gets put into the admin variable fine, but then when the function ends admin no longer contains any data. Any ideas? I am a fluent AutoIt coder and a semi fluent C/C++ coder, but I have never used Js or Java before..
Thanks guys