What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help] msn chat windows

[help] msn chat windows
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [help] msn chat windows
That regular expression is just too complicated! You don't have to repeat a character set time and time again, just use accolades!

Anyway, this code will save the captured video in a global variable and uses a much cleaner regular expression. Try it! ;)
code:
var video = "";

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
   var tubeoption = TubeOption.RegRead(TubeOptionPath);
   Debug.Trace(tubeoption);
   
   if(MessageKind == 1 && tubeoption == 1) {
      var reYouTube = /<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http:\/\/www\.youtube\.com\/v\/(.{11})\"><\/param><param name=\"wmode\" value=\"transparent\"><\/param><embed src=\"http:\/\/www\.youtube\.com\/v\/(.{11})\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"><\/embed><\/object>/g;
      if(reTouTube.test(Message) {
            video = RegExp.$1;
            Message = "<YouTube Embed Video Link: "+video+">";
            Debug.Trace("YouTube Embed Video Link captured: "+video);
            MsgPlus.CreateWnd("youtubewindow.xml", "youtubequestion");
         }
      }
   }
   return Message;
}

function InternetExplorer() {
   IE.width = "450";
   IE.height = "350";
   IE.statusbar = false;
   IE.toolbar = false;
   IE.menubar = false;
   IE.addressbar = false;
   IE.visible = true;
   IE.navigate(video);
}

function OnyoutubequestionEvent_CtrlClicked(PlusWnd, ControlId) {               
   if(ControlId == "BtnYes") {
      InternetExplorer();     
      PlusWnd.Close(1);
   } else if(ControlId == "BtnNo") {
      PlusWnd.Close(1);
   }
}

This post was edited on 12-09-2006 at 06:29 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-09-2006 06:27 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[help] msn chat windows - by LifelesS on 12-09-2006 at 04:52 PM
RE: [help] msn chat windows - by Matti on 12-09-2006 at 06:27 PM
RE: [help] msn chat windows - by Felu on 12-09-2006 at 06:29 PM
RE: [help] msn chat windows - by Plik on 12-09-2006 at 06:38 PM
RE: [help] msn chat windows - by LifelesS on 12-09-2006 at 08:25 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