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

problem with Arrays
Author: Message:
Squelettor
Junior Member
**

Avatar

Posts: 49
Joined: Jul 2006
RE: problem with Arrays
quote:
Originally posted by darkriven

code:
for ( String arg : botstatus )



code:

for (var i=0; i<botstatus.length; i++ )


The all script :

code:
var gChatWnd;
var wo = "weg";
var back = "";
var botstatus = new Array();

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
  Debug.Trace("OnEvent_ChatWndReceiveMessage : beginning");
  if(Messenger.MyName != Origin)
  {
    var tmpstatus=GetStatus(ChatWnd.Handle);
    if(tmpstatus==0)
    {
      switch(Messenger.MyStatus)
      {
        case 7:
          ChatWnd.SendMessage("[Automessage] Hi " + Origin + "! Flo ist gerade " + wo + ". Er ist voraussichtlich wieder da um:" + back );
          break;
        case 8:
          ChatWnd.SendMessage("[Automessage] Hi " + Origin + "! Flo ist gerade am Telefon. Das dauert voraussichtlich bis um:" + back);
          break;
        case 4:
          ChatWnd.SendMessage("[Automessage] Hi " + Origin + "! Flo ist gerade beschäftigt. Er hat voraussichtlich wieder Zeit um:" + back);
          break;
        case 9:
          ChatWnd.SendMessage("[Automessage] Hi " + Origin + "! Flo ist gerade beim essen. Er ist voraussichtlich wieder da um:" + back);
          break;
        case 5:
          ChatWnd.SendMessage("[Automessage] Hi " + Origin + "! Flo ist mal kurz " + wo + ". Er ist voraussichtlich wieder da um:" + back );
          break;
      }
    }
  }
  Debug.Trace("OnEvent_ChatWndReceiveMessage : end");
}

function GetStatus(windowhandle)
{
  Debug.Trace("GetStatus : beginning");
  var Status=0;
  for (var i=0; i<botstatus.length; i++ )
  {
    if(botstatus[i]==windowhandle)
    {
      Status=1;
    }
  }
  if(Status==0)
  {
    botstatus[botstatus.length]=windowhandle;
  }
  Debug.Trace("Status : " + Status);
  Debug.Trace("GetStatus : end");
  return Status;
}


This post was edited on 02-08-2007 at 02:23 PM by Squelettor.
02-08-2007 02:23 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
problem with Arrays - by darkriven on 02-07-2007 at 04:25 PM
RE: problem with Arrays - by Squelettor on 02-08-2007 at 02:23 PM
RE: problem with Arrays - by darkriven on 02-08-2007 at 02:55 PM


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