Shoutbox

[Release] Change Me! - 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: [Release] Change Me! (/showthread.php?tid=68694)

[Release] Change Me! by Spunky on 11-20-2006 at 09:17 PM

This is really just a simple script at the moment that I'm hoping to build up to be fully customizable. When somebody sends "!dp" in a chat message, it can print the text on to an image file and then use that image as your display picture. It works for you and your contacts. Obviously, I'm goin to be working on this for a while before I release a new version. As always, leave feedback ;)

EDIT: FYI, This is kinda from the iTunes+ script for making the DP, but he said he stole it (the dll) from the net anyway so *yoink* :p

UPDATED: See further posts for information


RE: [Release] Change Me! by Jimbo on 11-20-2006 at 09:21 PM

quote:
Originally posted by SpunkyLoveMuff
This is really just a simple script at the moment that I'm hoping to build up to be fully customizable. When somebody sends "!dp" in a chat message, it can print the text on to an image file and then use that image as your display picture. It works for you and your contacts. Obviously, I'm goin to be working on this for a while before I release a new version. As always, leave feedback ;)
Thanks excellent :p. would like to see it when you can change the colour of the background.
RE: [Release] Change Me! by DarkMe on 11-20-2006 at 09:24 PM

I cant change it =/
Error Number -2147024770


RE: [Release] Change Me! by Spunky on 11-20-2006 at 09:30 PM

I'm working out an error atm with Jimbodude... It's happened to him as well

EDIT: Fixed it (forgot to include DLL file) Download it again now...

EDIT2: 500th Post


RE: [Release] Change Me! by DarkMe on 11-20-2006 at 09:35 PM

quote:
Originally posted by SpunkyLoveMuff
EDIT: Fixed it (forgot to include DLL file) Download it again now...
still the same here :sad:
RE: [Release] Change Me! by Jimbo on 11-20-2006 at 09:37 PM

quote:
Originally posted by DarkMe
quote:
Originally posted by SpunkyLoveMuff
EDIT: Fixed it (forgot to include DLL file) Download it again now...
still the same here :sad:
yup me 2 :sad: :cry:

RE: [Release] Change Me! by elektra on 11-20-2006 at 10:01 PM

I got a suggestion...
Add a gui, and add background styles and maybe fonts :cheesy:
Good script
One bug:
When my contact goes !dp hi , it changes my dp and not theres  ? :s

EDIT: oops bug not a real bug a feature in the script hehe


RE: [Release] Change Me! by Spunky on 11-20-2006 at 10:03 PM

It's meant so that OTHER PEOPLE can change YOUR dp... so not everybody is experiencing errors then?

EDIT:

quote:
Originally posted by Quacky
Add a gui, and add background styles and maybe fonts

See first post.
RE: [Release] Change Me! by deAd on 11-20-2006 at 10:09 PM

quote:
Originally posted by SpunkyLoveMuff
EDIT: FYI, This is kinda from the iTunes+ script for making the DP, but he said he stole it (the dll) from the net anyway so *yoink* :p
He didn't steal it, it's a freely available library that's meant for being used by anyone who wants to, you can find it here.
RE: [Release] Change Me! by Spunky on 11-21-2006 at 03:46 PM

Thats what I meant... stolen = taken :p


Updated the script. Can now select font, size, colours and stuff (saves to the registry). Hoping to implement a font selection screen and a colour picker. You can also disallow a a request to change your DP.

Download
RE: [Release] Change Me! by jameslives on 11-21-2006 at 04:20 PM

i get the error...


RE: [Release] Change Me! by EBFL on 11-21-2006 at 04:23 PM

I love this script. Works Fine for me. Well done Spunky :grin:


RE: [Release] Change Me! by Spunky on 11-21-2006 at 04:37 PM

I've got a feeling the error has somehting to do with the dll file not being registered properly either due to a regsvr32 error or the file not being moved to the System32 folder.

If you check the debug window it should give you a reason for the image generation failing and it will most likely be "The Automation object failed to create..." or something similar. If that is the case, you will need to check the System32 folder for a DLL file called "dynimage.dll".

I am going to put in place a better method for all this after seeing the problems it causes.


RE: [Release] Change Me! by capitocapito on 11-21-2006 at 05:04 PM

Hmmm... So what happens if two people have this installed?  Which one will have the changed screen?  Both of them?


RE: [Release] Change Me! by Spunky on 11-21-2006 at 05:07 PM

It changes both of them (If approval is needed obivously it only changes if you click yes).

EDIT: I am going to make it so that !dp sets theirs, /dp sets yours


RE: [Release] Change Me! by capitocapito on 11-21-2006 at 05:24 PM

Maybe "/dpme" and "/dpyou"?

Just a suggestion.


