Shoutbox

[Release] Enhanced PSM (Version 2.1) - 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] Enhanced PSM (Version 2.1) (/showthread.php?tid=67679)

[Release] Enhanced PSM (Version 2.1) by Spunky on 10-25-2006 at 06:16 PM

I was working on a new feature for my script when I decided to release it seperatly as well. Until now, the only way to see the colours in your own PSM was to add yourself to you contact list. Ths script creates a ChildWnd object that attaches to the Contact List and displays your PSM in full colour.

Limitations
This version only updates the ChildWnd every 15 seconds so if you resize the contact list it may make the ChildWnd disappear temporarily.

For now, it replaces (actually only hides) the search bar on the contact list.

Needless to say, this will be included in a future release of PSM+. If you leave feedback, I can improve future versions for both the stand alone version and the version included in PSM+

[Image: screenshot.png]
This screenshot is from the "Enhanced PSM" included with "PSM+"

Download Latest Version


RE: [Release] Enhanced PSM (Version 1.0) by MoonGoose on 10-25-2006 at 06:42 PM

The script makes a copy of the PSM and puts over the menu under the psm, so your not able to use it. And I don't get how to use it. Plz work a bit longer with this script...


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:24 PM

The script is supposed to overlay the PSM. I think different size contact lists windows messes up the height/width/x/y calculations. I'll try and work something with them out

You can still edit your PSM though by going to same place you goto edit your name...


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:31 PM

Thanks spunky, very useful for you own PSM+ script as i can see it all in full colour. I agree with moongoose and you should make the colour psm bit editable.


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:32 PM

I can make an option to edit it and so on. I'll release another version soon, hopefully with better compatability


RE: [Release] Enhanced PSM (Version 1.0) by Thor on 10-25-2006 at 07:35 PM

quote:
Originally posted by MoonGoose
The script makes a copy of the PSM and puts over the menu under the psm, so your not able to use it. And I don't get how to use it. Plz work a bit longer with this script...
:O Another norwegian person :O

[/offtopic]

Works ok here, hm.. :/
RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:35 PM

erm, doesn't work for me, but i just looked at the code. Does it only work when you sign in?


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:42 PM

If you look, when the script is started, it check to see if you are signed in and then calls the OnEvent_SigninReady function.

It'll work if you're already signed in when you start the script


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:45 PM

quote:
Originally posted by SpunkyLoveMuff
If you look, when the script is started, it check to see if you are signed in and then calls the OnEvent_SigninReady function.

It'll work if you're already signed in when you start the script
oh ok, but its not, could it be to do with any of the versions i have?

RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:47 PM

Honestly, I doubt it. Dazmatic had the same problem though I think and he was using VISTA.

Check the debug window for any messages. If theres no messages the API is working fine and I don't know why it's not working


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:50 PM

I've got this in the debig window but i don't think it is an error

code:
Script is now loaded and ready
Function called: OnEvent_Initialize
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_SigninReady
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer
Function called: OnEvent_Timer

I still haven't got any colour in my PSM:'(

RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:53 PM

I don't understand why there are so many timer events between the Initialize and SigninReady events. Unless thats the debug from whern you signed in or something... Each timer event should be 1 minute apart (except one which is 100 ms)


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:53 PM

quote:
Originally posted by SpunkyLoveMuff
I don't understand why there are so many timer events between the Initialize and SigninReady events. Unless thats the debug from whern you signed in or something... Each timer event should be 1 minute apart (except one which is 100 ms)
But why isn;y my PSM working. Do you know?

RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-25-2006 at 07:56 PM

It depends. If the ChildWnd object isn't being created properly, it has nothing to set the PSM into. If the box is displayed it should just be a copy or your actualy PSM


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 10-25-2006 at 07:57 PM

quote:
Originally posted by SpunkyLoveMuff
It depends. If the ChildWnd object isn't being created properly, it has nothing to set the PSM into. If the box is displayed it should just be a copy or your actualy PSM
The box isn't even there because i can click my PSM and edit it.

RE: [Release] Enhanced PSM (Version 1.0) by Solar_custom on 10-27-2006 at 09:11 PM

This script seems cool and all but unfortunately I'm having the same problem as Jimbodude. Nothing's working and I'm running Windows XP.


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 10-27-2006 at 10:38 PM

I don't know why this isn't working for everybody. I've experienced minor errors myself and now just find the whole thing annoying. It's not running properly in PSM+ either so I might just abandon the idea... Somebody else must be able to do it though? :p


RE: [Release] Enhanced PSM (Version 1.0) by elektra on 11-12-2006 at 07:04 PM

Can someone please make this script work
i really want it...
I would be really grateful if someone would fix this script


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-13-2006 at 08:37 PM

Updated the script a bit and now it doesn't steal focus etc. It works on my PC so it SHOULD for other people as well. If there are any problems though, let me know

Attachment Removed. Click this link for newest version


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 11-13-2006 at 08:41 PM

Sorry spunky still not working for me
[Image: attachment.php?pid=752984]
[offtopic]
also anyone know why there is a gap between help and plus!
[/offtopic]


RE: [Release] Enhanced PSM (Version 1.0) by elektra on 11-13-2006 at 08:47 PM

Wow got color but can you edit the location because it is showing just below the contact search bar so please look at it


RE: [Release] Enhanced PSM (Version 1.0) by vaccination on 11-13-2006 at 08:47 PM

quote:
Originally posted by Jimbodude

[offtopic]
also anyone know why there is a gap between help and plus!
[/offtopic]

Maybe because you have MDL installed?
RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-13-2006 at 08:48 PM

quote:
Originally posted by Jimbodude
[offtopic]
also anyone know why there is a gap between help and plus!
[/offtopic]

Thats where you should have a Discovery Live menu

Don't know why it isn't working... It annoys ME lol. I think I know a way to do it that should definately work... but thats a job for tomorrow ;)
RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 11-13-2006 at 08:49 PM

