Shoutbox

Editing a registry - scripting - 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: Editing a registry - scripting (/showthread.php?tid=86919)

Editing a registry - scripting by Nathan on 10-27-2008 at 07:28 PM

Okay,

I'm making a script that edits a registry (or overwrites doesnt matter).
On messagerecieve it will add to the registry a color - to change the keyboard to, and after 1 second it adds a second colour(restore it back to the previous color, so it looks like it flashes :P).

This is what mynetx has come up with, but it doesn't work properly:

jscript code:
// Colour Changer
// Created by mynetx <mynetx@msgpluslive.net>

// global variables

var intColorHighlight = 0xffff6018; // aabbggrr, intense orange
var intColorNormal = 0xfffd2f22; // aabbggrr, smooth red
var objShell; // will hold the Shell ActiveX
var strAlienKey = "HKCU\\Software\\AlienFXAPI\\ColorWheel\\Colors\\Keyboard"; // registry path

// event handlers

function OnEvent_Initialize(boolMessengerStart) {
    objShell = new ActiveXObject('WScript.Shell');
}

function OnEvent_ChatWndReceiveMessage(objWnd, strOrigin, strMessage, intMessageKind) {
    if(strOrigin == Messenger.MyName)
        return;
    objShell.RegWrite(strAlienKey, intColorHighlight, 'REG_DWORD');
    MsgPlus.AddTimer('ResetColor', 1000);
}

function OnEvent_Timer(strTimerId) {
    switch(strTimerId) {
        case 'ResetColor':
            objShell.RegWrite(strAlienKey, intColorNormal, 'REG_DWORD');
    }
}

Thanks for your help :)
RE: Editing a registry - scripting by matty on 10-27-2008 at 07:33 PM

Are you sure that the keyboard will change just when a key is edited? You would think that a message has to be broadcasted for it to be successful.

Where is this keyboard API documented?

Also the colours are the same...

jscript code:
var intColorHighlight = 0xffff6018; // aabbggrr, intense orange
var intColorNormal = 0xffff6018; // aabbggrr, smooth red

RE: Editing a registry - scripting by Nathan on 10-27-2008 at 07:37 PM

The keyboard does, there's a 3rd party program that allows more customization and registry monitoring. So any registry edits will instantly change the keyboard. It works, tried and tested - because if I manually edit the registry it will instantly change :)


RE: Editing a registry - scripting by Eljay on 10-27-2008 at 07:38 PM

Well the two colours in that code are the same :P


RE: Editing a registry - scripting by Nathan on 10-27-2008 at 07:39 PM

Yeah, typo :p. Either way it doesn't work.


RE: Editing a registry - scripting by matty on 10-27-2008 at 07:41 PM

Does it change the colour at all or not at all?


RE: Editing a registry - scripting by Nathan on 10-27-2008 at 08:45 PM

Question, Can anyone adapt this script to keep flashing the keyboard untill the convo is focused?

Thanks :)

BTW: I got it fixed :)


RE: Editing a registry - scripting by mynetx on 10-28-2008 at 10:50 AM

So what was the problem? Mind posting the updated code?