What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Release] Enhanced PSM (Version 2.1)

Pages: (5): « First « 1 2 3 [ 4 ] 5 » Last »
[Release] Enhanced PSM (Version 2.1)
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. RE: [Release] Enhanced PSM (Version 1.0)
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?
<Eljay> "Problems encountered: shit blew up" :zippy:
11-14-2006 11:48 AM
Profile PM Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
RE: [Release] Enhanced PSM (Version 1.0)
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
11-14-2006 03:26 PM
Profile E-Mail PM Find Quote Report
Psychotic-Retard
New Member
*

Avatar
omg grim reaper beat me at poker!

Posts: 10
– / Male / –
Joined: Nov 2006
RE: [Release] Enhanced PSM (Version 1.0)
i dont even know what media psm is and in my 1 the childwnd is over the search your contacts bar
look! a dancing turtle! [Image: 732892778440cb32d008927mt.gif]      [Image: lostjokewg2.gif]

11-14-2006 05:18 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. RE: [Release] Enhanced PSM (Version 1.0)
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...

This post was edited on 11-14-2006 at 05:35 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
11-14-2006 05:35 PM
Profile PM Find Quote Report
duck!
Senior Member
****

Avatar

Posts: 546
Reputation: 27
– / Male / Flag
Joined: Sep 2006
RE: [Release] Enhanced PSM (Version 1.0)
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
QUACK QUACK QUACK

11-14-2006 06:33 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. RE: [Release] Enhanced PSM (Version 1.0)
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

This post was edited on 11-19-2006 at 02:12 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
11-18-2006 02:25 AM
Profile PM Find Quote Report
Plan-1130
Full Member
***

I keep askin' myself: why?

Posts: 142
73 / Male / –
Joined: Feb 2005
RE: [Release] Enhanced PSM (Version 1.0)
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.

This post was edited on 11-18-2006 at 07:48 AM by Plan-1130.
My Scripts: UltimatFlooder, Advanced PSM Chat, PlusPrivacy, PlusRemote

[Image: Plan-1130.png]
11-18-2006 07:41 AM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: RE: [Release] Enhanced PSM (Version 1.0)
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

This post was edited on 11-18-2006 at 09:43 AM by phalanxii.
11-18-2006 09:37 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [Release] Enhanced PSM (Version 1.0)
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. :(

This post was edited on 11-18-2006 at 09:39 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
11-18-2006 09:38 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. RE: [Release] Enhanced PSM (Version 1.0)
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
<Eljay> "Problems encountered: shit blew up" :zippy:
11-18-2006 07:04 PM
Profile PM Find Quote Report
Pages: (5): « First « 1 2 3 [ 4 ] 5 » Last »
« 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