Hey guys!
I have a script, which makes reminder in toast. It is working if you write:
/reminder <minutes> <message> to any conversion window.
But my question is:
Is it possiblie, to write to the script, to not tell it to Toast, tell it to conversion window, and the input could be given from else?
For example, I am talking with Peter: and Peter says:
/reminder <minutes> <message>
And when the time has come, my client will write the alarm to the conversion window!
Is it possible? The code of the script is the following:
JScript code:
//set globals
var time;
var own_message;
//display the toast
//hehe toast.... mmm butter...
function toast() {
var t_title = "Time's Up!";
var t_msg;
//if personal message set
if(own_message == "") {
var t_msg = "Emlékeztetést kértél "+time+" percre és ez az idő letelt!";
}
//if default message
else {
var t_msg = time+" minute(s) has passed - \""+own_message+"\"";
}
//display the toast
MsgPlus.DisplayToast(t_title,t_msg,"alarm.mp3");
//unset variables
time = "";
own_message = "";
}
//check input for function
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
//generate new array
var input = new Array();
//assign values to array
input = Message.split(" ");
if(input[0] == "/remind") {
// set a reminder
time = input[1];
if(input[2]) {
// own message
var input_no = 3;
own_message = input[2];
//if the message is more than one word
if(input[3]) {
//string together message
while(input_no < input.length) {
own_message+=" "+input[input_no];
input_no = input_no+1;
}
}
}
//convert to milliseconds
var time_ms = time*60000;
//set timer
MsgPlus.AddTimer("toaster2", time_ms);
//return nowt
return "";
}
}
function OnEvent_Timer(timerId) {
if (timerId == "toaster2") {
toast();
}
}
function OnEvent_Initialize(MessengerStart) {}
function OnEvent_Uninitialize(MessengerExit) {}