Shoutbox

Script codes - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Script codes (/showthread.php?tid=70663)

Script codes by plus on 01-14-2007 at 12:36 AM

In a script can you have all this because my debugging dosnt work some how?


code:
}function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'website'){
        MsgPlus.DisplayToast('website', 'website');
    }
    else if (sMessage === 'link'){
        MsgPlus.DisplayToast('link', 'link');
    }
}}function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'website'){
        MsgPlus.DisplayToast('website', 'website');
    }
    else if (sMessage === 'link'){
        MsgPlus.DisplayToast('link', 'link');
    }
}}function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'website'){
        MsgPlus.DisplayToast('website', 'website');
    }
    else if (sMessage === 'link'){
        MsgPlus.DisplayToast('link', 'link');
    }
}}function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'website'){
        MsgPlus.DisplayToast('website', 'website');
    }
    else if (sMessage === 'link'){
        MsgPlus.DisplayToast('link', 'link');
    }
}

and more..........

about the debugging can any one help it dosnt open when i create a new script or edit one

EDIT: The code is wrong but is it was right[u]
RE: Script codes by NanaFreak on 01-14-2007 at 12:38 AM

you cant have more than 1 on the same function ;)

and why do you need so many of the 1 function? :S


RE: Script codes by plus on 01-14-2007 at 12:40 AM

no but if the ''website'' was differant for eatch one


RE: Script codes by NanaFreak on 01-14-2007 at 12:50 AM

code:
var websites = new Array('web1.com','web2.net');
var links = new Array('link1','link2');

function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
if(sMessage === wesites[0]){
MsgPlus.DisplayToast(websites[0], websites[0]);
}else if(sMessage === websites[1]){
MsgPlus.DisplayToast(websites[1], websites[1]);
}
if(sMessage === links[0]){
MsgPlus.DisplayToast(link[0], link[0]);
}else if(sMessage === links[1]){
MsgPlus.DisplayToast(link[1], link[1]);
}
websites[0] is web1.com ;)

there is better ways of doing it than what i did but it will still work ;)



quote:
Originally posted by .2007
no but if the ''website'' was differant for eatch one

well it still wouldnt work because of having multi-functions ;) as i said you _cant_ have more than 1 of the same
RE: Script codes by plus on 01-14-2007 at 01:35 AM

say i wanted to make a script for when i say a certain word a toast will come up can i copy that code in 50 times but instead of website all the time it would be

qwe
rty
wed
wer
wes
wert
mjn
fbvf
cvfv
dvc
>examples lol

so not just one word a whole list

would that work


RE: Script codes by NanaFreak on 01-14-2007 at 01:37 AM

i will code something for you now to do that ;)

code:

code:
var arr = new Array('qwe','rty','wed','wer','wes','wert','mjn','fbvf','cvfv','dvc');

function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    for(i in arr){
        if(arr[i]===sMessage){
            MsgPlus.DisplayToast(sMessage,sMessage);
        }
    }
}


RE: Script codes by RaceProUK on 01-14-2007 at 01:55 PM

quote:
Originally posted by .2007
no but if the ''website'' was differant for eatch one
Then use a switch statement.