Shoutbox

[Request] Fast & Simple Away/Busy System :) - 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: [Request] Fast & Simple Away/Busy System :) (/showthread.php?tid=64667)

[Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-08-2006 at 06:23 PM

I was wondering is there a small script, that when you set yourself to Away or Busy, a small window will popup asking you:

[Reason: off to work!               ]

and when somebody messages you, it will display only once to each that you are >

Auto Reply: off to work! (Set 5h 31min Ago) < that part would be nice
---
Not having to use the Personal Status Option at all :)


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-08-2006 at 06:38 PM

I'll have a go at it for you now... Might take about an hour or 2 :D


RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-08-2006 at 06:39 PM

sweet :) take your time.


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-09-2006 at 03:40 PM

Sorry for the delay... The script is complete, except for so far the message send everytime the contacts sends you a message. Working on it now :D


RE: [Request] Fast & Simple Away/Busy System :) by problem-solver-wlm on 08-09-2006 at 03:46 PM

i would love this script because im lazy to do the personlized status.


RE: [Request] Fast & Simple Away/Busy System :) by RaceProUK on 08-09-2006 at 03:49 PM

Sorry to spoil the fun, but doesn't '/away Off to work!' set 'Off to work!' as an auto-responder?


RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-09-2006 at 04:45 PM

it probably does, but i'd say just clicking 'away' .. and entering a msg, most people would rather do, that and.. maybe you don't want to have to open somebodys window... what if you aren't talking to anyone? :)

*it also doesn't say how long your away has been set for.

*open somebodys window, what if they use the open window notifier script  :)


RE: [Request] Fast & Simple Away/Busy System :) by problem-solver-wlm on 08-09-2006 at 06:53 PM

any news on the script?
:D:):):D


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-09-2006 at 06:54 PM

Working on the last part now... Possibly "finished" in about 20 mins


RE: [Request] Fast & Simple Away/Busy System :) by cloudhunter on 08-09-2006 at 06:55 PM

Meh, it's not much effort to open someones window, say /away off to work and then close it again.

problem-solver-wlm: Wait for people to report progress, rather than asking for it.

Cloudy


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-09-2006 at 07:09 PM

Ta da! Big fanfair if you please! :D Works locally on my PC. Accesses the registry a lot so just check to make sure that your computer doesn't slow down too much (shouldn't do :p)

Just set status to "Busy" or "Away" in either Contacts List Window or Chat Window and a window will open up asking for the reason. When a user sends you a message, it auto-replies with your status, reason and time since the message was set.


RE: [Request] Fast & Simple Away/Busy System :) by problem-solver-wlm on 08-09-2006 at 07:19 PM

brilliant thanks should upload it to the script database if you havnt already


EDIT:ok working fine so far tried it and using it good script


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-09-2006 at 07:20 PM

I'll wait for people to report all the errors before I do that :p Just a little bit of feedback though and I should upload it


RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-09-2006 at 08:00 PM

works alright it seems... still testing it :)

it appears normal looking on my end with plus! installed (fonts/bold):

artfuldodga - Auto Reply: (Away) Reason: tv / food (Set 0hrs 0mins 51s Ago)

but, to the user who sent you a msg, and isn't using plus .. the bold code & color code, are of course visible & unchanged for them, i suggest using that purple color on the entire message.. & nothing more by default, let the users insert their own color codes. perhaps have an

Away > Settings .. and in there change things like, how they want it to be displayed, colors, font .. inserting color codes into the message..  if you want to use any at all, etc.

script replyed 'once', thats good... but it also should reply again, if
the contact that messages you, goes offline... and comes back, reply 'once' per session .. is what i mean.

off testing :P

edit1: if you are already set 'away' with a reason, but change your status to 'busy' and enter another reason, the script wont reply to that same user, your new reason for now being busy. (also should reset the count, when this is fixed)

edit2: setting yourself from away or busy back to 'online' and back to 'away' works fine, new reply is sent back to a user who msgs you.

when a user gets your msg in his/her messenger without plus! they receive:

some tag  - Auto Reply: (Away)  Reason:  eating trees (Set 0hrs 0mins 20s Ago)

but, if they paste to you, your own reply that poped up for them (without plus installed, they see the tag you used), your nickname in front, turns into their own :) .. when pasted back to you :P should use some other tag for this i think.. or no tag at all when sending to your contact, if you can't use anything but your nickname tag, give us an option to set our nickname to use in the reply msg.

