What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [request]part of script

Pages: (2): « First [ 1 ] 2 » Last »
[request]part of script
Author: Message:
Kutar
New Member
*


Posts: 13
Joined: Aug 2006
O.P. [request]part of script
I want to make a script that may create a plus Wnd.
The XML file I have made.
But I don't know how to use a js file to "call" the xml file(Create a PlusWnd)

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if(Message == 'r') {
    MsgPlus.DisplayToast('Uno顏色解讀', '紅色');
    }
else if(Message == 'R') {
    MsgPlus.DisplayToast('Uno顏色解讀', '紅色');
    }
else if(Message == 'y') {
    MsgPlus.DisplayToast('Uno顏色解讀', '黃色');
    }
else if(Message == 'Y') {
    MsgPlus.DisplayToast('Uno顏色解讀', '黃色');
    }
else if(Message == 'g') {
    MsgPlus.DisplayToast('Uno顏色解讀', '綠色');
    }
else if(Message == 'G') {
    MsgPlus.DisplayToast('Uno顏色解讀', '綠色');
    }
else if(Message == 'b') {
    MsgPlus.DisplayToast('Uno顏色解讀', '藍色');
    }
else if(Message == 'B') {
    MsgPlus.DisplayToast('Uno顏色解讀', '藍色');
    }
if(Message == 'bk') {
    MsgPlus.DisplayToast('Uno牌類解讀', '禁止');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno牌類解讀', '禁止');
    }
else if(Message == 'bK') {
    MsgPlus.DisplayToast('Uno牌類解讀', '禁止');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno牌類解讀', '禁止');
    }
switch (Message){
    case "wt cl?":
    MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");
    break;
    }

}
(above was a part of my script, it includes some Chinese)
the bold words was the problem.
Anybody help me?

This post was edited on 12-09-2006 at 04:43 PM by Kutar.
12-09-2006 04:35 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [request]part of script
Try
code:
PlusWnd =     MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");


Also make sure that the XML is Unicode.

This post was edited on 12-09-2006 at 06:42 PM by Felu.
12-09-2006 06:23 PM
Profile E-Mail PM Web Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: [request]part of script
quote:
Originally posted by -!Felu!-
PlusWnd = MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");
shouldn't that be:
code:
var PlusWnd = MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");


and the XML has to  be in unicode 16...
12-09-2006 06:55 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [request]part of script
quote:
Originally posted by foaly
shouldn't that be:
code:
var PlusWnd = MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");


It depends: if you want to make PlusWnd a local variable (removed when OnEvent_ChatWndSendMessage ends), you add "var" in front of it. If you want it to be a global variable, you drop the "var"
quote:
Originally posted by foaly
and the XML has to  be in unicode 16...
That is UTF-16:
quote:
Originally posted by Wikipedia
In computing, UTF-16 (16-bit Unicode Transformation Format) is a variable-length character encoding for Unicode, capable of encoding the entire Unicode repertoire.
:P
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 07:29 PM
Profile E-Mail PM Web Find Quote Report
Kutar
New Member
*


Posts: 13
Joined: Aug 2006
O.P. RE: [request]part of script
Let us check the whole but incomplete files now.....
XML
quote:
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="">
    <Window Id="WndColor" Version="1">
        <Attributes>
            <Caption>&#38991;&#33394;&#27770;&#23450;</Caption>
        </Attributes>
        <TitleBar>
            <Title>
                <Text>&#38991;&#33394;&#27770;&#23450;</Text>
            </Title>
        </TitleBar>
        <Position Width="200" Height="355"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="LblText" Visible="true" Enabled="true">
                <Position Top="10" Left="10" Width="100" Height="15"/>
                <Color>
                    <GlobalColor>heading</GlobalColor>
                </Color>
                <Font>
                    <Bold>true</Bold>
                    <Size>11</Size>
                </Font>
                <Caption>&#38991;&#33394;&#27770;&#23450;</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="Red">
                <Position Top="305" Left="10" Width="50"/>
                <Caption>&#32005;&#33394;</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="Blue">
                <Position Top="305" Left="70" Width="50"/>
                <Caption>&#34253;&#33394;</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="Green">
                <Position Top="305" Left="130" Width="50"/>
                <Caption>&#32160;&#33394;</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="Yellow">
                <Position Top="305" Left="190" Width="50"/>
                <Caption>&#40643;&#33394;</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>


Js File

quote:
//&#20491;&#20154;&#23560;&#29992; : &#35299;&#35712;MSN&#36938;&#25138;Uno&#30340;&#23494;&#30908;, &#21487;&#29992;&#26044;&#20491;&#20154;&#29992;&#36884;

var WndColor;
var uno = '0';

function OnEvent_Initialize(MessengerStart)
{
}

function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
    if(ControlId == "Red") {
        ChatWnd.SendMessage('&#32005;&#33394;');
        WndColor.Close(0);
    }
    else if(ControlId == "Blue") {
        ChatWnd.SendMessage('&#34253;&#33394;');
        WndColor.Close(0);
    }
    else if(ControlId == "Yellow") {
        ChatWnd.SendMessage('&#40643;&#33394;');
        WndColor.Close(0);
    }
    else if(ControlId == "Green") {
        ChatWnd.SendMessage('&#32160;&#33394;');
        WndColor.Close(0);
    }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if(Message == 'r') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
    }
else if(Message == 'R') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
    }
else if(Message == 'y') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
    }
else if(Message == 'Y') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
    }
else if(Message == 'g') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
    }
else if(Message == 'G') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
    }
else if(Message == 'b') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
    }
else if(Message == 'B') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
    }
if(Message == 'bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'bK') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
switch (Message){
    case "wt cl?":
    PlusWnd = MsgPlus.CreateWnd("ChoicesWnd.xml","WndColor");
    break;
    }
}


