Shoutbox

[Help!] Advertiser - 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!] Advertiser (/showthread.php?tid=63080)

[Help!] Advertiser by fergofrog on 07-12-2006 at 12:03 AM

I am attempting to build a script for some one, how do you get messenger to send a message say every 10 mins, i just need the every 10mins part.


RE: [Help!] Advertiser by ddunk on 07-12-2006 at 12:06 AM

http://m00.cx/mpl/docs/index.html?page=ref-msgplus-addtimer.htm


RE: [Help!] Advertiser by craig2k5 on 07-12-2006 at 12:14 AM

and the spamming starts :(


RE: [Help!] Advertiser by fergofrog on 07-12-2006 at 12:18 AM

quote:
Originally posted by Ddunk
http://m00.cx/mpl/docs/index.html?page=ref-msgplus-addtimer.htm

It's not working. + how many milliseconds in a second?
RE: [Help!] Advertiser by Joereynolds89 on 07-12-2006 at 12:21 AM

1 second = 1 000 milliseconds


code:
Syntax

    AddTimer(
        [string] TimerId,
        [number] Elapse
    );

Parameters

TimerId
    [string] Unique string identifying the new timer. Every script can create up to 100 timers, each one with their own unique identifier. When a timer event occurs, the Id is passed as parameter. You can specify any string you want for TimerId apart from an empty string. Different scripts can use identical TimerId without worrying of possible conflicts.
Elapse
    [number] Amount of time that has to elapse, in milliseconds, before the event is fired. This number needs to be in the range of 100 to 86,4000,000 (one day).

RE: [Help!] Advertiser by craig2k5 on 07-12-2006 at 12:21 AM

AddTimer([string] TimerId,[number] Elapse);

For Example:

AddTimer(timer1,1000);

That would add a new timer called "timer1" and it would activate after 1 second (1000 milliseconds in a second) so for you.. you would have to change it to *-)

*Craig2k5 gets the calculator

600 000 milliseconds *-) i think lol :$


RE: [Help!] Advertiser by deAd on 07-12-2006 at 12:23 AM

No it wouldn't.

code:
AddTimer('timer1',1000);

You put a variable instead of a string.
RE: [Help!] Advertiser by fergofrog on 07-12-2006 at 12:36 AM

Is this correct:

code:
function OnEvent_Initialize(MessengerStart)
{
    AddTimer ('Add1', '600,000');
}

function OnEvent_Timer ('Add1')
{
    ChatWnd.SendMessage('Please visit http://www.example.com/ for...')
}

function OnEvent_Uninitialize(MessengerExit)
{
}



RE: [Help!] Advertiser by Dhaya on 07-12-2006 at 07:08 AM

No this is not.

This is correct :

code:
function OnEvent_Initialize(MessengerStart)
{
MsgPlus.AddTimer ('Add1', '600000');
}

function OnEvent_Timer (TimerId)
{
  if (TimerId == "Add1")
  {
    var ContactsOpened = Messenger.CurrentChats;
    if (ContactsOpened.Count > 0)
    {
      var e = new Enumerator (ContactsOpened);
      for (; !e.atEnd(); e.moveNext())
      {
        var ChatWindow = e.item();
        ChatWindow.SendMessage('Please visit http://www.example.com/ for...');
      }
    }
  }
  MsgPlus.AddTimer ('Add1', '600000');
}


This portion of code will advertise your text every 10 minutes to each of your contacts that have opened a chat window with you.