RE: [Release] Change Me! by Spunky on 11-21-2006 at 05:28 PM

/dpyou wouldn't work as slashes denote a command and so don't get sent and also trigger plus's error message about being an incorrect command unless it's added to the OnGetScriptCommands function and you add return ""; to the ChatWndSendMessage event. Generally, slashes are for your own commands, exclamation marks are for "remote" commands


RE: [Release] Change Me! by Jimbo on 11-22-2006 at 02:00 PM

Thanks spunky excellent script. would be even better if for the font, font colour etc you could make a window where we could pick colours, fonts etc.


RE: [Release] Change Me! by Spunky on 11-22-2006 at 02:04 PM

quote:
Originally posted by Jimbodude
would be even better if for the font, font colour etc you could make a window where we could pick colours, fonts etc.

I'm in the process of making a List/Combo Box (Whatever you wanna call it :P) that displays all the files in the C:\Windows\Fonts folder. As for colours, I may allow you to use words such as "blue" and "green" etc as AFAIK, making a colour window is quite hard (I think I read a thread about it)
RE: [Release] Change Me! by Jimbo on 11-22-2006 at 02:08 PM

quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by Jimbodude
would be even better if for the font, font colour etc you could make a window where we could pick colours, fonts etc.

I'm in the process of making a List/Combo Box (Whatever you wanna call it :P) that displays all the files in the C:\Windows\Fonts folder. As for colours, I may allow you to use words such as "blue" and "green" etc as AFAIK, making a colour window is quite hard (I think I read a thread about it)
Couldn't you use this to bring up the standard colour dialogue?
code:
    //Show color picker common dialog

    //Create our CHOOSECOLOR data block
    var CHOOSECOLOR = Interop.Allocate(36);
    CHOOSECOLOR.WriteDWORD(0, 36); //DWORD lStructSize
    CHOOSECOLOR.WriteDWORD(4, 0); //HWND hwndOwner
    CHOOSECOLOR.WriteDWORD(8, 0); //HWND hInstance
    CHOOSECOLOR.WriteDWORD(12, 0x000000FF); //COLORREF rgbResult (COLORREF = 0x00bbggrr)
    var CustColors = Interop.Allocate(64); //Create an array of 16 COLORREFs for CustColors
    CHOOSECOLOR.WriteDWORD(16, CustColors.DataPtr); //COLORREF *lpCustColors (pointer to our array)
    CHOOSECOLOR.WriteDWORD(20, 3); //DWORD Flags (3 = 2 (CC_FULLOPEN) + 1 (CC_RGBINIT) )
    CHOOSECOLOR.WriteDWORD(24, 0); //LPARAM lCustData
    CHOOSECOLOR.WriteDWORD(28, 0); //LPCCHOOKPROC lpfnHook
    CHOOSECOLOR.WriteDWORD(32, 0); //LPCTSTR lpTemplateName

    //Open the dialog box
    var result = Interop.Call('comdlg32.dll', 'ChooseColorA', CHOOSECOLOR);
    //If the user pressed ok convert it to hex
    if(result == 1){
      //Get decimal values
      var r = CHOOSECOLOR.ReadDWORD(12) & 0xFF;
      var g = (CHOOSECOLOR.ReadDWORD(12) / 0x100) & 0xFF;
      var b = (CHOOSECOLOR.ReadDWORD(12) / 0x10000) & 0xFF;
      Debug.Trace('RGB: ' + r + ',' + g + ',' + b)
      //Get hex values
      var hexchars="0123456789ABCDEF";
      var r = hexchars.charAt((r >> 4) & 0xf) + hexchars.charAt(r & 0xF);
      var g = hexchars.charAt((g >> 4) & 0xf) + hexchars.charAt(g & 0xF);
      var b = hexchars.charAt((b >> 4) & 0xf) + hexchars.charAt(b & 0xF);
      Debug.Trace('HEX: ' + r + g + b);
    }

RE: RE: [Release] Change Me! by CookieRevised on 11-22-2006 at 02:24 PM

quote:
Originally posted by SpunkyLoveMuff
I've got a feeling the error has somehting to do with the dll file not being registered properly either due to a regsvr32 error or the file not being moved to the System32 folder.
regsvr32 doesn't have bugs and DLLs don't need to be placed in the system32 folder (I even recommend not to place them there to reduce the left-over files when scripts are removed, or Plus! uninstalled).

I see you go about this in your script in the wrong way....
Simply include the DLL in the script packet (and ScriptInfo.xml) and let Plus! install and register the DLL. Do not do what you do in your current script, as that is most likely exactly what produces the error.

As for the DLL itself, you don't need it at all actually. There are Windows APIs which can do the same thing. Of course, it would make things a lot more complicated for the programmer ;)

