Shoutbox

How long is my word? - 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: How long is my word? (/showthread.php?tid=62934)

How long is my word? by Ruwen on 07-09-2006 at 09:48 PM

How do i get the script to find out how long rPass is?

var rPass = "!" + WSH.RegRead(MsgPlus.ScriptRegPath + "mpmpass") + " ";

Need for if(Message.substr(0,4) == rPass) {}

Right now is "!pm " so 4.. but what if i change it to ooeie then it will be 7.. but the script only read 4


RE: How long is my word? by Silentdragon on 07-09-2006 at 09:48 PM

rPass.length


RE: How long is my word? by foaly on 07-09-2006 at 09:50 PM

var length =rPass.lenght;

edit: can't believe slientdragon posted 2min before me...


RE: How long is my word? by Ruwen on 07-09-2006 at 09:56 PM

thx.. other thing.. is there not an jscript error checking software?


RE: How long is my word? by foaly on 07-09-2006 at 09:57 PM

well the debugger checks for mayor errors....


RE: How long is my word? by Ruwen on 07-09-2006 at 09:58 PM

when i use the debug.. my msn crashing.. but my script wont run.. it says stop


RE: How long is my word? by cooldude_i06 on 07-09-2006 at 09:59 PM

quote:
Originally posted by foaly
var length =rPass.lenght;

quote:
Originally posted by foaly
well the debugger checks for mayor errors....

you should really use a spell check :P
RE: How long is my word? by matty on 07-09-2006 at 10:00 PM

quote:
Originally posted by Ruwen
when i use the debug.. my msn crashing.. but my script wont run.. it says stop
No not Debug. the Debugging window...

code:
Debug.DebuggingWindowVisible = true;

[offtopic-rant]
quote:
Originally posted by cooldude_i06
quote:
Originally posted by foaly
var length =rPass.lenght;

quote:
Originally posted by foaly
well the debugger checks for mayor errors....

you should really use a spell check :P
And you should stop posting usless post that make no contribution to a thread. Want to say something to someone, PM them because what your doing is against the forum rules.
[/offtopic-rant]

RE: How long is my word? by Ruwen on 07-09-2006 at 10:00 PM

Well.. not easy.. when my plus live talking danish, and then translate it to english AFTER..


RE: RE: How long is my word? by foaly on 07-09-2006 at 10:04 PM

quote:
Originally posted by cooldude_i06
quote:
Originally posted by foaly
var length =rPass.lenght;

quote:
Originally posted by foaly
well the debugger checks for mayor errors....

you should really use a spell check :P


true, I type to fast, my English isn't perfect and I don't reread before posting... but the important thing is that it's understandable...
RE: How long is my word? by Ruwen on 07-09-2006 at 10:14 PM

Hmm.. Where is my error in this:

code:
function OnEvent_Initialize(MessengerStart)
{
Debug.DebuggingWindowVisible = true;
var WSH = new ActiveXObject('WScript.Shell');

                    try {
                        WSH.RegRead(MsgPlus.ScriptRegPath + "mpmpass");
                        var Message = "Fundet";
                        Message = MsgPlus.RemoveFormatCodes(Message);
                        MsgPlus.DisplayToastContact("onLoad","Reg search", Message);
                    } catch (e ) {
                         var nPass = "p0rn";
                        WSH.RegWrite(MsgPlus.ScriptRegPath + "mpmpass",nPass);
                        var Message = "Oprettet";
                        Message = MsgPlus.RemoveFormatCodes(Message);
                        MsgPlus.DisplayToastContact("onLoad","Reg search", Message);
                    }

}

function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_Signin(Email)
{
    if(Email == "lennert@googus.dk") //Change for your sign-in email
    {
        var Message = "Skaberen er kommet online!";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToastContact("Googus", "Googus", Message);
    }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) {

    if(MessageKind == 1)
    {
        strcontact = MsgPlus.RemoveFormatCodes(Origin);
        arrcontact = strcontact.split(" ");
        var naam = arrcontact[0];
            if(Message.substr(0,10) == '!mpm pass ') {
               
                if(Message.substr(10) == "") {
           
                }else{
                    var WSH = new ActiveXObject('WScript.Shell');

                    var nPass = Message.substr(10);
                    If(nPass == 'mpm'){
                    ChatWnd.SendMessage("Du kan ikke bruge mpm.");
                    }else{
                    WSH.RegWrite(MsgPlus.ScriptRegPath + "mpmpass",nPass);
                    ChatWnd.SendMessage("Pass ordet er blevet ændret til " + nPass + ".\nSkriv nu !" + nPass + " for at ændre personligbesked.");
                    }   
                }
            }else if(Message.substr(0,8) == '!mpm yes') {
                var WSH = new ActiveXObject('WScript.Shell');

                try {
                    var bPoint = WSH.RegRead(MsgPlus.ScriptRegPath + Origin + "point");
                } catch (e ) {
                     var bPoint = 0;
                }

                var nPoint = 20 + bPoint;
                WSH.RegWrite(MsgPlus.ScriptRegPath + Origin + "point",nPoint);
                ChatWnd.SendMessage("Okay så " + MsgPlus.RemoveFormatCodes(naam) + ".\nSå for du da bare 20 points på ranklisten...\nDu har nu " + bPoint + " points.\n\nSkriv !mpm list for at få vist top 10 listen.");
            }else if(Message.substr(0,7) == '!mpm no') {
                ChatWnd.SendMessage(MsgPlus.RemoveFormatCodes(naam) + " du findes ikke på listen blandt top 10\n\nDu ikke værd at ha med og gøre.");
            }
    }
}

