[request] loop [HELP PLEASE] |
Author: |
Message: |
skyserpent
Junior Member
Bacon
Posts: 96
32 / / –
Joined: Aug 2006
|
O.P. [request] loop [HELP PLEASE]
anyone know how to make something loop until i write STOP! into the conversation window?
This post was edited on 08-27-2006 at 11:07 PM by skyserpent.
|
|
08-27-2006 10:18 PM |
|
|
Ash_
Senior Member
Posts: 638 Reputation: 31
35 / / –
Joined: Aug 2004
|
RE: [request] loop
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.)
This post was edited on 08-27-2006 at 10:52 PM by Ash_.
|
|
08-27-2006 10:49 PM |
|
|
skyserpent
Junior Member
Bacon
Posts: 96
32 / / –
Joined: Aug 2006
|
O.P. RE: [request] loop
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;
}
}
This post was edited on 08-27-2006 at 11:07 PM by skyserpent.
|
|
08-27-2006 11:06 PM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
Joined: Jun 2006
|
RE: [request] loop [HELP PLEASE]
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.
This post was edited on 08-27-2006 at 11:30 PM by Silentdragon.
|
|
08-27-2006 11:19 PM |
|
|
skyserpent
Junior Member
Bacon
Posts: 96
32 / / –
Joined: Aug 2006
|
O.P. RE: [request] loop [HELP PLEASE]
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
This post was edited on 08-27-2006 at 11:24 PM by skyserpent.
|
|
08-27-2006 11:22 PM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
Joined: Jun 2006
|
RE: [request] loop [HELP PLEASE]
I missed one thing, updated my post. It stops at the 15th because its the flood protection.
|
|
08-27-2006 11:31 PM |
|
|
skyserpent
Junior Member
Bacon
Posts: 96
32 / / –
Joined: Aug 2006
|
O.P. RE: [request] loop [HELP PLEASE]
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
This post was edited on 08-27-2006 at 11:43 PM by skyserpent.
|
|
08-27-2006 11:42 PM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
Joined: Jun 2006
|
RE: [request] loop [HELP PLEASE]
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);
}
}
}
|
|
08-28-2006 12:29 AM |
|
|
deAd
Scripting Contest Winner
Posts: 1060 Reputation: 28
– / /
Joined: Jan 2006
|
RE: [request] loop [HELP PLEASE]
Note that it'll stop at 15 messages, so this will be pretty pointless really. It won't work well. :/
|
|
08-28-2006 12:30 AM |
|
|
skyserpent
Junior Member
Bacon
Posts: 96
32 / / –
Joined: Aug 2006
|
O.P. RE: [request] loop [HELP PLEASE]
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?
|
|
08-28-2006 12:44 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|