artfuldodga          - Auto Reply: (Busy)   Reason:    eating trees       (Set    0hrs 7mins 45s     Ago)

pasted back to you (other users email or nick appear)

*****@hotmail.com          - Auto Reply: (Busy)   Reason:    eating trees       (Set    0hrs 7mins 45s     Ago)

Good Job, BTW :)



RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-09-2006 at 08:41 PM

Ok the reason the name changes when copied and pasted is because it's using the "/me" command to display your name (this is also what makes the font purple).  I dont see why they would be copying and pasting it back to you anyway... :p I used this as otherwise it would say:

SpunkyLoveMuff says: (example)

I will add a function so that if the contact goes offline they will see the message again.


RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-09-2006 at 08:46 PM

yeah, guess i was being nit picky :) about the pasting back :P hm..

what does personalized status use, when it replys? i wonder.. take a look now

could probably just use

(color of choice)

Auto Reply (Away) Reason: blah blah ( 0hr etc ...

hard to explain, i just saw how Personalized Status replys to a user without Plus!, and on your own end its ... artfuldodga      auto-message: busy, but on their end its

artfuldodga says:
auto-message: busy

edit: .. no idea how this works really :) hehe i think it appears normal looking to thos without Plus! ex) the above paste .. and for thos with plus

artfuldodga auto-message: busy

i guess we do need this script to work in the same way, plus the elapsed time part.

however, i see nothin wrong with:

SpunkyLoveMuff says:
Auto-Reply etc etc ... as long as we can choose a diff color than our fonts are for typing.

only because, when you reply to a user without Plus! installed its this weird symbol :P anyway.. not your nickname.


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-11-2006 at 05:15 PM

If you want to choose different colours, people would be able to see the [c=?] tag the same way you can see the [b] tag if they don't have Plus!  I gotta ask a question about this anyway :p


RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-11-2006 at 05:30 PM

I meant if you go the other way :) without using Plus! tags

Contact Says:
Auto-Reply (Away) Reason: Drinking (Set 5h 20m Ago)

^
Color using a font that WLM supports :) & skip the hassle all together with the /me etc.


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-11-2006 at 05:33 PM

I think I understand what you mean :p

I don't think you can change font colour without using Plus! colour tags though... WLM doesn't have any tags that you can sue and applies formatting to the whole message


RE: RE: [Request] Fast & Simple Away/Busy System :) by CookieRevised on 08-12-2006 at 09:09 AM

some tips

quote:
Originally posted by SpunkyLoveMuff
Accesses the registry a lot so just check to make sure that your computer doesn't slow down too much (shouldn't do :p)
Rethink your whole script/logic to avoid that.

You do not need to access the registry that many times like you do (every second), that's rather useless...

In fact, you don't need to use the registry at all. There is no reason why you should save the time to the registry when the status is set and especially no reason to save the elapsed time every second to the registry only to read it out when you recieve a message.

Instead, get the time as soon as the status changes and save that to a global variable. When you recieve a message, work out the elapsed time from that saved variable using the current time. No need for registry access at all in that way (and much more logic)...

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

PS: intend your scriptlines with tabs, it is a pain in the rear end to view/edit your script as-is ;)

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

additional note: the intention of the script is nice. But maybe also make a script which simply adds some additional tags to Messenger Plus! so the user can use those tags (time since status was activated) inside the already existing away message system of Messenger Plus!.

Remember that there are already tags the user can use (!PS_R), (!PS_RH), (!PS_RM) and (!PS_RS) for the remaining time, so simply make a script which adds (!PS_E), (!PS_EH), (!PS_EM) and (!PS_ES) for elapsed time.

And remember that there are already shortcuts available for customized statusses, quicktexts you can use to shorten the command to activate an away status, etc.
RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-12-2006 at 11:58 AM

Ok, I'll change some of things around. The reason for using the registry a lot is because globsl variables just didn't seem to be working (would change to undefined when read from a function).

I didn't realise there was a way to use a date or time object... Might have to look into that then as well now :p

Thanks for the input :D


RE: [Request] Fast & Simple Away/Busy System :) by CookieRevised on 08-12-2006 at 01:13 PM

If a global variable is 'undefined' when you read it inside a function it is most likely not a global variable in the first place or wrongly declared to begin with.

Seeing some of your code, you indeed have some trouble with that.
Remember that every variable you use must be declared first. If you don't do that JScript will do it for you but this makes bad code and is prone to mistakes and confussion (as shown in your code with the 'Window' variable.)

