What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script query

Pages: (2): « First [ 1 ] 2 » Last »
Script query
Author: Message:
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
O.P. Script query
Okay.....so for the next step in my script (having overcome the menu hurdle!)...i'm trying to get it to add a list of e-mail addresses to a RichEditControl (one at a time, via an input box)

I can get it so that the edit control reads collects its input successfully from the first box on the press of a button.

However I then want it to add the second e-mail on a new line

This might be a bit pointless depending on the answer to the following question:

Can a script read back seperate lines from edit controls in order to put them through other commands?

I'm creating a script which will automatically change your status to a defined status whenever a certain contact signs in...and I want the user to be able to use the options window to define what their status will be changed to for what contact.

So for example you input contacta@hotmail.com and the status Online and then contactb@hotmail.com and the status Appear Offline.

What I would like is the e-mails to be listed in one control box and the status in another and then for them to be read back through the main bit of code
code:
if ( sEmail ===  e-mail address Messenger.MyStatus = status; )


.....but i would like it to read e-mail address and status from corresponding lines of text boxes

Can this be done?  Because if not i'll have to re-think the way I get users to add (and remove.....crap, hadn't though of that) entries.

Edit: Having thought about it I really don't think it will work practically speaking.

Can anyone come up with a better idea of how I can let the users have input over which contacts this applies to and how to add/remove that data?

It's my first script so I'm struggling a little with the implementation of it!

This post was edited on 01-21-2009 at 02:33 PM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5250 days, 5 hours, 39 minutes, 25 seconds ago
01-21-2009 02:25 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Script query
You can do it that way using the Rich/EditControl or a ListBoxControl. The ListBoxControl would be a better method for this however for the Rich/EditControl you can read the string and split the string on \n which would then cause the string to be converted to an array where each line would be a slot in the array.

For instance
Javascript code:
var str = 'this\nis\nsome\ntext';
Debug.Trace(str);
var array = str.split('\n');
Debug.Trace('the length of the array is: '+array.length);
for (var a in array) Debug.Trace('Array position ('+a+') contains the data: '+array[a]);

01-21-2009 03:24 PM
Profile E-Mail PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
O.P. RE: Script query
Okay, i've changed it to a ListBox as i think this might help a LOT with accomplishing what I'm trying as I've got other things working properly (such as deleting items and adding into two list boxes (one for e-mail, one for status)

I've almost got the ListBox set up, however what I can't get it to do is read/write to/from the registry.

I basically need all the items in the listbox to be stored and then put back into it when saving/reloading the form.

This was working previously when it was a RichEdit control, I'm just not sure what commands to use to do it properly.

Following this I think all I'll need is to know how to feed everything back into the initial piece of code (as shown above).


