Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default [Tutorial] How to Make and Publish a Windows Live Messenger Activity

    How to Develop and Publish a Windows Live Messenger Activity

    Here is the tutorial that a lot of people have been waiting for since a few days ago, how to create your own personal Windows Live Messenger activity, publish it and release it so everyone can use it!

    Firstly, it is not at all difficult to create a Messenger Activity. All it takes is a tiny amount of Javascript knowledge, and a PHP script to make, or one you've made already to intergrate it into. It is just as easy as making a normal PHP application, and then adding a couple of lines of Javascript to it!

    In this tutorial, I am going to teach you just a few of the methods that are available in the Messenger Activity API - if you want to learn how to use some of the more powerful (and perhaps dangerous) ones, visit the Messenger API section on MSDN, at http://msdn2.microsoft.com/en-us/library/aa751024.aspx. To use the things, all you have to do is place the things between <script> tags. Now, lets go over how it works:

    The Basics

    Before you run any of the API commands, you have to define what section of commands it is in. For example, sending messages comes under the "channel" object and opening WLM dialog boxes comes under the "messenger" object. If you want to use the channel object, you define it like this:

    myChannel = window.external.Channel;
    Once you have done that, you can run the API commands. In this example, they will begin with myChannel, and then a dot, then the API command, and then the parameter in brackets.

    Commands

    EnterIM

    This is one of the commands that come under the channel object. What it does it puts a message of your choice into the message box of the person who is running the activity. Then they either have to press enter or click send to send to message to their contact. As I showed above, you have to define the channel object, and then run the command:

    myChannel = window.external.Channel;
    myChannel.EnterIM("The text that is here will be put into the message box");
    What will happen when this is used, is that the text "The text that is here will be put into the message box" will be put into the message box. This can be used dynamically, as any of the commands can, to send a PHP variable like this:

    myChannel = window.external.Channel;
    myChannel.EnterIM("Your contact would like to share a file with you. You can download the shared file at <?php echo $file_url; ?>");
    SendIM

    This is very similar to the above command, but instead of entering it into the text input box, it will be sent automatically, and if published using the Windows Live Messenger Activity Centre, it will appear as "Windows Live Messenger Activity Centre says:". Here is how to use it, including PHP variables.

    myChannel = window.external.Channel;
    myChannel.SendIM("A picture is available for you to view! To look at it, visit <?php echo $picture; ?>");
    Messenger.Options

    This command is different, and uses a different object to do it. When it is run, it opens the Windows Live Messenger options dialog, and opens it on a specific section if it is specified. It uses the "window.external.Messenger" object! Here is how you define it:

    myMessenger = window.external.Messenger;
    Then, from there, it works like most of the other commands! To open the Personal tab, use:

    myMessenger = window.external.Messenger;
    myMessenger.Options();
    And to open the General tab of the options, use:

    myMessenger = window.external.Messenger;
    page = 5;
    myMessenger.Options(page);
    How to Make Your Activity

    Now you know how to use a lot of the Javascript, you need to implement it. You need to add it to the pages where you want things to happen, once you have customised it. If there is anything you would like to do, but I haven't said how, look on the MSDN link I said earlier, and it is likely to be in the "Technical Reference" section there. If you have read everything, it shouldn't be too difficult to use it how you want to - if you need some help, PM me and I'll help you as soon as I can.

    Once you have added the code to where you need it, you are ready to test and publish it so that anyone who wants to can use it!

    How to Publish and Test Your Activity

    Now for the really fun bit - seeing if your new activity works properly! To get your activity added to the system, first you need to upload all the files you have made to your web hosting.

    Next, visit www.tim-rogers.co.uk/activity, and type the name of the activity, the address of it and your name into the right boxes, then click Submit. Your activity has been added, and it is ready to be used by anyone who has the Activity Centre installed.

    Now is for the moment of truth - testing your PHP script and the WLM functions. First, visit http://habboxforum.com/showthread.php?t=310634 and follow the instructions of how to install the XML activity file. Once you have installed it as you are told, open a WLM conversation and go into the Actions menu - a new option should have appeared between "Video" and "Start an Activity..." called "Start Windows Live Messenger Activity Centre". Click it, and then click OK in the next dialog box, and you will be brought to the page you saw earlier, but this time from within Windows Live Messenger. Click the name of your site that you added earlier, and then test whether what you did works.

    If it doesn't work properly, then a script error may come up. If it doesn't, then it is another problem, and it'd be a good idea to compare your code to the examples in this tutorial. The script error, if it comes up, should give you information of what line of your code there's a problem, and what piece of Javascript the problem is with - look at it, then check for errors - if it has errored, there must be a problem with the coding. If it all works, congratulations on building a brilliant brand new Windows Live Messenger activity. If it doesn't, and you eventually give up, or want to change any of the information you entered, PM me on here, and I'll change it or delete it for you.

    Thank you for reading the tutorial! I hope it helped you to create yourself an activity to be proud of! I'd like to thank Luckyrare for persauding me to make my first activity, and all the people that asked for a tutorial and liked the original activity, Uploadz Uploader. If you need any help with anything, send me a PM as I have said already - I'll try to get back to you as soon as I possibly can.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    49
    Tokens
    0

    Default

    Nice tutorial tim, well done, i would of given you rep, but i can't as i must spread, as i gave you rep earlier , can't keep up with your awesome projects and tutorials!

    Keep it up!

    Daz

  3. #3
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Well done Tim.

  4. #4
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Thanks for the comments



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  5. #5
    Join Date
    Jan 2007
    Location
    Wales
    Posts
    2,432
    Tokens
    141

    Latest Awards:

    Default

    Great tutorial
    Free Online Games And Videos:
    http://www.vincesgames.com



  6. #6
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Nice, i will try it out tomorrow
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •