Shoutbox

[help please] timer - 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: [help please] timer (/showthread.php?tid=72424)

[help please] timer by skyserpent on 03-07-2007 at 08:17 PM

code:
function OnEvent_Timer(tId) {
    if(Wnd != null) {
        Wnd.SendMessage("Test");
        MsgPlus.AddTimer("timer",500000);
    }
}

why doesn't that work? anyone?

thanks for all help.

RE: [help please] timer by CookieRevised on 03-07-2007 at 08:48 PM

Please always give enough data when requesting support...

For scripts, post the entire source of scripts or at least all the code involved for the problem. Otherwise we can't help you properly or give you a decent answer.

eg:
- it might be that you don't create a timer anywhere
- it might be that Wnd is not what you think it will be
- it might be that Wnd is not globally defined
- it might be that there is no chatwindow open anymore to send a message to
- it might be that you can't edit the chatbox in the chat window at that time
- it might be that another user has signed in while the previous timer was still running
- 500000 equals 500 seconds, not 50 seconds
- etc... etc...

;)


RE: [help please] timer by felipEx on 03-07-2007 at 09:03 PM

var Wnd;
function OnEvent_ChatWndCreated(ChatWnd){
Wnd = ChatWnd;
MsgPlus.AddTimer("timer",500000);
}
...
another idea? :D


RE: [help please] timer by TheGuruSupremacy on 03-07-2007 at 09:16 PM

quote:
Originally posted by felipEx
var Wnd;
function OnEvent_ChatWndCreated(ChatWnd){
Wnd = ChatWnd;
MsgPlus.AddTimer("timer",500000);
}
...
another idea? :D

This is a possibility...You can retrive ChatWnd in other ways
for example by RecievedMessage event or you can enumerate chatwnds opened and choose one or if you want send a message to determinated contact you can use a code like this

var Chatwnd
Chatwnd=Messenger.OpenChat("contactemail")
Chatwnd.SendMessage("okie")

RE: [help please] timer by CookieRevised on 03-07-2007 at 10:06 PM

quote:
Originally posted by felipEx
var Wnd;
function OnEvent_ChatWndCreated(ChatWnd){
Wnd = ChatWnd;
MsgPlus.AddTimer("timer",500000);
}
...
another idea? :D
but that wouldn't work as soon as you have more than one chat window open...



-------

Without the proper full code, we can't give a decent answer/solution... Every 'suggestion' will have flaws and/or wont work at all. It would all be guessing.

RE: [help please] timer by skyserpent on 03-07-2007 at 10:08 PM

basically what i wanted was every so often it sends a message to all open conversation windows


RE: [help please] timer by CookieRevised on 03-07-2007 at 10:12 PM

We could provide a script for that*, but then again you still wont know what was wrong in your first code.

So, if you wanna know what is wrong in your code, post the complete code you have....

;)



*But such a script would be extremely highly annoying, not to mention the basis for stupid script-kiddie virusses which send links to every open window to advertise or spread something.


RE: [help please] timer by skyserpent on 03-07-2007 at 10:16 PM

ah cunning idea, project over lol

i actually copied the script out of one of my other scripts and probably missed a bit that's why it doesn't work. thanks anyways guys but it is a bad idea as you said. thanks again


RE: [help please] timer by roflmao456 on 03-07-2007 at 10:23 PM

it is easy to make, but it will be annoying to both you and your contacts.

quote:
Originally posted by CookieRevised
such a script would be extremely highly annoying, not to mention the basis for stupid script-kiddie virusses which send links to every open window to advertise or spread something.

>.>