Thanks for all your relpies(Sorry for my poor English, I am Macanese).

This post was edited on 12-10-2006 at 01:58 AM by Kutar.
12-10-2006 01:57 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [request]part of script
Changed the window a bit. Also saved it as UTF-16 :)

PS : The file's extension is txt as xml files are not allowed to be uploaded.

.txt File Attachment: Window.txt (3.07 KB)
This file has been downloaded 161 time(s).
12-10-2006 04:28 AM
Profile E-Mail PM Web Find Quote Report
Kutar
New Member
*


Posts: 13
Joined: Aug 2006
O.P. RE: [request]part of script
thx~:D
The pluswnd showed.
But another question:
quote:
function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
ChatWnd.SendMessage('&#32005;&#33394;');
WndColor.Close(0);
}
else if(ControlId == "Blue") {
ChatWnd.SendMessage('&#34253;&#33394;');
WndColor.Close(0);
}
else if(ControlId == "Yellow") {
ChatWnd.SendMessage('&#40643;&#33394;');
WndColor.Close(0);
}
else if(ControlId == "Green") {
ChatWnd.SendMessage('&#32160;&#33394;');
WndColor.Close(0);
}
}


When I click the button, there's nothing happened.
I wanted the result wil be like this:
Click the first button, send something to my contact, click the second button, send another thing....
Please help me to check that part of the js file above, or see the post before last post and check the whole js file for me.) Give 100000000 thanks!
12-10-2006 05:18 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [request]part of script
Is ChatWnd global variable?
Also use PlusWnd.Close(0);
12-10-2006 05:36 AM
Profile E-Mail PM Web Find Quote Report
Kutar
New Member
*


Posts: 13
Joined: Aug 2006
O.P. RE: [request]part of script
:S
The plusWnd is here but nothing happens too~
quote:
//&#20491;&#20154;&#23560;&#29992; : &#35299;&#35712;MSN&#36938;&#25138;Uno&#30340;&#23494;&#30908;, &#21487;&#29992;&#26044;&#20491;&#20154;&#29992;&#36884;

var WndColor;
var uno = '0';

function OnEvent_Initialize(MessengerStart)
{
}

function OnPlusWndEvent_CtrlClicked(PlusWnd,ControlId) {
    if(ControlId == "Red") {
        ChatWnd.SendMessage('&#32005;&#33394;');
        PlusWnd.Close(0);
    }
    else if(ControlId == "Blue") {
        ChatWnd.SendMessage('&#34253;&#33394;');
        PlusWnd.Close(0);
    }
    else if(ControlId == "Yellow") {
        ChatWnd.SendMessage('&#40643;&#33394;');
        PlusWnd.Close(0);
    }
    else if(ControlId == "Green") {
        ChatWnd.SendMessage('&#32160;&#33394;');
        PlusWnd.Close(0);
    }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if(Message == 'r') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
    }
else if(Message == 'R') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
    }
else if(Message == 'y') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
    }
else if(Message == 'Y') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
    }
else if(Message == 'g') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
    }
else if(Message == 'G') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
    }
else if(Message == 'b') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
    }
else if(Message == 'B') {
    MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
    }
if(Message == 'bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'bK') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
else if(Message == 'Bk') {
    MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
    }
switch (Message){
    case "wt cl?":
    PlusWnd = MsgPlus.CreateWnd("Window.xml","WndColor");
    break;
    }
}


I want the result wil be like this:
Click the first button, send 'red'(without quotes) to my contact, click the second button, send 'blue' and so on.
To do this, I think ChatWnd.SendMessage can help me, but it doesn't work and the pluswnd didn't disappeared after clicking those buttons.

Please help me to check the whole js file. Give 100000000 thanks!

This post was edited on 12-10-2006 at 05:50 AM by Kutar.
12-10-2006 05:49 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [request]part of script
code:
//&#20491;&#20154;&#23560;&#29992; : &#35299;&#35712;MSN&#36938;&#25138;Uno&#30340;&#23494;&#30908;, &#21487;&#29992;&#26044;&#20491;&#20154;&#29992;&#36884;

var WndColor;
var uno = '0';

function OnEvent_Initialize(MessengerStart)
{
}

function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
MyChatWnd.SendMessage('&#32005;&#33394;');
PlusWnd.Close(0);
}
else if(ControlId == "Blue") {
MyChatWnd.SendMessage('&#34253;&#33394;');
PlusWnd.Close(0);
}
else if(ControlId == "Yellow") {
MyChatWnd.SendMessage('&#40643;&#33394;');
PlusWnd.Close(0);
}
else if(ControlId == "Green") {
MyChatWnd.SendMessage('&#32160;&#33394;');
PlusWnd.Close(0);
}
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if(Message == 'r') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
}
else if(Message == 'R') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32005;&#33394;');
}
else if(Message == 'y') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
}
else if(Message == 'Y') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#40643;&#33394;');
}
else if(Message == 'g') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
}
else if(Message == 'G') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#32160;&#33394;');
}
else if(Message == 'b') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
}
else if(Message == 'B') {
MsgPlus.DisplayToast('Uno&#38991;&#33394;&#35299;&#35712;', '&#34253;&#33394;');
}
if(Message == 'bk') {
MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
}
else if(Message == 'Bk') {
MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
}
else if(Message == 'bK') {
MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
}
else if(Message == 'Bk') {
MsgPlus.DisplayToast('Uno&#29260;&#39006;&#35299;&#35712;', '&#31105;&#27490;');
}
switch (Message){
case "wt cl?":
MyChatWnd = ChatWnd;
PlusWnd = MsgPlus.CreateWnd("Window.xml","WndColor");
break;
}
}
12-10-2006 05:58 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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