What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Packing Scripts

Pages: (2): « First « 1 [ 2 ] Last »
Packing Scripts
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Packing Scripts
quote:
Originally posted by pedro_cesar
Are function as feof, fget*, etc available in JavaScript?
No. Those are PHP functions and they don't exist as standard JScript functions. To access files, you'll have to use the FileSystemObject or use API calls. You can take a look at the code snippet on the MPScripts.net site and use those functions to read from or write to text files. :)

Note: the functions in the snippet use a variable called 'fsObj', this can be declared in global like this:
code:
var fsObj = new ActiveXObject("Scripting.FileSystemObject")
but it's recommend you declare it per function to keep the memory usage low. This means, that instead of using:
code:
// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}
you use
code:
// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fsObj = new ActiveXObject("Scripting.FileSystemObject");
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}
and so on for the other functions. ;)

This post was edited on 12-23-2006 at 02:46 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-23-2006 02:41 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Packing Scripts
Besides that this script can be optimized extremely and that you used many things and methods which aren't needed (though, it works, so if this is your first script then (y)):
  1. code:
    ScriptCommands += '<Name>nick1</Name>';
    ScriptCommands += '<Description>Changes the nick to the number 2</Description>';

    From the user's point of view this isn't logical. If he enters a command with a number (eg: 1) he expects that this command performs action 1, not action 2.

  2. /nick2 is an existing command from Messenger Plus!. Your script breaks this functionality. Do not do that....

    In fact you don't need all those commands /nick0, /nick1, /nick2, etc if you would use parameters.

This post was edited on 12-23-2006 at 02:51 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-23-2006 02:48 PM
Profile PM Find Quote Report
pedro_cesar
Junior Member
**

Avatar

Posts: 61
35 / Male / –
Joined: Dec 2006
Status: Away
O.P. RE: Packing Scripts
I saw the parameter in the Script Documentation I just didn't get it, can u give me an example?

And by the what u say about nick1 switching to to nick2, that's just a mistake, besides, all nick-related code was originally though to me, I wanted to upload the name, pm, and dp cloning part to the DB but there's one almost the same. I'm trying to modify it a bit, so hopefully I'll be accepted next time.

This post was edited on 12-23-2006 at 04:45 PM by pedro_cesar.
12-23-2006 04:41 PM
Profile E-Mail PM Web Find Quote Report
pedro_cesar
Junior Member
**

Avatar

Posts: 61
35 / Male / –
Joined: Dec 2006
Status: Away
O.P. RE: Packing Scripts
Wich code do u say ain't needed, I'm trying to make my script as easy as possible, I'd also like to know how can I add a contact's Display Picture (or my own) to a Display Toast??
12-31-2006 06:47 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Packing Scripts
here is the same script, but this time properly idented and with the proper methods.

All the bugs you have in the original, still remains in this one. I didn't change anything to the actual code (other than replacing /nick0, /nick1 and /nick2 because they interfear with Plus!'s /nick2 command).

The script contains a lot of things which might go wrong or things which aren't taken in account (eg: multi contact conversations, user changing the nick to something else manually, user using a parameter after commands, the backup doesn't work in all cases, etc, etc, etc).

.zip File Attachment: pedro_cesar.zip (1.23 KB)
This file has been downloaded 133 time(s).

This post was edited on 12-31-2006 at 07:41 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-31-2006 07:36 PM
Profile PM Find Quote Report
pedro_cesar
Junior Member
**

Avatar

Posts: 61
35 / Male / –
Joined: Dec 2006
Status: Away
O.P. RE: Packing Scripts
I still wanna know how to add someone's Display Picture to a Display Toast.
12-31-2006 09:30 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Packing Scripts
quote:
Originally posted by pedro_cesar
I still wanna know how to add someone's Display Picture to a Display Toast.
you can't...

If you want to show a toast with a display picture you're going to need to create the toast totally yourself, thus using an interface window, including the slide effect, and handling yourself where the toast should be displayed (it isn't always displayed in the bottom right corner). Furthermore, the toast will not stack upon others, etc...
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-01-2007 01:45 AM
Profile PM Find Quote Report
pedro_cesar
Junior Member
**

Avatar

Posts: 61
35 / Male / –
Joined: Dec 2006
Status: Away
O.P. RE: Packing Scripts
I'll just forget about that (for now, while I'm still a noob). How can I program my msgplus to automatically send a message to a contact as soon as he logs in?

This post was edited on 01-01-2007 at 01:25 PM by pedro_cesar.
01-01-2007 01:24 PM
Profile E-Mail PM Web Find Quote Report
rajvora
Junior Member
**


Posts: 59
Joined: May 2006
RE: Packing Scripts
quote:
Originally posted by pedro_cesar
I'll just forget about that (for now, while I'm still a noob). How can I program my msgplus to automatically send a message to a contact as soon as he logs in?

This script does exactly what u want
Come Back
[Image: 510569321.27.1181180324.png]
01-01-2007 02:42 PM
Profile E-Mail PM Find Quote Report
pedro_cesar
Junior Member
**

Avatar

Posts: 61
35 / Male / –
Joined: Dec 2006
Status: Away
O.P. Packing Scripts
I downloaded the script, I want one simpler that I can understand though, 'cuz I got nothing of that one, I basically want to know how to send a specific text automatically. I also want to know how to use the Messenger.MyStatus and the Contact.Status functions.

This post was edited on 01-09-2007 at 03:31 AM by pedro_cesar.
01-06-2007 01:43 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On