KnRd_WC
Junior Member
Florian PAQUET
Posts: 74 Reputation: 1
35 / /
Joined: Aug 2006
|
RE: List file
Hi !
code: function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
if (Message.substr(0,5)=="/list") {
if (Message.substr(Message.length-1,1)!="\\") {
// Get the Message string length using that : Message.length
// To get the last letter : Message.length-1
// EX : TEST (len = 4), the first character is at position 0, so, the last T is at position 3 (4-1)
// If you use "\", your script will not work, because "\" is for specials characters, EX : "\n" >> Return.
// So, you have to use "\\"
Message+="\\"
// If the last letter is not ('!=') "\", just add ('+=') \ ('\\') to Message string !
}
ListDirectory(Message.substr(6,Message.length-6).replace(/\\/gi,'\\\\'),ChatWnd);
return "";
}
}
This post was edited on 08-23-2006 at 02:38 PM by KnRd_WC.
|
|