What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » External Variable

External Variable
Author: Message:
Uberstalker
New Member
*


Posts: 2
36 / Male / –
Joined: Jul 2006
O.P. External Variable
I am working on script that I need to be able to declare multiple variables and change their values from the chat box...Is this even possible? If so can someone help me?
07-31-2006 11:16 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: External Variable
Dont declare them in a function declare them at the top of the file.

code:
var myVariable;

function OnEvent_Initialize(bMessengerStart){   

}
07-31-2006 11:59 PM
Profile E-Mail PM Find Quote Report
Uberstalker
New Member
*


Posts: 2
36 / Male / –
Joined: Jul 2006
O.P. RE: External Variable
I need to be able to assign a / command such as /new <name> and create a new varible that I can change the value of with something like /change <name> <value>...if that makes any sense
08-01-2006 12:04 AM
Profile E-Mail PM Web Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
RE: External Variable
Go look through some other scripts, and what people use to see if the message is /something. Also, look for some scritps that submit paramaters.
08-01-2006 01:25 AM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: External Variable
quote:
Originally posted by Uberstalker
I need to be able to assign a / command such as /new <name> and create a new varible that I can change the value of with something like /change <name> <value>...if that makes any sense
This sounds like you want a map data structure. JScript should have enough support to use one, even if you have to write it yourself.

Edit: The post below is what you want, f'sure ;) Since a map can be implemented as an associative array.

This post was edited on 08-01-2006 at 02:39 PM by RaceProUK.
[Image: spartaafk.png]
08-01-2006 08:58 AM
Profile PM Web Find Quote Report
AberNStein
Full Member
***


Posts: 132
Reputation: 2
Joined: Jul 2006
RE: External Variable
you can't create new variables on the fly with jscript afaik but you could do this with an associative array.

code:
var my_vars= new Array()

function setValue(name,data){
my_vars[name]=data;
}


note that you can assign a value to an item in the array without declaring that item.

This post was edited on 08-01-2006 at 02:39 PM by AberNStein.
[Image: gybouserbar6hc.gif]
08-01-2006 02:35 PM
Profile PM 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