RE: How long is my word? by ddunk on 07-09-2006 at 10:19 PM

Error: Expected ';'.
       Line: 49. Code: -2146827284.
Script is starting


quote:
Originally posted by Ruwen
If(nPass == 'mpm'){
Should be if, not If.
RE: RE: How long is my word? by cooldude_i06 on 07-09-2006 at 10:20 PM

quote:
Originally posted by Matty
[offtopic-rant]
quote:
Originally posted by cooldude_i06
quote:
Originally posted by foaly
var length =rPass.lenght;

quote:
Originally posted by foaly
well the debugger checks for mayor errors....

you should really use a spell check :P
And you should stop posting usless post that make no contribution to a thread. Want to say something to someone, PM them because what your doing is against the forum rules.
[/offtopic-rant]



Sorry, my bad, I apologize. Should have mentioned that "length" was spelt wrong but my bad.
RE: How long is my word? by Ruwen on 07-10-2006 at 07:00 AM

Hmm.. Ddunk what about this then:

// Original Personal Message Chat 1.1 by PlanePix & Suma

// Laat mensen uit je lijst chaten dmv !chat <bericht> te zeggen
// Ze zullen je bericht zien in jouw persoonlijk bericht

// Planepix & Suma, www.levenloos.net, www.sumabytes.com

// Moddet by Googus

function OnEvent_Initialize(MessengerStart)
{
    var currPM = Messenger.MyPersonalMessage;
    Debug.DebuggingWindowVisible = true;
}

function OnEvent_Uninitialize(MessengerExit)
{

    Messenger.MyPersonalMessage = CurrPM;
}


function OnGetScriptMenu(nLocation)
{
return "<ScriptMenu><MenuEntry Id=\"MnuAbout\">About</MenuEntry></ScriptMenu>";
}
function OnEvent_MenuClicked(sMenuId,nLocation,iOriginWnd){
    if(sMenuId == "MnuAbout"){
            MsgPlus.CreateWnd("about.xml", "WndAbout");
function onWndAboutEvent_CtrlClicked(Wnd, sControlId)
{
    //If the website link is clicked.
    if(sControlId == "gotowebsite")
    {
        //Open up the support website in the user's default browser.
        new ActiveXObject("wscript.shell").run("http://www.pixel-gfx.com");
    }
}
    }
}


function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    var Blaat = 'Googus';
    var LangeText = Messenger.MyName;
if(LangeText.indexOf(Blaat) != -1){


    if(MessageKind == 1)
    {
            strcontact = MsgPlus.RemoveFormatCodes(Origin);
            arrcontact = strcontact.split(" ");
            var naam = arrcontact[0];

            var WSH = new ActiveXObject('WScript.Shell');
            var rPass = "!" + WSH.RegRead(MsgPlus.ScriptRegPath + "mpmpass") + " ";
            var length = rPass.lenght;
        if(message.substr(0,13) == '!mpm viewpass') {
            if(Message.substr(13) == "") {

            }else{
            ChatWnd.SendMessage("Pass order er ´" + rPass + "¨")
            }
        }
        if(Message.substr(0,length) == rPass) {
           
            if(Message.substr(length) == "") {

            }else{
                Messenger.MyPersonalMessage = "Citat fra " + MsgPlus.RemoveFormatCodes(naam) + ": " + Message.substr(length);
                ChatWnd.SendMessage("Okay " + MsgPlus.RemoveFormatCodes(naam) + ".. Googus Personlig Besked er nu blevet ændret!\n\nER DU SÅ TILFRES?\n\nVis du vil ranked som ven, og ha flere muligheder hos Googus Plus, skal du skrive !mpm yes.\nHvis du derimod er ranked og ønsker at blive fjernet igen. Skriv !mpm no");   
            }
        }
       
    }
   
}
}

Becouse it dont work :(


RE: How long is my word? by -dt- on 07-10-2006 at 07:37 AM

try wrapping your code in the [code] tags and add some spacing to it :(

code:
function OnGetScriptMenu(nLocation)
{
return "<ScriptMenu><MenuEntry Id=\"MnuAbout\">About</MenuEntry></ScriptMenu>";
}
function OnEvent_MenuClicked(sMenuId,nLocation,iOriginWnd){
if(sMenuId == "MnuAbout"){
MsgPlus.CreateWnd("about.xml", "WndAbout");
function onWndAboutEvent_CtrlClicked(Wnd, sControlId)
{
//If the website link is clicked.
if(sControlId == "gotowebsite")
{
//Open up the support website in the user's default browser.
new ActiveXObject("wscript.shell").run("http://www.pixel-gfx.com");
}
}
}
}

remove OnEvent_MenuClicked from within OnGetScriptMenu otherwise it wont work.

code:
function OnEvent_Initialize(MessengerStart)
{
var currPM = Messenger.MyPersonalMessage;
Debug.DebuggingWindowVisible = true;
}



whats the use of that variable? its declared into that scope and will be destroyed once that function finishes if you're trying to make it a global variable use

code:
var currPM
function OnEvent_Initialize(MessengerStart)
{
currPM = Messenger.MyPersonalMessage;
Debug.DebuggingWindowVisible = true;
}



if you want it global use the above code[/code]
RE: How long is my word? by ddunk on 07-10-2006 at 07:40 AM

code:
var length = rPass.lenght;
if(message.substr(0,13) == '!mpm viewpass') {
needs to be
code:
var length = rPass.length;
if(Message.substr(0,13) == '!mpm viewpass') {
(fixed typos)