Question :) - 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: Question :) (/showthread.php?tid=82713) Question :) by WaterRatj on 03-27-2008 at 03:55 PM
Some questions while i'm learning a bit. RE: Question :) by Quantum on 03-27-2008 at 04:27 PM
1.a Yes you can do this without a script. In your Plus! prefs go to the conversation tab and at the bottom you will see "Auto Accept Requests". Check the box and choose from the drop down menu file transfers. RE: Question :) by MeEtc on 03-27-2008 at 04:43 PM
1. AFAIK, you cannot detect file transfers with scripting on its own. You will need a packet sniffer, such as Xniff that you will find here in the forum. RE: Question :) by WaterRatj on 03-27-2008 at 05:02 PM
Okay, Thanks for answering Stupid Question? I'm trying to split something var sPrefix = sMessage.split(" "); var sPrefixTheRest = ??? Lets say the string is !nick Hello Kitty. sPrefix[0] will be !nick But i' trying to the a string now with all the rest of the line without the !nick, can anyone tell me hows the best way to do this? RE: Question :) by CookieRevised on 03-28-2008 at 12:22 AM
quote:split() is usually only good if you want to turn something into an array or if you are absolutely certain that a certain string includes the exact amount of delimiters and items you want. Now, it can be done with the very slow split() function though, but you will need a lot of stuff and trickery and in the end it would still not be fail-proof. As a first simple alternative: code:combined into one line: code: But if that string is something entered by the user (like a command): Then what if the user forget to type anything behind "!nick"? And what if the user forget the space after "!nick"? And what if the user has typed spaces before "!nick"? And what if the user has typed multiple spaces after "!nick"? etc... All these things need to be taken care of. If you want to seperate the parameters from the command in an OnEvent_ChatWndSendMessage function, you better use regular expressions. This is the most accurate and versitile method to use for this. For an explaining example see CookieRevised's reply to Gettin data from "/" commands. PS: do not use "!" as prefix for normal commands. A normal local command should always have "/" as prefix. Most likely, Your script isn't the only script the user is using. Using something different for the prefix than the usual prefix may confuse the user and it will give problems with some other scripts also, etc. RE: Question :) by WaterRatj on 03-28-2008 at 12:31 AM
tnx for the help |