Shoutbox

Tutorial, but better isnt a bad idea is it? - 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: Tutorial, but better isnt a bad idea is it? (/showthread.php?tid=66884)

Tutorial, but better isnt a bad idea is it? by DennisMartijn on 10-02-2006 at 01:22 PM

Since im a dutch guy, i dont understand the script documentation, or tutorials made by others (yeah i saw the new thread).

Is someone willing to make a tutorial, with good explenations, and especialy EXAMPLES?

code:
OnEvent_ContactSignin(
    [string] Email
);

i dont get it.
do you have to fill an email adres in the code like this:
code:
OnEvent_ContactSignin(
    justastupidname@hotmail.com Email
);

or whatever?

this is an example of something i dont understand. please, is anyone willing to make a tutorial of simple and fun scripts?

hope this isnt to much to ask... but well, im a dumpass in JScript.

oh by the way, if you show the example, please show the original found in the documentation either. like this:
code:
OnEvent_ContactSignin(
    [string] Email
);


//this is the example (the lower one), no i dont know if this is right but i want to show you how i mean things... anyway
OnEvent_ContactSignin(
    irealyneedhelprightnow@JScript.com Email
);


PS: i dont get the whole boaleen (true false etc) thingie either, so if you can show an example wich has true and false in it, and can explain why and how,... i realy appreciate your help. (if i get help:P)
RE: Tutorial, but better isnt a bad idea is it? by CookieRevised on 10-02-2006 at 01:49 PM

The things you see in the documentation are called syntaxis. It is a way to descibe how the function must be used. And is actually a common, almost standard, way of writing how something must be used.

eg: If it states:

quote:
OnEvent_ContactSignin(
    [string] Email
);
It means there is a function called OnEvent_ContactSignin which has 1 parameter called Email. The Email parameter must be in the form of a string.

'function', 'parameter', 'string', etc are all words and terms used in programming. Thus this has little todo with the documentations not being clear enough. Such terms should be known by he who wants to program something.

A function is something which is executed, it is a bunch of related code which in the end performs a certain action or manipulates something.

A parameter is something which can change and which is either given to the function as input to work with, or returned by the function as a result of that function.

A string is a type of variable, it is text. Besides a string you can also have integers (numbers), booleans (binary states indicating false or true), etc...

as for an example of:
quote:
OnEvent_ContactSignin(
    [string] Email
);
code:
function OnEvent_ContactSignin(TheEmailParameter) {
    Debug.Trace("The contact with the email " + TheEmailParameter + " has just signed in");
    If (TheEmailParameter == "myfriendsemailaddress@mail.com") {
        // this will be performed if the comparisson is correct, thus TRUE
        Debug.Trace("The person who signed in is my friend")
    } else {
        // this will be performed if the comparisson is not correct, thus FALSE
        Debug.Trace("I don't know the person who signed in ")
    }
}

A boolean is a kind of variable which can only be two things: true or false. Or to put it in another way 1 or 0.

Booleans are used to compare things and to indicate if some comparisson is correct or not.

---------

Seeing your other thread too, I strongly suggest you read up on some basic beginners tutorials about programming (they exist in Dutch too, though every tutorial will use english terms as that is simply the common language for programming terms). You can find excellent books in the local library for instance which explains step by step the general basics about programming like what strings, parameters functions and booleans are.

If you go to your local library search a beginners book about general programming and a book about Jscript programming. You'll find them in the rayon with SISO code 525 to 528.

The reason why I say and suggest this is because it would be way too much to start explaining everything in detail in the proper way on a forum.

RE: Tutorial, but better isnt a bad idea is it? by DennisMartijn on 10-02-2006 at 03:18 PM

oke thanks, and how would this code (OnEvent_ContactSignin(
    [string] Email
); 
) be when this email adress is filled in: dennis.kleinman@hccnet.nl?
does there has to be some '' thingies in it? yes i know i can find it in the library, thanks for that but not right now...


RE: Tutorial, but better isnt a bad idea is it? by CookieRevised on 10-02-2006 at 03:35 PM

nothing needs to be filled in. If you read the documentation it states that the parameter Email is a variable which is returned by the function. In other words the parameter Email will give you the email address of he who signed in.


RE: Tutorial, but better isnt a bad idea is it? by J-Thread on 10-02-2006 at 05:05 PM

Dennis, in all Dutch library's are books about programming. I advice you to find a book about beginning programming in javascript, something like "javascript for dummies" or so. It differs from JScript, but it will at least learn you the basics of programming.

After you understand that, read the messenger plus documentation again and try again! Good luck (Y)


RE: Tutorial, but better isnt a bad idea is it? by saralk on 10-02-2006 at 05:35 PM

quote:
Originally posted by DennisMartijn
oke thanks, and how would this code (OnEvent_ContactSignin(
    [string] Email
); 
) be when this email adress is filled in: dennis.kleinman@hccnet.nl?
does there has to be some '' thingies in it? yes i know i can find it in the library, thanks for that but not right now...

Just to answer your question...

If you wanted something to trigger when dennis.kleinman@hccnet.nl signs in, then you would use the following code...

code:
OnContact_Signin(Email) {
if (Email = "dennis.kleinman@hccnet.nl") {
//the code that is triggered
}
}

I am going to assume that you know how to do some basic programming in other languages.

When you declare a function you have parameters, for example, in php:

code:
<?
function ExampleFunction($variable) {
echo $variable;
}
?>

then you could call the function as so

code:
ExampleFunction("hello")

and it would echo the world hello.

So OnEvent_ContactSignin is triggered when a contact signs in, and so messenger plus would run your code and do this:

