Well, I had to clean up that code a lot, but it should work. I'm not sure if the timer after you logout though but eh, worth a shot.
code:
var option = 0;
function OnGetScriptMenu(nLocation)
{
var ScriptMenu = '<ScriptMenu>';
ScriptMenu += '<MenuEntry Id=\"fnormal\">normal</MenuEntry>'
ScriptMenu += '<MenuEntry Id=\"fdelay\">delay</MenuEntry>'
ScriptMenu += '<MenuEntry Id=\"foff\">off</MenuEntry>'
ScriptMenu += '</ScriptMenu>';
return '<ScriptMenu>'
}
function OnEvent_MenuClicked(sMenuId)
{
if(sMenuId == "fnormal")
{
MsgPlus.DisplayToast("Menu Click", "Menu Item #1 was clicked!");
option = 0;
}
if(sMenuId == "fdelay")
{
MsgPlus.DisplayToast("Menu Click", "Menu Item #2 was clicked!");
option = 1;
}
if(sMenuId == "foff")
{
MsgPlus.DisplayToast("Menu Click", "Menu Item #3 was clicked!");
option = 2;
}
}
function OnEvent_Signout(Email)
{
if(option == 0)
{
new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
else if(option == 1)
{
MsgPlus.AddTimer(countdown, 10000)
}
}
function OnEvent_Timer(TimerId)
{
if(TimerId = "countdown")
{
new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
}