The first time you use a variable make it a habit to always declare it using the 'var' statement. Depending on where this var statement occurs it is a global variable (when the declaration is done outside a function) or a local variable (when it is done inside the function; and this means the variable will only be valid inside this function).

Also don't confuse parameters of funtions with variables, those are two different things (again refering to the use of the 'Window' variable inside the OnMainEvent_CtrlClicked function which is of no need since 1) it isn't delcared properly and 2) the function already passed the window object as a variable).

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

Your script has, besides the stuff I already said, other issues as well.

Eg: when contacts are added or removed from the contact list, your script will leave entries for those contacts in the registry or even malfunction.

Eg: In convo's with multiple contacts your script doesn't behave as intended.

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

PS: also the XML file has same strange things in it, making me believe you copied it from somewhere else maybe (?)...

No need for the global colors definition.
Also the name value of the interfaces tag seems a bit strange...

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

Attached is the rewritten and optimized script (without the use of timers and registry (and also compatible with Plus!3 format codes)).

If you wish you can take a look at it, and use it. If you don't wish and want to do it all yourself first, ignore it for now ;)

EDIT: updated, editing 1 line to be even more shorter....


RE: [Request] Fast & Simple Away/Busy System :) by Spunky on 08-12-2006 at 03:33 PM

Thanks a lot, thats fantastic!

The XML file was either generated by XMLSpy using the Schema or was borrowed from another file. I use the same XML file for most of my interfaces and just change controls and things.

I've been using ActionScript (Flash) for too long now. When using global variables I'd just use

code:
_root.myVar = "blah";
Obviously, not possible with this.

I have declared variables out of functions etc in other scripts but didn't define the type so just using something like
code:
var Myvar;
var myVar = "";


I've taught myself a lot of languages, but rarely get past the basics.
This is (after Java) one of the hardest to get used to, probably because it seems to borrow some parts from other languages, but not others :p

I like to learn though and I also like to help, so I'll keep trying :D
RE: [Request] Fast & Simple Away/Busy System :) by artfuldodga on 08-12-2006 at 04:58 PM

nice job on the script CookieRevised :)

edit: for some reason, after.. i set busy away... busy.. a bunch of times, restarted messenger, the scripts popup window asking you for the reason, won't popup asking anymore, however it does set me to away .. just with <no reason> (i did edit the script so it didnt use the /me command, and took out the bold tags, dont' know if that had any affect, worked for a bit :)


RE: RE: [Request] Fast & Simple Away/Busy System :) by CookieRevised on 08-12-2006 at 05:37 PM

quote:
Originally posted by SpunkyLoveMuff
I have declared variables out of functions etc in other scripts but didn't define the type so just using something like
code:
var Myvar;
var myVar = "";


That's no problem.

The value assigned to the variable isn't important (JScript changes the type of the variable on the fly if it needs to be anyway), as long as it is declared with the var statement that's enough....

I assigned values to the global variables using the new operator in the script I attached because:
1) it is easy to see what the variable is going to be used as.
2) it also initializes the variables to the proper values (especially important for the DateTimeSet variable which is assign the current date and time at that point when the script initializes).

;)

quote:
Originally posted by rockie
edit: for some reason, after.. i set busy away... busy.. a bunch of times, restarted messenger, the scripts popup window asking you for the reason, won't popup asking anymore, however it does set me to away .. just with <no reason> (i did edit the script so it didnt use the /me command, and took out the bold tags, dont' know if that had any affect, worked for a bit :)
The error is mostlikely on your part (missing the popup window because it is behind other windows for example) since as you can see from the code, nothing can go wrong with it as it is very very very basic:
code:
function OnEvent_MyStatusChange(NewStatus) {
        // Reset stuff
        Reason = "";
        CheckArray.length = 0;
        DateTimeSet = new Date();
        // Show reason window when status is away or busy
        if (NewStatus === 4 || NewStatus === 7) {
                MsgPlus.CreateWnd("interface.xml","Main");
        }
}
It does nothing more than resetting the reason, the array with emails to check and the datetime each time you change status. And if the new status is either Away or Busy it shows the popup window.

In fact, since it shows the popup each time you change status to away or busy and since you didn't set any reason, you mostlikely would ended up with a whole bunch of popup windows (this can be overcome by adding a check for it before the window is created though; but that isn't the issue here).

(also note that the script doesn't set any status, it reacts on status change)