code:
OnEvent_ContactSignin("dennis.kleinman@hccnet.nl")

then your code would be triggered and dennis.kleinman@hccnet.nl would become the variable Email.

I hope that helps.
RE: RE: Tutorial, but better isnt a bad idea is it? by CookieRevised on 10-02-2006 at 05:41 PM

quote:
Originally posted by saralk
Just to answer your question...

If you wanted something to trigger when dennis.kleinman@hccnet.nl signs in, then you would use the following code...

code:
OnContact_Signin(Email) {
    if (Email = "dennis.kleinman@hccnet.nl") {
        //the code that is triggered
    }
}

that wouldn't work. Corrected:
code:
OnContact_Signin(Email) {
    if (Email == "dennis.kleinman@hccnet.nl") {
        //the code that is triggered
    }
}

RE: Tutorial, but better isnt a bad idea is it? by DennisMartijn on 10-05-2006 at 02:59 PM

ok thanks i now understand a bit better, i just wanted to know how to fill in a code if you want to specifie some-one/thing.

well, time to mess up my scripts, and get started:P:P:P

Btw, if you leeve the code this way:

code:
OnEvent_ContactSignin(
    [string] Email
);
, then the event you want to happen happens when anybody of your contact list is signing in? cuz its a variable?
RE: Tutorial, but better isnt a bad idea is it? by hmaster on 10-05-2006 at 03:08 PM

Correct. But you have to remove "[string]".

Example:

code:
function OnEvent_ContactSignin(Email) {
Debug.trace("The contact " + Email + " has signed in");
}

The above would put the text in the debug window for every contact that signs in when the script is enabled.
RE: Tutorial, but better isnt a bad idea is it? by DennisMartijn on 10-05-2006 at 03:13 PM

Thanks;) this really helps me right now.


RE: Tutorial, but better isnt a bad idea is it? by RaceProUK on 10-06-2006 at 10:18 AM

quote:
Originally posted by J-Thread
It differs from JScript
Only insofar as JScript is an extended version of JavaScript.
All JavaScript is valid JScript, but not always the other way around.

And before anyone starts on with 'document.all' and stuff, that's not a JavaScript/JScript difference: that's a W3C/Microsoft DOM difference.
RE: Tutorial, but better isnt a bad idea is it? by ins4ne on 10-06-2006 at 10:37 AM

quote:
Originally posted by J-Thread
"javascript for dummies"
isnt there such a thing as e-book anywhere?
RE: Tutorial, but better isnt a bad idea is it? by Jesus on 10-06-2006 at 12:09 PM

May I suggest This javascript tutorial, it helped me to get started.


RE: Tutorial, but better isnt a bad idea is it? by -dt- on 10-06-2006 at 12:29 PM

quote:
Originally posted by RaceProUK
quote:
Originally posted by J-Thread
It differs from JScript
Only insofar as JScript is an extended version of JavaScript.
All JavaScript is valid JScript, but not always the other way around.

And before anyone starts on with 'document.all' and stuff, that's not a JavaScript/JScript difference: that's a W3C/Microsoft DOM difference.
err no jscript isnt an extended version of javascript.. its a child of ecmascript and so is javascript, nearly all of javascript 1.5 is compatible with jscript though.
newer versions of javascript have things which arent compatible like
javascript 1.6 introduces e4x (basicly native xml handleing in javascript) and some more array methods
javascript 1.7 introduces interators , generators , let expressions and destructuring stuff.
RE: Tutorial, but better isnt a bad idea is it? by DennisMartijn on 10-06-2006 at 04:47 PM

heey... Jesus's (hehe lol name) found tutorial site is pretty good, since its shows the output of a code... cool:P


RE: RE: Tutorial, but better isnt a bad idea is it? by CookieRevised on 10-07-2006 at 11:24 PM

quote:
Originally posted by DennisMartijn
Btw, if you leeve the code this way:
code:
OnEvent_ContactSignin(
    [string] Email
);
, then the event you want to happen happens when anybody of your contact list is signing in? cuz its a variable?
as said before yes... But you have one important thing wrong in there:
code:
OnEvent_ContactSignin(
    [string] Email
);
is not programming code!!! It is a syntax description. It may look like code but it really isn't. It just described the function.

It is the same as a phonetic description of a word. The description itself is not the word, it is a desription of the word.

So although the next reply will work in practice (most of the time):
quote:
Originally posted by hmaster
Correct. But you have to remove "[string]".

Example:
code:
function OnEvent_ContactSignin(Email) {
Debug.trace("The contact " + Email + " has signed in");
}

it does not teach the correct thing...


just wanted to clarify that... ;)






---------------------

quote:
Originally posted by -dt-
quote:
Originally posted by RaceProUK
quote:
Originally posted by J-Thread
It differs from JScript
Only insofar as JScript is an extended version of JavaScript.
All JavaScript is valid JScript, but not always the other way around.

And before anyone starts on with 'document.all' and stuff, that's not a JavaScript/JScript difference: that's a W3C/Microsoft DOM difference.
err no jscript isnt an extended version of javascript.. its a child of ecmascript and so is javascript, nearly all of javascript 1.5 is compatible with jscript though.
newer versions of javascript have things which arent compatible like
javascript 1.6 introduces e4x (basicly native xml handleing in javascript) and some more array methods
javascript 1.7 introduces interators , generators , let expressions and destructuring stuff.

absolutely, hence why one should be carefull in basing stuff on JavaScript when writing or learning JScript. It is indeed not the same as Jscript, nor is it derived from it, nor is it an extended version (and vice versa)...

Many stuff is the same, but not all (and that is excluding DOM differences)