Shoutbox

[request] loop [HELP PLEASE] - 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] loop [HELP PLEASE] (/showthread.php?tid=65486)

[request] loop [HELP PLEASE] by skyserpent on 08-27-2006 at 10:18 PM

anyone know how to make something loop until i write STOP! into the conversation window?


RE: [request] loop by Ash_ on 08-27-2006 at 10:49 PM

code:
var offon = 0;
function OnEvent_Initialize(MessengerStart)
{
while (offon=0)
{
    code to be executed
}
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin,Message,MessageKind)
{
if (Message == "STOP!") {
offon=1;
}
}


should work, might need a few adjustments (cant test right now).

edit: just so you know this will probably freeze messenger. you'll probably have to look for an alternate route to getting this done (a friend (-dt-) suggested a timer set for 100milliseconds.)
RE: [request] loop by skyserpent on 08-27-2006 at 11:06 PM

yeh a timer would be good.

anyone fix my code and add me a timer please?

code:
var bomb = 'testing';


function OnEvent_Initialize(MessengerStart)
{
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
  if(Message == 'BOMB!')
 
  while (offon = 0)
{

  ChatWnd.SendMessage(bomb);
  }
}
}
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin,Message,MessageKind)
{
if (Message == "STOP!") {
offon=1;
}
}

RE: [request] loop [HELP PLEASE] by Silentdragon on 08-27-2006 at 11:19 PM

code:
var Wnd = null;
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message == 'BOMB!') {
        Wnd = ChatWnd;
        MsgPlus.AddTimer("Bomb",500);
        return "";
    }
    if(Message == 'STOP!') {
        Wnd = null;
        MsgPlus.CancelTimer("Bomb");
        return "";
    }
}

function OnEvent_Timer(tId) {
    if(Wnd != null) {
        Wnd.SendMessage("Message Bomb");
        MsgPlus.AddTimer("Bomb",500);
    }
}

That should work, but it's pointless. MSN will stop sending messages after the 15th. And why would you want to spam somebody? It's quite annoying.
RE: [request] loop [HELP PLEASE] by skyserpent on 08-27-2006 at 11:22 PM

why will it stop sending after the 15th?

thanks matey... it doesn't work though :(

it sends one but thats it

debug:

code:
Script is starting
Script is now loaded and ready
Function called: OnEvent_ChatWndSendMessage
Function called: OnEvent_Timer
Function called: OnEvent_ChatWndSendMessage

RE: [request] loop [HELP PLEASE] by Silentdragon on 08-27-2006 at 11:31 PM

I missed one thing, updated my post. It stops at the 15th because its the flood protection.


RE: [request] loop [HELP PLEASE] by skyserpent on 08-27-2006 at 11:42 PM

cheers! now for more please lol

how could i get it so that its exactly the same but it creates two timers with two different texts and stops both when STOP! is sent

i am very aprectiative for this


RE: [request] loop [HELP PLEASE] by Silentdragon on 08-28-2006 at 12:29 AM

code:
var Wnd = null;
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message == 'BOMB!') {
        Wnd = ChatWnd;
        MsgPlus.AddTimer("Bomb",500);
        MsgPlus.AddTimer("Bomb2",500);
        return "";
    }
    if(Message == 'STOP!') {
        Wnd = null;
        MsgPlus.CancelTimer("Bomb");
        MsgPlus.CancelTimer("Bomb2");
        return "";
    }
}
function OnEvent_Timer(tId) {
    if(Wnd != null) {
        if(tId == "Bomb") {
            Wnd.SendMessage("Message Bomb");
            MsgPlus.AddTimer("Bomb",500);
        } else if(tId == "Bomb2") {
            Wnd.SendMessage("Message Bomb2");
            MsgPlus.AddTimer("Bomb2",500);
        }
    }
}

RE: [request] loop [HELP PLEASE] by deAd on 08-28-2006 at 12:30 AM

Note that it'll stop at 15 messages, so this will be pretty pointless really. It won't work well. :/


RE: [request] loop [HELP PLEASE] by skyserpent on 08-28-2006 at 12:44 AM

when it stops if you type something else it carrys on going... thats why i thought about putting two because i thought it would keep going, with it saying something else. anyone got any ideas of how to get by the restriction?


RE: [request] loop [HELP PLEASE] by Silentdragon on 08-28-2006 at 12:49 AM

Don't spam somebody, and make a constructive script that won't make others annoyed. Otherwise you're stuck with your limit.


RE: [request] loop [HELP PLEASE] by skyserpent on 08-28-2006 at 12:51 AM

ha. i probably wont use it. its just that i saw one (coded, not a msgplus script) and wondered if i could do it through msgplus script.

and i dont know what kind of script to make... and im crap at making them so i probably wouldnt be able to lol