Edit: The statuses show in the list box at the moment as numbers (relating to the number item they are in the listbox......however they kinda need to be parsed as 'STATUS_ONLINE', etc.....how can I accomplish this?  Also how can I get them to show in the listbox as their item name, rather than number

This post was edited on 01-21-2009 at 04:52 PM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5250 days, 5 hours, 39 minutes, 25 seconds ago
01-21-2009 04:48 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Script query
quote:
Originally posted by djdannyp
Edit: The statuses show in the list box at the moment as numbers (relating to the number item they are in the listbox......however they kinda need to be parsed as 'STATUS_ONLINE', etc.....how can I accomplish this?  Also how can I get them to show in the listbox as their item name, rather than number

Javascript code:
var status = new Array("Unknown", "Offline", "", "Online", "Busy", "BRB", "Idle", "Away", "In A Call", "Out to Lunch"); // I think I got them in the right order
 
Debug.Trace(status[Contact.Status]); // Obviously, you have to enumerate contacts to get the status...


EDIT:

We make an array called "status" and populate it with the values. As an array is 0-based, The first item (at index 0) is "Unknown". If you look in the scripting docs, the number to represent "Unknown" is also 0, which is why we placed it first. 1 Represents "Offline" and so on... 3 is blank as it is not used in this situation.

So when we Trace the status, we pass the Contact.Status similar to a parameter in a function. If the contact status is 6 (Idle), it would be the same as:

Javascript code:
Debug.Trace(status[6]); //Which would trace "Idle"



This post was edited on 01-21-2009 at 06:38 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
01-21-2009 06:01 PM
Profile PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
O.P. RE: Script query
I think you're gonna have to explain it a bit simpler than that :P

also, which part does this do?  does it return them as text items in the listbox......or does it allow me to put them through the original bit of code?

and how can i do whichever part of this it doesn't let me do?
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5250 days, 5 hours, 39 minutes, 25 seconds ago
01-21-2009 06:24 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Script query
quote:
Originally posted by djdannyp
I think you're gonna have to explain it a bit simpler than that :P

also, which part does this do?  does it return them as text items in the listbox......or does it allow me to put them through the original bit of code?

and how can i do whichever part of this it doesn't let me do?
That bit will convert the status to the text equivalent.

matty's reply to Tips << Registry access

This post was edited on 01-21-2009 at 06:25 PM by matty.
01-21-2009 06:24 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Script query
Edited my post above to make it clearer (I hope)
<Eljay> "Problems encountered: shit blew up" :zippy:
01-21-2009 06:39 PM
Profile PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
O.P. RE: RE: Script query
quote:
Originally posted by matty
quote:
Originally posted by djdannyp
I think you're gonna have to explain it a bit simpler than that :P

also, which part does this do?  does it return them as text items in the listbox......or does it allow me to put them through the original bit of code?

and how can i do whichever part of this it doesn't let me do?
That bit will convert the status to the text equivalent.

matty's reply to Tips << Registry access

I'm not sure how or where to use it though :S

I get the creating the array bit.......I'm just not sure how to use it on that window to change the number outputted by the ComboBox into the relevant text....and then again how to get it parsed by the original code statement

As for the registry thing, I've taken a look but i'd have a lot of code to re-write...and i only just about got it there in the first place :S

It's like 90% working using Plus' own registry reading/writing bit, I just don't know how to do it with a listbox

I can't get this other thing to work.  I've added the .js file that you linked to......but I don't know what properties to put in..for example at the moment I have

code:
sEmails = oWScript.RegRead(MsgPlus.ScriptRegPath + sEmail + '\\emails');

which reads the list of e-mails from the registry in order to put them back into the settings window (or at least it did when it was a rich edit control!).....but I don't know what to put in order to get it to read from the same paths...i've tried a few things and it just comes up "Error: Object expected (code: -2146823281)"

Is there a way to accomplish what I want without having to include the extra thing as I already have most of it done......I just need to know how to get it to work with a listbox....and how to feed the input back into the original code statement

This post was edited on 01-21-2009 at 06:44 PM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5250 days, 5 hours, 39 minutes, 25 seconds ago
01-21-2009 06:42 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Script query
quote:
Originally posted by djdannyp
It's like 90% working using Plus' own registry reading/writing bit, I just don't know how to do it with a listbox
Plus! doesn't have read/write access to the registry... you would be using the ActiveXObject to do it...

The registry module I posted wouldn't need any changes to be used but whatever...

What exactly is it you are currently trying to accomplish and what is the code you are using? (Would be best just to post the PLSC).
01-21-2009 07:49 PM
Profile E-Mail PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
O.P. RE: Script query
Yeah, I'm using the ActiveX thingy

What i'm trying to accomplish is a script which changes your status to a pre-defined status for a contact coming online, so in the listboxes (labeled emails and statuses) it would read like this:

emails                                       statuses
Contact1@hotmail.com               Online
Contact2@hotmail.com               Away
Contact3@hotmail.com               Idle
Contact4@hotmail.com               Appear Offline
Contact5@hotmail.com               Online

I already have it working such that it will read the e-mail address from the registry (however only one, as i put it there manually) and change my status back to online (just set manually in the script to test, thus far)

The desired outcome is that the user inputs a list of contacts and statuses that get written to the registry (to save the settings), then each time they load the settings form, the items are re-loaded (where they can be succesfully deleted) and that the items are then read from the registry back into the main bit of code which initialises on contact signin.

the only things I need sorting are:

[*]Getting proper names intead of numbers into the statuses listbox
[*]Reading/Writing to/from the registry to/from a ListBox (existing code is for a RichEditControl)
[*]Reading from the registy into the code, matching up each e-mail address with its status.

That's about it I think, it feels like I'm so close I'd prefer it if you can give me a few more pointers rather than just fixing the plsc for me as I'd like to learn. 

I've attached it anyway, but I'd like it if you can give me some pointers on how to fix it myself (albeit very basically explained pointers), rather than just posting a working plsc (although I wouldn't mind the latter if it's really the easiest way, as I can study the differences to learn from)

You'll both get credit in the release anyway :)

(Oh, and anyone else if they manage to help significantly first)

.plsc File Attachment: Auto Status.plsc (13.5 KB)
This file has been downloaded 60 time(s).
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5250 days, 5 hours, 39 minutes, 25 seconds ago
01-21-2009 08:10 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » 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