Shoutbox

Idea for a script... - 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: Idea for a script... (/showthread.php?tid=64480)

Idea for a script... by Spunky on 08-05-2006 at 01:54 AM

Just making a script at the moment that displays how many chat windows are open at one time in the PSM box and was wondering if anybody thinks it's a worthwhile idea to develop it more and release it? At the moment, when there are 4 or more windows open, it displays a little status message alongside the count in the PSM saying "Busy" and so on...

It all works fine at the moment, but I'm adding option to turn it on and off and it's undergoing some "tweaking"... Just let me know :P


Beta version of this script


RE: Idea for a script... by Huhu_Manix on 08-05-2006 at 02:05 AM

You can create a window to modify the PSM and use tag ( as "%chat" for the number of opened chat ).
So the user'll be able to choose his PSM.


RE: Idea for a script... by Voldemort on 08-05-2006 at 02:38 AM

yep, and mention the nicknames of the people you are talking too :p


RE: Idea for a script... by cloudhunter on 08-05-2006 at 02:46 AM

Optional of course ;)


RE: Idea for a script... by matty on 08-05-2006 at 02:52 AM

code:
function OnEvent_ChatWndCreated(pChatWnd){
    Messenger.MyPersonalMessage = ChatWnds.Count;
}

function OnEvent_ChatWndDestroyed(pChatWnd){
    Messenger.MyPersonalMessage = ChatWnds.Count;
}

Fun 8-) :P
RE: Idea for a script... by cloudhunter on 08-05-2006 at 03:21 AM

Heh ;) But the real thing is making it customisable with a gui etc ;)

Cloudy


Idea for a script... by Spunky on 08-05-2006 at 11:10 AM

quote:
Originally posted by Matty
code:
function OnEvent_ChatWndCreated(pChatWnd){
    Messenger.MyPersonalMessage = ChatWnds.Count;
}

function OnEvent_ChatWndDestroyed(pChatWnd){
    Messenger.MyPersonalMessage = ChatWnds.Count;
}




I suppose that would be the easy way to do it, but it doesn't look very nice does it? Also, it's not customizable and doesn't really explain what the number means to other people...
______________________________________________________

I'm in the process of making a GUI to be able to edit options.

Going to add:
On/Off Option
Customized String - using %chat (and possibly %status)
Customze number of chats before "Busy" Message

Voldemort, you wanted to display the names of people you were talking to. I don't know if this is to be displayed to you or your other contacts so let me know and I'll add it. (Y)

Going to use Plus! Window Designer to make the interface just so I can see what it's like... I didn't mind entering numbers in and editing it pixel by pixel though 8-|


EDIT: I'm trying to setup some default values for the settings window and store them in the registry. Is there a way to make sure that this only happens the first time the script is run? If I was to just to call the function when the settings window is called, it would overwrite any settigns the user had saved. I've tried checking the value of the ReadRegistry function but it just causes an error and just doesn't trace.

EDIT 2: I've added the custom stuff. You can change how many chat windows have to be open in order for the status message (also custom) to change.  You can edit the string using the commands "%chats" and "%status". As of yet there is no way to turn it on or off or save settings. To access the settings window type "/ocsettings" (I am aware that this cause an error... I'm looking into it).  It's obviously not finished so theres errors (such as it saying "1 chats open")... There's nothing serious so try it and let me know. You cannot customize the "Available" text yet without actually editing the code.  If you do edit my code, bare in mind that I've been making it so that people can learn from the code, but I still haven't documented what each function does very well and the code is a bit of a mess... :P


RE: Idea for a script... by bugmenot on 08-05-2006 at 04:55 PM

I tried it and its cool but it doesnt work properly if you use the %chats part way through the string. It only works if its at the start.


RE: Idea for a script... by Huhu_Manix on 08-05-2006 at 05:19 PM

Your function makestring(referer){} is...special !

Why don't you use :

code:
string = string.replace("%chat", Messenger.CurrentChats.Count);

RE: Idea for a script... by Spunky on 08-05-2006 at 05:25 PM

Hmmm... :D

I'm very basic at the moment. I only really just started scripting so I'm not great. It works though ;) So I'm not too bothered as long as the code works and it's not too slow.

The reason for the makestring(referer) is that when you destroy a window, the count is wrong and is actually one higher than it should be... So if a window gets destroyed, the referer is "D" and an extra 1 is taken off the count.

As for the problem with putting %chat in the middle of a string... This could be caused by a trailing space after the previous word... I may just use the string.replace function rather than an array *-) Let's see how long this take me to get to work :P

EDIT: %Chat now works in the middle of the string... Don't ask me why :D If you were to look at the code, it'd probably confuse you too...

As for the string.replace code you gave me... it just replaces it with a " ". I think I'll stick with my useless code, but thanks anyway