Shoutbox

Computer Details script - 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: Computer Details script (/showthread.php?tid=87915)

Computer Details script by mrfireman on 12-22-2008 at 09:26 PM

Hey guys again! :)

Now, I started to trying scripting, but i go slowly, so be patient with me :) I have a script:

http://www.msgpluslive.net/scripts/view/14-Computer-Details/


And I want to make keywords for them. (For example "!processor" to the chatwindow, and show my processor)

I have readen the script tutorial, but found nothing to programming keywords. Can you tell me what do I have to write to make a code for all these parts on this script?

At this time, I will write the code, just help me to give all base. (dont want to make work for others to write all the script)

Thx dudes ;)


RE: Computer Details script by roflmao456 on 12-23-2008 at 12:32 AM

You can try the event ChatWndReceiveMessage.
also a switch:

code:
switch(string){
case "test1":
// equivalent of if(string == "test1")
break;
case "test2":
// code..
break;
}

RE: Computer Details script by mrfireman on 12-23-2008 at 08:10 AM

I tried (with SendMessage) and it doesn't work... :(

function OnEvent_ChatWndSendMessage(ChatWnd,Message){
    switch(string){
     case "OS_name":
     if (string == "proci")
     break;
    }


What is the wrong dont you know? :(


RE: Computer Details script by Pinecone on 12-23-2008 at 03:34 PM

I think that a switch statement would not be the best for someone who is just learning JScript as he will probably want multiple commands of variable length, which will make a switch statement difficult to manage.

Try this:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {

    // In the following line, note that 10 is the length of the string '!processor'
    if (Message.substring(0, 10).toLowerCase() == '!processor') {
        // Put code here to send information about your processor.
    }

    // again, 9 refers to the length of '!graphics'
    if (Message.substring(0, 9).toLowerCase() == '!graphics') {
        // Put code here to send information about your graphics card.
    }
   
    return Message;
}


Note that if you add a return statement anywhere else in there, you should return Message so you know what your partner said.
RE: Computer Details script by mrfireman on 12-23-2008 at 05:19 PM

Ty Pinecone :)


RE: Computer Details script by Lou on 12-23-2008 at 05:40 PM

I don't want to burst your bubble but Computer details script 1.0 by -dt-.


RE: Computer Details script by vaccination on 12-23-2008 at 05:46 PM

quote:
Originally posted by .Lou
I don't want to burst your bubble but Computer details script 1.0 by -dt-.
Your point? He has this script, he's modifying it for increased [personal] functionality.

At least read the guy's post...
RE: Computer Details script by Lou on 12-23-2008 at 05:51 PM

quote:
Originally posted by vaccination
quote:
Originally posted by .Lou
I don't want to burst your bubble but Computer details script 1.0 by -dt-.
Your point? He has this script, he's modifying it for increased [personal] functionality.

At least read the guy's post...
My bad, I misread it. I had figured he was trying to make a completely new one. My apologies :).
RE: Computer Details script by warmth on 11-14-2009 at 02:34 AM

Sorry for bring back this old thread but there is any chances that someone could update this script to work on Vista/Seven with latest versions of MP!L and WLM?