What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » {help please} script disable

{help please} script disable
Author: Message:
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
O.P. {help please} script disable
what code can i add to my script so that when i send start! it enables the script and when i send stop! it disables the script

thanks for any help

oh and i would like the script to always start disabled

This post was edited on 09-17-2006 at 01:47 AM by skyserpent.
09-17-2006 01:40 AM
Profile E-Mail PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: {help please} script disable
ok here you go
code:
var started = 0;
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message)
{
 
if(started==0)
  {
   
if(Message=='start!')
    {
      started=1;
      //code here for when started
    }
   
if(Message=='stop!')
    {
      ChatWnd.SendMessage('not started');
    }
  }
 
else if(started==1)
  {
   
if(Message=='stop!')
    {
      started=0;
      //code here for diabled
    }
   
if(Message=='start!')
    {
      ChatWnd.SendMessage('already started');
    }
  }
}

fixed the start! stop! codes

fix my code (i had mesage not message)

added some colour to help you out

This post was edited on 09-17-2006 at 02:15 AM by NanaFreak.
09-17-2006 01:53 AM
Profile PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: {help please} script disable
I'm not the most efficient of programmers, but one way to do it is:
code:
var ScriptEnabled = false;

function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
   if(Message == "start!") ScriptEnabled = true;
   if(Message == "stop!") ScriptEnabled = false;
}

function <your function>(<your parameters>) {
   if(ScriptEnabled) {
      ... //Code goes in here
   }
}
You will need to repeat the last function for every function in your script.

This post was edited on 09-17-2006 at 02:01 AM by phalanxii.
09-17-2006 01:55 AM
Profile PM Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
O.P. RE: {help please} script disable
help me with "function <your function>(<your parameters>)" please
09-17-2006 02:01 AM
Profile E-Mail PM Web Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: RE: {help please} script disable
quote:
Originally posted by skyserpent
help me with "function <your function>(<your parameters>)" please

What is the name of the function(s) in your script? For example, if my script has a function called FindAddress with parameters First, Second, Offset, it will appear in my script as:
code:
function FindAddress(First, Second, Offset) {
   x = First + Second - Offset;
}
So if I want to integrate this with the script enabled, I simply have to change it to:
code:
function FindAddress(First, Second, Offset) {
   if(ScriptEnabled) {
      x = First + Second - Offset;
   }
}
09-17-2006 02:06 AM
Profile PM Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
O.P. RE: {help please} script disable
everything is sorted

thanks buddies
09-17-2006 02:25 AM
Profile E-Mail PM Web Find Quote Report
« 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