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:
darkriven
New Member
*


Posts: 2
Joined: Feb 2007
O.P. problem with Arrays
hi :)
I'm working on something like a bot.
It worked to answer people, but he simply answered everytime someone wrote a message. Now I've created the function GetStatus and the Array botstatus to save who i have answered this message yet. The bot should simply answer the sentence the first time someone wrote something.
(It should answer again if the state changed since the first answer)

Here is the code:
I don't work anymore :(

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

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
    var tmpstatus;
    tmpstatus=GetStatus(ChatWnd.Handle);
    if(Messenger.MyName != Origin)
    {
    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;
          }
    }
    }

}


function GetStatus(windowhandle){
    var Status=0;
    for ( String arg : botstatus ){
    if(arg==windowhandle)
    Status=1;
    }
    if(Status==0)
    botstatus[botstatus.length]=windowhandle;
    return Status;
}

02-07-2007 04:25 PM
Profile E-Mail 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