What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP] Store variable

[HELP] Store variable
Author: Message:
hajani
New Member
*


Posts: 7
Joined: Feb 2009
O.P. [HELP] Store variable
How can i store a variable somewhere? (i set for example myvar to "3" by function, and on next start value of myvar is "3")
03-08-2009 04:08 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [HELP] Store variable
You can use the registry, an XML file, an INI file... take your pick...
03-08-2009 04:29 PM
Profile E-Mail PM Find Quote Report
hajani
New Member
*


Posts: 7
Joined: Feb 2009
O.P. RE: [HELP] Store variable
can i do this with javascript (msn plus script) or i must do it with vb?

This post was edited on 03-08-2009 at 04:34 PM by hajani.
03-08-2009 04:33 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [HELP] Store variable
No you can do it with JScript. Have you decided where you want to store it?
03-08-2009 04:41 PM
Profile E-Mail PM Find Quote Report
hajani
New Member
*


Posts: 7
Joined: Feb 2009
O.P. RE: [HELP] Store variable
a single txt file would be excellent, but how can i write a file with javascript?
thanks in advance

This post was edited on 03-08-2009 at 04:52 PM by hajani.
03-08-2009 04:49 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [HELP] Store variable
  • Registry
    Interesting for: local preferences
    Application: use the Windows Script Host Shell object.
    Javascript code:
    var oWshShell = new ActiveXObject("WScript.Shell");
    //Write to a key value
    oWshShell.RegWrite(MsgPlus.ScriptRegPath + "myvar", 3, "REG_DWORD");
    //Read a key value
    var myvar = oWshShell.RegRead(MsgPlus.ScriptRegPath + "myvar");

    Alternatively, you can use the original Win32 functions to do this, but this requires more advanced coding. You could also look at other scripts for registry functions, such as my own Countdown Live in "Registry.js".
  • XML
    Interesting for: portable preferences
    Application: use the XMLDOM.
  • Text file
    Application: use the FileSystemObject or the Win32 ReadFile function.
  • INI file
    Interesting for: language files and preferences
    Application: use the FileSystemObject to read the file and parse it afterwards, or use GetPrivateProfileString if you're not going to make many calls.
For more information about the usage, try to search the forums! Many methods have already been covered here. ;)

This post was edited on 03-08-2009 at 05:14 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!
03-08-2009 05:13 PM
Profile E-Mail PM Web Find Quote Report
hajani
New Member
*


Posts: 7
Joined: Feb 2009
O.P. RE: [HELP] Store variable
thank you very much :)
03-08-2009 05:58 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [HELP] Store variable
quote:
Originally posted by Matti
such as my own Countdown Live in "Registry.js".
Wasn't that based off of Screenshot Sender :P
03-08-2009 06:14 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [HELP] Store variable
quote:
Originally posted by matty
quote:
Originally posted by Matti
such as my own Countdown Live in "Registry.js".
Wasn't that based off of Screenshot Sender :P
Yes it is, but your Screenshot Sender 5 is yet to be released! :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
03-08-2009 07:22 PM
Profile E-Mail PM Web Find Quote Report
« 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