[Request] Idle Lock - 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] Idle Lock (/showthread.php?tid=69638) [Request] Idle Lock by Eddie on 12-18-2006 at 02:43 PM Would someone be able to make a script that when you have been "idle" for a set amount of time your Messenger Locks?? It was minimally discussed here. Thanks to anyone who can do this RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 02:44 PM markee said he'll give it a try when he has time. But it shouldn't be that hard so I think he will make it very fast . RE: [Request] Idle Lock by markee on 12-18-2006 at 02:47 PM
quote: If you really want it that bad I will do it now, I should have it done before I go to bed . It should hopefully be done within an hour or so... RE: [Request] Idle Lock by Eddie on 12-18-2006 at 02:48 PM Cool thanks guys Was just posting incase he didnt have the time or something RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 02:50 PM I told you it wasn't that hard . RE: [Request] Idle Lock by markee on 12-18-2006 at 03:49 PM
Attached is the script. Unfortunately I cannot detect viewing of messenger or when you are typing in a window so there are problems with that. To overcome this I suggest you use a larger time before it locks. RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 03:51 PM
Cool. Thanks markee. I'll try it . quote:What menu? RE: RE: [Request] Idle Lock by markee on 12-18-2006 at 03:56 PM
quote:Plus symbol > IdleLock > Configure IdleLock EDIT: I realized what I did wrong, not having much luck with the scripts I'm writing today (that and it's just gone 2am). Here is th new vesion, sorry about the other one. RE: [Request] Idle Lock by Plik on 12-18-2006 at 03:57 PM
quote:Why reinvent the wheel? Why not just detect when WLM changes to the idle status and lock messenger then, it would be a lot easy, and make more sense Which, incidently seams to be done here -> [Release] Idle Security RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 03:57 PM Plus symbol > nothing > even more nothing RE: [Request] Idle Lock by foaly on 12-18-2006 at 03:59 PM
quote: that is what I was wondering... RE: RE: [Request] Idle Lock by markee on 12-18-2006 at 04:02 PM
quote: This would require me to turn on "show me as..." in the WLM preferences Though I recommend everyone use this rather than my script as it will be more reliable. RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 04:04 PM What about the menu that doesn't appear? RE: RE: [Request] Idle Lock by CookieRevised on 12-18-2006 at 06:39 PM
quote:The tooltips of the OK and Cancel button are not entirly correct. for the OK button it should be: "Save settings and close the window" instead of just "Save settings" since that is for an Apply button. for the Cancel button it should be "Discard the settings and close the window" since "Don't save settings" doesn't say if you're going to close the window too and can also be interpreted as the new made settings will be used but not saved. -------------------------------------------------------------------- comments on the script (BUGS, improvements, etc): 1) code:Will _always_ fail because Messenger.MyUserId is _always_ undefined here, unless the script is restarted when the user is signed in (aka: never, unless the user has signed in while he modified something in the script and re-saved it, or when the script is enabled for the first time). Thus, never use such code in the global scope of the script. Instead put all this in the OnEvent_Signin() event. 2) code:If you're going to add/start a timer you do not need to cancel it first. Any timer you re-create will be reset already. 3) code:This indeed takes in account that the user can sign out and another user signing in when the timers are still running. BUT, you also have: code:which makes that one of the two is useless (that is: the check in OnEvent_Timer or the whole OnEvent_Signout event). In other scripts I would recommend to remove the OnEvent_Signout event and keep the check in OnEvent_Timer. Because if you do that, a user who temporarly signed out, to let someone else on MSN, can afterwards still sign in and the timers of his will still be running for him. But for this particular script I would remove the check in OnEvent_Timer, since the timer ID will always be the one of the user who set it since you remove the timer in the signout event. 4) code:If you aren't going to use parameters or whatever, you don't need to check and catch them using a regular expression, simply use: code:which doesn't need the resources of a regular expression. Or if you still want to use a regular expression and/or also react on the command when the user has typed something after it, simply remove the parenthesis "(" and ")" (and "$" is also not needed, since you already use ".*"). 5) code:Cancelling the timer here will produce two bugs/unwanted behaviour: The messenger will not be locked when the user has openend the preferences and forgot about it (and went to the toilet for 30 minutes ). And when the user discards the preferences and closes the window, messenger will not be locked anymore after a while. Second, the 'else' part is useless since there isn't another menu item. 6) code:With stuff like this you don't need those parameters, so you might as well just write code:Goes for the rest of those events too. 7) code:Remove this event, since a chat window will also be created when a contact messages you. When this happens, the timer must not be cancelled since someone can still message the user while he is away. When that happens, messenger may never go into lock as long as contacts start messaging (Idle means no user interaction, not no interaction at all). PS: you have this event three times in your script by the way. Same goes for the events OnEvent_SigninReady() and OnEvent_Initialize because Messenger can signout the user at any time and sign him back in automatically without any user interaction. On the opposite, there is a notidle() mssing in the OnEvent_MenuClicked() event, since only a user interaction can click on a menu. So replace the cancelling of the timer (see point 5) with notidle(). 8) code:This should contain a notidle() instead (thus with the check on the variable 'idle'). Though, as you said also, this is not a good way to detect being 'idle' as a whole. It has many flaws (not speaking about the above bugs, but about limitations you can't do anything about it by using such a script). Also, what is not implemented is unlocking messenger when the user starts interacting again (major bug too). To overcome all this you should indeed just detect a status change to and from 'Idle' (also because it is way more consistant with the normal flow of things). RE: [Request] Idle Lock by ins4ne on 12-18-2006 at 09:24 PM Just downloaded the new version and I wanted to brief you that i see the menus now . |