quote:
Originally posted by ash44455666
Thanks foaly
So if I wanted to set variable link1, link2 or link3 to what they provided, I could use something like this?
code:
var link1 = "No link set";
var link2 = "No link set";
var link3 = "No link set;
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if(Origin != Messenger.MyName) {
if (sMessage.charAt(0) == '!') {
if(sMessage.charAt(1) == '!') {
return sMessage; }
else {
var parts is sMessage.split(" "); }}
if (parts[0] == !set) {
if (parts[1] == link1) {
link1 = parts[2]; }
else if (parts[1] == link2) {
link2 = parts[2]; }
else if (parts[1] == link3) {
link3 = parts[2]; }}}}
yes that should work... although the words you recieve should be in quotations like:
parts[1] == "link1"