Jonte135
Junior Member
Posts: 57
– / – /
Joined: Aug 2007
|
O.P. RE: [REQUEST] "Bye [username]"
Ok, here is the code:
code: /// Script created by Davinxi.
/// www.davinxi.net
/// davinxi@gmail.com
/// Answers to the words "Bye" "Goodbye" ... and deriveds
/// with: "Bye, have a nice day."
var ok = 'Bye, have a nice day.'
var on = '1'
function OnEvent_Initialize(MessengerStart)
{
if (on == '0'){
MsgPlus.DisplayToast('AutoBye - ', 'AutoBye is: Off\r\n\r\Visit www.davinxi.net for more details');
}
else
{
MsgPlus.DisplayToast('AutoBye - ', 'AutoBye is: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if (on == '1'){
if (Origin != Messenger.MyName){
if (Message.match(/(^|\s+)(\*)?bye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?byebye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see ya(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u later(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you later(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u tomorrow(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you soon(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u soon(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?goodbye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?godbye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you tomorrow(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
}
}
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if(Message.substr(0, 15) == '/okon'){
okon();
return '';
}
if(Message.substr(0, 15) == '/okoff'){
okoff();
return '';
}
if(Message.substr(0, 15) == '/okonoff'){
onoff();
return '';
}
}
function OnGetScriptMenu(Location)
{
var ScriptMenu = '<ScriptMenu>';
ScriptMenu += '<MenuEntry Id=\'onoff\'>AutoBye On or Off ?</MenuEntry>';
ScriptMenu += '<MenuEntry Id=\'StartStop\'>';
if(on == '0') {
ScriptMenu += 'Turn On or Turn Off AutoBye';
ScriptMenu += '</MenuEntry>';
}else {
ScriptMenu += 'Turn On or Turn Off AutoBye';
ScriptMenu += '</MenuEntry>';
}
ScriptMenu += '</ScriptMenu>';
return ScriptMenu;
}
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd) {
switch(MenuItemId) {
case 'StartStop':
okturn();
break;
case 'onoff':
onoff();
break;
case 'about':
msgbox();
break;
}
}
function msgbox() {
var wnd = MsgPlus.CreateWnd('msgbox.xml', 'autookmsgbox');
wnd.SetControlText(msg);
}
function OnautookmsgboxEvent_CtrlClicked(PlusWnd,ControlId) {
switch(ControlId) {
case "Ok":
PlusWnd.Close(0);
break;
}
}
function onoff()
{
if (on == '0'){
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');}
else
{
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function okon()
{
if (on == '0') {
on = '1'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function okoff()
{
if (on == '1') {
on = '0'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');
}
}
function okturn()
{
if (on == '0'){
on = '1'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
else
{
on = '0'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');
}
}
|
|