What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » New to Plus! scripting :).

Pages: (2): « First [ 1 ] 2 » Last »
New to Plus! scripting :).
Author: Message:
Buzz44
Junior Member
**

Avatar
Messenger Plus! Newbie ^^

Posts: 18
– / Male / –
Joined: Aug 2006
O.P. Grin  New to Plus! scripting :).
Ahoy there!

I only just found out that Messenger Plus! existed 3 days ago and I am looking to create my own script already because its uber good ^^.

The script is already in progress but I am not happy with the startup procedure. Currently I am using OnEvent_Initialize() testing whether the return value is True or False. If False, I initiate my variables and everybody is happy, but if True, I start a timer, using OnEvent_Timer to wait for the timer to trigger, and then initiate my variables.

The problem is the variables involve Messenger.MyName and Messenger.MyPersonalMessage and if the timer doesn't fuction as correctly I get errors because Messenger.MyName etc are not recognised. I may or may not got errors depending on whether; The CPU has just booted up and WML is s et for auto-login, WML is already running (but signed out) and you are signing in, or, you have just started WML and it is signing in automatically.

Depending on which of the above it is, WML takes longer to sign in the and timer trigger event may fire early then expected thus yielding errors. Ofcourse the obvious solution would be to increase the timer interval but I found the whole idea of using a timer worrying, because it is a very unreliable method of testing whether WML is ready or not.

I have 2 questions...

1) In JScript is there a key/reserved word to exit an Event function? For instance, OnGetScriptMenu, if I used a keyword (much like Return or Exit Sub in VB.Net), it will exit the function immediately and..

2) Is there a universal template someone has to accommodate the different situations that the script may start in, ie. CPU booting up, WML starting and WML signing in.

Sorry I can't post any code atm as I'm not at home but give me a few hours and I will ;).

Any help would be appreciated :).

08-31-2006 04:58 AM
Profile E-Mail PM Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: New to Plus! scripting :).
I believe there is an "OnEvent_Signin" Which might suit your needs...

Cloudy
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6887 days, 8 hours, 22 minutes, 41 seconds ago
08-31-2006 05:02 AM
Profile E-Mail PM Find Quote Report
Buzz44
Junior Member
**

Avatar
Messenger Plus! Newbie ^^

Posts: 18
– / Male / –
Joined: Aug 2006
O.P. RE: New to Plus! scripting :).
Yes, but that won't work if the user is already signed in and they import the script. Thanks anyway ;).

Edit:

Thats why I wanted to know if there was a universal method, or an End Function keyword ;).

This post was edited on 08-31-2006 at 05:11 AM by Buzz44.
08-31-2006 05:04 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: New to Plus! scripting :).
OnEvent_SigninReady ?

There isn't really a way to do what you want, unless I am just too tired/drunk and not understanding what you want.
08-31-2006 06:12 AM
Profile E-Mail PM Find Quote Report
Buzz44
Junior Member
**

Avatar
Messenger Plus! Newbie ^^

Posts: 18
– / Male / –
Joined: Aug 2006
O.P. RE: New to Plus! scripting :).
Yes I seen that, and though it is one better then OnEvent_Signin(), it will still only trigger when the user is signing in, not when the user imports the script. I know ways to get around the problem but that means I will have redundant code which I really don't want.

P.S Maybe you are too drunk ^o)?
08-31-2006 07:34 AM
Profile E-Mail PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: New to Plus! scripting :).
quote:
Originally posted by Buzz44
Ahoy there!
1) In JScript is there a key/reserved word to exit an Event function? For instance, OnGetScriptMenu, if I used a keyword (much like Return or Exit Sub in VB.Net), it will exit the function immediately and..


yes that is return;

and why not use the OnEvent_Signin() and just check if it is the first time the script is used (so imported..) with a reg code or something... and activate it manually only that time?
not the most beautiful solution... but it will work...
08-31-2006 08:03 AM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: New to Plus! scripting :).
quote:
Originally posted by foaly
why not use the OnEvent_Signin() and just check if it is the first time the script is used (so imported..) with a reg code or something... and activate it manually only that time?
not the most beautiful solution... but it will work...

because OnEvent_Signin is not triggered if you activate it when you are already signed in.

you need to use both events and make them both call a startup event to avoid duplicating code
code:
function Startup(){
  //do startup stuff here
}
function OnEvent_Initialize(MessengerStart){
  //Check if user is signed in when script is started
  if((MessengerStart == false) && (Messenger.MyStatus > 1)){
    Startup();
  }
}
function OnEvent_SigninReady(){
  Startup();
}

This post was edited on 08-31-2006 at 08:13 AM by Eljay.
08-31-2006 08:10 AM
Profile PM Find Quote Report
Buzz44
Junior Member
**

Avatar
Messenger Plus! Newbie ^^

Posts: 18
– / Male / –
Joined: Aug 2006
O.P. RE: New to Plus! scripting :).
Thanks Eljay. No sooner then you had posted that I figured the solution out for myself ;).

Thanks everyone :).
08-31-2006 08:51 AM
Profile E-Mail PM Find Quote Report
Buzz44
Junior Member
**

Avatar
Messenger Plus! Newbie ^^

Posts: 18
– / Male / –
Joined: Aug 2006
O.P. RE: New to Plus! scripting :).
One last thing. Do I really need to check if Messenger.MyStatus is > 1? If MessengerStart = False doesn't that mean that WML is already running and the user is logged in? Or do scripts run even when WML is running no user signed in?

code:
if((MessengerStart == false) && (Messenger.MyStatus > 1)){
    Startup();
  }
08-31-2006 08:56 AM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: New to Plus! scripting :).
quote:
Originally posted by Buzz44
do scripts run even when WML is running no user signed in?

yes :P
08-31-2006 08:57 AM
Profile 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