quote:
Originally posted by SpunkyLoveMuff
/dpyou wouldn't work as slashes denote a command and so don't get sent and also trigger plus's error message about being an incorrect command unless it's added to the OnGetScriptCommands function and you add return ""; to the ChatWndSendMessage event.
OnGetScriptCommands has got nothing todo with that "isn't a command" error. OnGetScriptCommands is only responsible for what you see in the command window when you just pressed "/", that's all...

All you need to do to let Plus! reconize your command as a command is  telling Plus! that you've handled the command (or whatever) so Plus! wont show the error. This is done by simply returning an empty string (or something else for that matter) in the ChatWndSendMessage event.

quote:
Originally posted by SpunkyLoveMuff
Generally, slashes are for your own commands, exclamation marks are for "remote" commands
There are no 'rules' or guidelines at all in this. All I could recommend is using slashes for everything as that is also what Plus! uses and thus what the user is used to.

--------------------

Also the error catching you do when reading/writing to the registry in the initialize event is a wrong way of doing it.

You only do error catching in the initialize event, while you should do it for every registry read/write (in the Read and WriteRegistry functions).

What you do now can lead to other errors. eg: what if the reading of the registry fails because the user don't have access to it or because of some other reason than the settings not being there yet? Then you try again to write stuff to the registry, but since accessing the registry produced an error, this too will fail...

So, this has also consequences in the way you read and set the settings of your script. What you do now is a bit inlogic. I don't see any global settings variable either.

Reading and writing settings should go like this:

1) When the script initializes you should try to read the current settings. If this fails, you must not write to the registry, but simply take the hard coded default values in memory in your global settings variables.

2) When the user opens a preferences window, the window should reflect the current settings in memory. Again, nothing is read or written to the registry yet. Also, the current settings are copied to temporary settings.

3) When the user changes settings in the preferences window, again nothing is written to the registry!, instead the temporary settings is the only thing which changes.

4) When the user presses 'cancel', nothing is again written or read from the registry. In fact, nothing at all is done and the temporary settings are just discarded.

5) When the user presses 'ok' or 'apply' the temporary settings are written to the registry and copied to the current global settings in memory.


All this also reduces the constant reading and writing to the registry which is what is happening now in the current script.
RE: [Release] Change Me! by foaly on 11-22-2006 at 03:08 PM

quote:
Originally posted by CookieRevised

   
quote:
Originally posted by SpunkyLoveMuff
    Generally, slashes are for your own commands, exclamation marks are for "remote" commands

There are no 'rules' or guidelines at all in this.

would be nice if there where... i would be alot easier when using alot off scripts...
RE: RE: [Release] Change Me! by CookieRevised on 11-22-2006 at 03:20 PM

quote:
Originally posted by foaly
quote:
Originally posted by CookieRevised
quote:
Originally posted by SpunkyLoveMuff
Generally, slashes are for your own commands, exclamation marks are for "remote" commands
There are no 'rules' or guidelines at all in this.
would be nice if there where... i would be alot easier when using alot off scripts...
yeah true...

Although logic dictates is easly (and that is also the 'guideline' I use): "Plus! uses slashes for all its commands, so I do to in my scripts because that is what the user is used to (and not "!", "^", "-" or any other character I've seen in scripts being used)."

Remote command are commands too... And having "!dp" and "/dp" may be confusing for people.

The idea is nice, but the fact remains that many scripts use "!" for normal commands too, hence the possible confusion. If there were no scripts using "!" for normal commands and everybody did the same, then the idea of making a destinction between commands and remote commands is great. But unfortunatly this isn't the case...

All it takes to let a command starting with a slash being reconized as a command is returning something (usually an empty string) in the ChatWndSendMessage event.
RE: [Release] Change Me! by Spunky on 11-22-2006 at 11:44 PM

Well, I took what you said on board Cookie and have edited the script to read from the registry only once (during OnEvent_Initialize) and to write to the registry only when the "OK" button is pressed in the settings window.

This is more of an optimization than an update (except there is also now a /dp command to change your own dp as if 2 people had the script they would both change)


RE: RE: [Release] Change Me! by TheGuruSupremacy on 11-23-2006 at 03:25 PM

quote:
Originally posted by SpunkyLoveMuff
Well, I took what you said on board Cookie and have edited the script to read from the registry only once (during OnEvent_Initialize) and to write to the registry only when the "OK" button is pressed in the settings window.

This is more of an optimization than an update (except there is also now a /dp command to change your own dp as if 2 people had the script they would both change)



Nice....even if it's useless but very cool:):)...Thanks!...thank also cookie:you are always helpful!!!!:D:D:D:D:D:D:D [LoL]
RE: [Release] Change Me! by elektra on 11-27-2006 at 03:42 PM

Good script, been using it for quite a while now and i was wondering how i work the image feature, when i select it nothing pops up or anything.
so could some one help me...
~thanks~


