Shoutbox

Settings Manager - 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: Settings Manager (/showthread.php?tid=66997)

Settings Manager by Spunky on 10-05-2006 at 05:27 PM

Is it possible to make a script that can list (or enumerate, whatever :P) the sub-keys in the HKEY_CURRENT_USER\Software\Patchou\Messenger Plus! Live\GlobalSettings\Scripts key? (I guess listing the folders in the Scripts folder would give me the information I need to read settings in most cases)

I'm planning to make each scripts settings editable from a single window :D

If it's possible, i'm hoping to make it support settings saved in files too...


RE: Settings Manager by matty on 10-05-2006 at 06:19 PM

code:
function OnEvent_Initialize(MessengerStart){
    var aKeys = new Array();
    aKeys = EnumRegistryKeys(HKEY_CURRENT_USER, 'Software\\Patchou\\Messenger Plus! Live\\GlobalSettings\\Scripts');
    for (var i in aKeys){
        Debug.Trace(aKeys[i]);
    }
}

RE: Settings Manager by Spunky on 10-05-2006 at 06:33 PM

Thankyou! lol That seems to easy though ;)

EDIT: HKEY_CURRENT_USER is undefined :p

I'll see if I can find out an alternative keyword. Also, is there a way to navigate one key up from the MsgPlus.ScriptRegPath rather than using a string value as they may have installed to a different location


RE: Settings Manager by matty on 10-05-2006 at 06:36 PM

quote:
Originally posted by SpunkyLoveMuff
Thankyou! lol That seems to easy though ;)
Of course cause I made the registry script makes it really easy. I updated the code because I realized its GlobalSettings not Global Settings.

quote:
Originally posted by SpunkyLoveMuff
I'll see if I can find out an alternative keyword. Also, is there a way to navigate one key up from the MsgPlus.ScriptRegPath rather than using a string value as they may have installed to a different location

The location of the registry keys will not change.

quote:
Originally posted by SpunkyLoveMuff
EDIT: HKEY_CURRENT_USER is undefined :P
Make sure to extract _registry.js to your script folder and resave the script so it detects the module. (Or logout and relog back in.)
RE: Settings Manager by Spunky on 10-05-2006 at 06:46 PM

Yay you! :D Itworks :p


RE: Settings Manager by matty on 10-05-2006 at 06:58 PM

quote:
Originally posted by SpunkyLoveMuff
Yay you! :D Itworks :p
Welcome,

Just a reminder, most scripts store their values in memory so changing the registry values will not make any changes.

Don't forget to rep *cough cough*.
RE: Settings Manager by Spunky on 10-05-2006 at 07:56 PM

quote:
Originally posted by Matty
Don't forget to rep *cough cough*.

lol. As for the settings being stored in memory, I'm just making this so that users can edit settings from one place. The script would most likely need to be restarted for the changes to take effect :p

EDIT: btw, having trouble with the EnumRegValues returning undefined :s
RE: Settings Manager by matty on 10-05-2006 at 09:16 PM

code:
function OnEvent_Initialize(MessengerStart){
    var aKeys = new Array();
    var aKeyValues = new Array();
    aKeys = EnumRegistryKeys(HKEY_CURRENT_USER, 'Software\\Patchou\\Messenger Plus! Live\\GlobalSettings\\Scripts');
    for (var i in aKeys){
        Debug.Trace(aKeys[i]);
        aKeyValues = EnumRegistryValues(HKEY_CURRENT_USER, 'Software\\Patchou\\Messenger Plus! Live\\GlobalSettings\\Scripts\\'+aKeys[i]);
        for (var j in aKeyValues){
            Debug.Trace('  '+aKeyValues[j]);
        }
    }
}

RE: Settings Manager by Spunky on 10-07-2006 at 06:54 AM

Hmmm... the code works fine, except for when trying to read the values from the Settings keys. It can read if the script is enabled or not, but it can't move onto the next level and check the scripts settings without making WLM crash... Any ideas?

EDIT: In some cases it will read settings from the first script it comes across... and then quit.


RE: Settings Manager by matty on 10-07-2006 at 12:56 PM

It wasn't ment to do that but if you really want it I can do it.


RE: Settings Manager by Spunky on 10-07-2006 at 05:44 PM

Well, I obviously edited the code slightly from that which you gave me so that it would read from the Settings key if it existed. It does it for the first script it comes across, but not the others, and sometimes it quits :s