quote:
Originally posted by vaccination
quote:
Originally posted by Jimbodude

[offtopic]
also anyone know why there is a gap between help and plus!
[/offtopic]

Maybe because you have MDL installed?
I used to have MDL but not any more.

RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-13-2006 at 08:52 PM

quote:
Originally posted by quacky
Wow got color but can you edit the location because it is showing just below the contact search bar so please look at it

[Image: screenshot.bmp]
It's spot on with mine... Might need to tweak the figures in the script if you want to change it's position


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 11-13-2006 at 08:53 PM

wtf has happened?
[Image: attachment.php?pid=752993]


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-13-2006 at 09:00 PM

Thats my mistake, hadn't even thought about tabs :s Also, something appears to be pushing the window DOWN slightly. Those are the only problems I can see that you have

It also seems that you have not fully uninstalled Discovery Live ^o)


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-13-2006 at 09:36 PM

Sorry to double post, but I've fixed the tab problem mentioned above and you won't notice if it doesn't get bumped :p

Download (All URLs in this thread point to the same file btw)


RE: [Release] Enhanced PSM (Version 1.0) by elektra on 11-13-2006 at 09:57 PM

I still have the tab problem but if youre having the tab problem still
replace line 25,26 to
Interop.Call("user32.dll", "SetParent", CLWindow.Handle, Messenger.ContactListWndHandle);
            Interop.Call("User32.dll","SetWindowPos",CLWindow.Handle,1,49,126,clistwidth-123,20,0);
It should line it up to the search box,,,if its not already


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 11-14-2006 at 07:52 AM

Thanks so much spunky got it working now. Thank you


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-14-2006 at 11:48 AM

As you know, I made a "fix" for the tab problem (You need to wait for the script to refresh the window before it takes affect). Well, it appears I have another problem to overcome. When using a Media PSM, the child window thats created by the script needs to be moved down slightly. I already have a way of detecting if the PSM is a Media PSM so it should be easy enough, though I can't start work on it right now as I'm not at my own computer.

     People above that said it was too high(or low?) was it a Media PSM you were using?


RE: [Release] Enhanced PSM (Version 1.0) by Jimbo on 11-14-2006 at 03:26 PM

quote:
Originally posted by SpunkyLoveMuff

     People above that said it was too high(or low?) was it a Media PSM you were using?
No i wasn't using media psm

RE: [Release] Enhanced PSM (Version 1.0) by Psychotic-Retard on 11-14-2006 at 05:18 PM

i dont even know what media psm is and in my 1 the childwnd is over the search your contacts bar


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-14-2006 at 05:35 PM

quote:
Originally posted by Psychotic-Retard
i dont even know what media psm is and in my 1 the childwnd is over the search your contacts bar

quote:
Originally posted by SpunkyLoveMuff
For now, it replaces (actually only hides) the search bar on the contact list.

And the Media PSM is when it shows media... in your PSM... lol. When it shows music etc...
RE: [Release] Enhanced PSM (Version 1.0) by duck! on 11-14-2006 at 06:33 PM

Suggestion #1
Make the Childwnd stay on it all the time, so you dont have to wait for the childwnd to come up.
suggestion #2
More user friendly postioning..drag and postion or a gui to put pixel size..or selections...EG. over psm,over contact search, over ad search etc
If you add those itll be a brilliant script


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-18-2006 at 02:25 AM

Been working on this for a few hours now so.. TA DA... my magic little GUI for repositioning the little window! You can reposition and resize it now and I've also added a refresh button to refresh the window manually. Decided not to increase refresh rate to greater than 4 times a minute (15 second gap) as unless you use a script to constantly update your PSM, you won't need it (and even then, your PSM is still updating and working fine, it just takes you longer to preview it). Position and size is saved in the registry using DWORDs...

[Image: screenshot.png]

I want you to know that I was pulling my hair out with a couple of lines of code... Just to demonstrate:

code:
if(ControlId=="arrow_left2"){
nudge=10; //just so you know the value
        current = ConfigWnd.GetControlText("txt_width")
        ConfigWnd.SetControlText("txt_width",current+nudge);
        OnConfigEvent_CtrlClicked("", "btn_apply");
    }