RE: [Release] Change Me! by Jimbo on 11-27-2006 at 03:45 PM

quote:
Originally posted by quacky
Good script, been using it for quite a while now and i was wondering how i work the image feature, when i select it nothing pops up or anything.
so could some one help me...
~thanks~
Go to C:/program filesMessenger plus live/scripts/Change Me/Images
and then change to default.bmp to any 96x96 bmp of your choice
Don't forget to rename it 'default' though

RE: [Release] Change Me! by Spunky on 11-27-2006 at 03:49 PM

They need to be BMP format (or I think DIB?). This new version allows you to select pics to use from a dialog box and also lets you choose colours/font from other dialogs.


RE: [Release] Change Me! by Jimbo on 11-27-2006 at 03:50 PM

quote:
Originally posted by SpunkyLoveMuff
They need to be BMP format (or I think DIB?). This new version allows you to select pics to use from a dialog box and also lets you choose colours/font from other dialogs.
When are you going to release this new version?

RE: [Release] Change Me! by Spunky on 11-27-2006 at 03:53 PM

Well, I did attach it, then I edited it to attach it again after it didn't work... Still not there... So it'll be up as soon as it will upload :s


RE: [Release] Change Me! by Jimbo on 11-27-2006 at 03:54 PM

quote:
Originally posted by SpunkyLoveMuff
Well, I did attach it, then I edited it to attach it again after it didn't work... Still not there... So it'll be up as soon as it will upload :s
Upload to a different place. i really want it lol

RE: [Release] Change Me! by Spunky on 11-27-2006 at 03:56 PM

Download Link for ChangeMe! Version (2.1)

EDIT: Be uploaded in about 30 secs ;)


RE: [Release] Change Me! by Jimbo on 11-27-2006 at 03:57 PM

Not working look:

quote:
Not Found
The requested URL /ChangeMe.plsc was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

EDIT: worked after 3 refreshes


Why has the background colour got a colour window thing, but text colour hasn't
RE: [Release] Change Me! by elektra on 11-27-2006 at 04:03 PM

quote:
Originally posted by Jimbodude
quote:
Originally posted by quacky
Good script, been using it for quite a while now and i was wondering how i work the image feature, when i select it nothing pops up or anything.
so could some one help me...
~thanks~
Go to C:/program filesMessenger plus live/scripts/Change Me/Images
and then change to default.bmp to any 96x96 bmp of your choice
Don't forget to rename it 'default' though

Thanks Jimbodude

does it have to be a 96x96 image?

Suggestion:
Any chance of the script supporting jpegs and pngs soon?
RE: [Release] Change Me! by Jimbo on 11-27-2006 at 04:07 PM

quote:
Originally posted by quacky
quote:
Originally posted by Jimbodude
quote:
Originally posted by quacky
Good script, been using it for quite a while now and i was wondering how i work the image feature, when i select it nothing pops up or anything.
so could some one help me...
~thanks~
Go to C:/program filesMessenger plus live/scripts/Change Me/Images
and then change to default.bmp to any 96x96 bmp of your choice
Don't forget to rename it 'default' though

Thanks Jimbodude

1 does it have to be a 96x96 image?

2 Suggestion:
Any chance of the script supporting jpegs and pngs soon?

1 YES
2 ask spunky

RE: [Release] Change Me! by Spunky on 11-28-2006 at 12:49 AM

quote:
Originally posted by Jimbodude
1 YES

Well, technically now... no. I've extended the scripts functionality to support larger pictures. They get stretched down to size (Note: The colours may distort if it is resized greatly)


quote:
Originally posted by Jimbodude
2 ask spunky
AFAIK, It is impossible to do as the author of the dll only programmed it for Bitmap files.

UPDATE: Doing some work with a dll to try and convert files between types. It should be possible to do all types soon...

RE: RE: [Release] Change Me! by deAd on 11-28-2006 at 12:53 AM

quote:
Originally posted by SpunkyLoveMuffUPDATE: Doing some work with a dll to try and convert files between types. It should be possible to do all types soon...
I believe you can do file conversions with just the Windows APIs, you can call them right from the script.
RE: [Release] Change Me! by dylan! on 11-29-2006 at 02:48 AM

when I re-log it resets configuration :( could u make it so I log and its the same as when i signed out?


RE: [Release] Change Me! by thahim on 12-04-2006 at 06:04 AM

DP image has failed to generate


RE: [Release] Change Me! by Spunky on 12-04-2006 at 11:55 AM

quote:
Originally posted by thahim
DP image has failed to generate

Make sure that the dll is in the script folder:
(C:\Program Files\Messenger Plus Live\Scripts\ChaneMe!\)

Thats the only reason I can see for you getting this message