Shoutbox

checking the file.. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: checking the file.. (/showthread.php?tid=63243)

checking the file.. by koekwaus on 07-14-2006 at 08:39 AM

Hey all!
i have a make a script that you can sends some file's
now here is my question:
i want to know or its posseble to check the file that i sended if they are ready sended or censeld?

sorry for my bad english.. i hope you understand what i mean.

[in dutch:]

is het mogelijk om te kijken of de bestanden die ik gestuurd heb te kijken of het klaar is of geannuleerd?

Thx Koek


RE: checking the file.. by The_Joker on 07-14-2006 at 10:11 AM

I'm not sure but I think it might be possible.
Try to use the onEvent_ReceivedMessage func and check if it is an error message (file transfer canceled).
If someone can check how to recognize this messages exactly (there is message type parameter, look for error type).
Not the best solution but I think it can help.


RE: checking the file.. by koekwaus on 07-14-2006 at 10:47 AM

@ the joker: i want if its censeld of compleet that a var downloads -1 so wat i do is this

code:
function OnEvent_ChatWndReceiveMessage(wnd, user, message, kind)
{
Debug.Trace(kind);
    if(message.charAt(0) == "!")
    {
        var command = trim(message.substring(1, message.indexOf(" ")));
        var param = trim(message.substring(message.indexOf(" ")));
       
        Debug.Trace("Command: " + command + ", param: " + param);
       
        switch(command)
        {
            case "send":
           
                var valid = false;
               
                for(var i = 0; i < valid_files.length; i++)
                {
                    if(param == valid_files[i].getName())
                    {
                        downloaders++
                        totaaldownloaders++
                        Messenger.MyPersonalMessage = 'Downloaders nu: '+downloaders+ ', Totaal aantal bestanden gedownload: '+totaaldownloaders+',';
                        wnd.SendFile(valid_files[i].getPath());
                        valid = true;
                           
                        break;
                    }
                }
                if(!valid)
                {
                    var message;
                    message = "Het opgegeven bestand is niet geldig.\nJe kan kiezen uit de volgende bestanden:\n\n";
               
                    for(var i = 0; i < valid_files.length; i++)
                    {
                        message += (i+1) + ". " + valid_files[i].getName() + "\n";
                    }
               
                    wnd.SendMessage(message);
                }
            break;
        }
    }
                if (kind == 0)
                {
                downloaders--
                }
}           


the 0 means:

this is from scripting documentation:
MessageKind
[enum] Number specifying the kind of message received. It can be one of the following identifiers:

0 - Unknown.
1 - Text message typed by the user.
2 - A wink being sent.
3 - A voice clip being sent.
4 - A search made with the "Search" button.
5 - The result of a search made with the "Search" button.
6 - A text message sent while the current user was offline.



but you have a true and a false with SendFile
so maybe can i use that
RE: checking the file.. by The_Joker on 07-14-2006 at 05:15 PM

Hmm... I thought of detecting when it's an unknown type and then check the message:
If it is a file cancelled/completed then change the counter according to it.
I don't know the exact message, try to play with it in the trace to see.
Just a thought: if the WLM client is English/non-English, you will probably need to check with a different message.
Or if it is the error YOU get then do it according to your client (not good if you plan to share it, you will need to get all languages messages).

I don't know about the bool var (true/false), u should ask someone who is much more expirienced with this.


RE: checking the file.. by koekwaus on 07-14-2006 at 07:44 PM

the true and false is return .. i dont no how to use it.. how can help me?


RE: RE: checking the file.. by The_Joker on 07-15-2006 at 09:17 AM

quote:
Originally posted by koekwaus
the true and false is return .. i dont no how to use it.. how can help me?

quote:
Originally posted by The_Joker
u should ask someone who is much more expirienced with this.


RE: checking the file.. by Eljay on 07-15-2006 at 09:20 AM

this isnt possible, the true and false returned from ChatWnd.SendFile is if the transfer request was sent, not if the file was sent or even accepted/cancelled.