If current was 100 for example, it should now say 90... Instead, it said 10010. It was appending it as a string as it was using the + sign. I know in VB that the & sign was more commonly used for that purpose and + was for mathematical equasions. Just pointing this pain in the ass out though. Got it to work by doing this:
code:
if(ControlId=="arrow_left2"){
nudge=10; //just so you know the value
        current = ConfigWnd.GetControlText("txt_width")
        ConfigWnd.SetControlText("txt_width",current-(-nudge));
        OnConfigEvent_CtrlClicked("", "btn_apply");
    }


Took me about 15 minutes to figure it out *-)

Attachment Removed - Click to download newest version
RE: [Release] Enhanced PSM (Version 1.0) by Plan-1130 on 11-18-2006 at 07:41 AM

quote:
Originally posted by SpunkyLoveMuff
current-(-nudge)
That's one way to do it ;)

also changing
code:
current = ConfigWnd.GetControlText("txt_width")
into
code:
var current = new Number();
current = ConfigWnd.GetControlText("txt_width");
I believe this should also work.
RE: RE: [Release] Enhanced PSM (Version 1.0) by phalanxii on 11-18-2006 at 09:37 AM

I know you fixed this, but just to give you some extra knowledge. :) According to MSDN, the "+" operator concatenates all expressions (joins two strings) unless "both expressions are numeric or Boolean". This does not apply to any other mathematical operators though, including the multiplication operator (which can therefore be used to convert strings to numbers). For example:

code:
var Number = "123"; //Number is not a number, but a string with "123"
Number = Number + 56; //The addition operator has concatenated the strings "123" and "56" into "12356", not "179"
Number = Number * 1; //The multiplication operator has converted Number into a Number object
Number = Number + 25; //Number is a Number object, so the addition operator results in 12356 + 25 = 12381
This means that you could alternately have converted your string into a Number by doing this:
code:
if(ControlId=="arrow_left2"){
   nudge=10; //just so you know the value
   current = ConfigWnd.GetControlText("txt_width")*1
   ConfigWnd.SetControlText("txt_width",current+nudge);
   OnConfigEvent_CtrlClicked("", "btn_apply");
}
Note that in the original code, ConfigWnd.GetControlText("txt_width") is actually a string, thereby concatenating current+nudge, instead of adding. By adding the *1, current becomes a Number and the addition works normally.

The reason why current-(-nudge) also works is because the subtraction operator functions mathematically regardless of whether either expression is a string (like the multiplication), so when you use it, the current string is automatically converted to a Number object. The addition operator, on the other hand, tried to join the current string with the nudge number into one long string, instead of adding them like numbers.

Hope this helps make it easier for you to script with numbers! :P(Y)

NOTE: I haven't looked through the script, but if the nudge variable is a string as well, that also needs to be converted into a number! Be careful to note that nudge=10 is different to nudge="10"! The first is a number, the second is a string!

EDIT: Hehe... missed by a minute, Mattike! :P
RE: [Release] Enhanced PSM (Version 1.0) by Matti on 11-18-2006 at 09:38 AM

The thing is that the '+' operator can be used for both numbers as strings. And because it's more common to add a number in a string than to add a string to a number, JScript converts the number to a string and then combines the two strings.

A good workaround (and probably the easiest) would be:

code:
if(ControlId=="arrow_left2"){
nudge=10; //just so you know the value
current = 1*ConfigWnd.GetControlText("txt_width");
ConfigWnd.SetControlText("txt_width",current+nudge);
OnConfigEvent_CtrlClicked("", "btn_apply");
}
This will first try to multiply the text by 1. Since the '*' operator can only be used on numbers, JScript converts the string to a number and then saves the value. Then, on the next line, you have an expression with 2 numbers, and that will result in adding those 2 numbers. ;)

However, the previously suggested methods will work too, but in my opinion (and some other script developers' opinions too) this method is the easiest you can find. If you think some other method is better, you're free to use the method of your choice, it's up to you. :)

EDIT: Damn, phalanxii beat me once again. :(
RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-18-2006 at 07:04 PM

Thanks guys. That is quite a simple solution. I may as well leave my code for now though as it's working fine.

If anybody has any feedback from the script, give me it so I can start on suggestions and improvements etc


RE: [Release] Enhanced PSM (Version 1.0) by elektra on 11-19-2006 at 10:44 AM

When this script starts, it doesnt start and in script debugging it came up with this
Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Error: unknown.
       Line: 139. Code: -2147418113.
Function OnEvent_Initialize returned an error. Code: -2147352567
Function called: OnEvent_SigninReady
Function called: OnEvent_Timer
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_Timer returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567
Function called: OnEvent_MyPsmChange
Error: 'sMyRegPath' is undefined.
       Line: 188. Code: -2146823279.
Function OnEvent_MyPsmChange returned an error. Code: -2147352567


RE: [Release] Enhanced PSM (Version 1.0) by Spunky on 11-19-2006 at 02:04 PM

Forgot to declare a var as global. Did same thing in PSM+ script until it was pointed out by a tester


RE: [Release] Enhanced PSM (Version 2.1) by elektra on 11-19-2006 at 03:49 PM

Thanks SLM its works when i sign in now :)
great script