[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 |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
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 |
|
|
foaly
Senior Member
Posts: 718 Reputation: 20
38 / /
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 |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
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.
|
|
12-09-2006 07:29 PM |
|
|
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" xsichemaLocation="">
<Window Id="WndColor" Version="1">
<Attributes>
<Caption>顏色決定</Caption>
</Attributes>
<TitleBar>
<Title>
<Text>顏色決定</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>顏色決定</Caption>
</Control>
<Control xsi:type="ButtonControl" Id="Red">
<Position Top="305" Left="10" Width="50"/>
<Caption>紅色</Caption>
</Control>
<Control xsi:type="ButtonControl" Id="Blue">
<Position Top="305" Left="70" Width="50"/>
<Caption>藍色</Caption>
</Control>
<Control xsi:type="ButtonControl" Id="Green">
<Position Top="305" Left="130" Width="50"/>
<Caption>綠色</Caption>
</Control>
<Control xsi:type="ButtonControl" Id="Yellow">
<Position Top="305" Left="190" Width="50"/>
<Caption>黃色</Caption>
</Control>
</Controls>
</Window>
</Interfaces>
Js File
quote: //個人專用 : 解讀MSN遊戲Uno的密碼, 可用於個人用途
var WndColor;
var uno = '0';
function OnEvent_Initialize(MessengerStart)
{
}
function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
ChatWnd.SendMessage('紅色');
WndColor.Close(0);
}
else if(ControlId == "Blue") {
ChatWnd.SendMessage('藍色');
WndColor.Close(0);
}
else if(ControlId == "Yellow") {
ChatWnd.SendMessage('黃色');
WndColor.Close(0);
}
else if(ControlId == "Green") {
ChatWnd.SendMessage('綠色');
WndColor.Close(0);
}
}
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?":
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 |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
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.
Attachment: Window.txt (3.07 KB)
This file has been downloaded 161 time(s).
|
|
12-10-2006 04:28 AM |
|
|
Kutar
New Member
Posts: 13
Joined: Aug 2006
|
O.P. RE: [request]part of script
thx~
The pluswnd showed.
But another question:
quote: function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
ChatWnd.SendMessage('紅色');
WndColor.Close(0);
}
else if(ControlId == "Blue") {
ChatWnd.SendMessage('藍色');
WndColor.Close(0);
}
else if(ControlId == "Yellow") {
ChatWnd.SendMessage('黃色');
WndColor.Close(0);
}
else if(ControlId == "Green") {
ChatWnd.SendMessage('綠色');
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 |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
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 |
|
|
Kutar
New Member
Posts: 13
Joined: Aug 2006
|
O.P. RE: [request]part of script
The plusWnd is here but nothing happens too~
quote: //個人專用 : 解讀MSN遊戲Uno的密碼, 可用於個人用途
var WndColor;
var uno = '0';
function OnEvent_Initialize(MessengerStart)
{
}
function OnPlusWndEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
ChatWnd.SendMessage('紅色');
PlusWnd.Close(0);
}
else if(ControlId == "Blue") {
ChatWnd.SendMessage('藍色');
PlusWnd.Close(0);
}
else if(ControlId == "Yellow") {
ChatWnd.SendMessage('黃色');
PlusWnd.Close(0);
}
else if(ControlId == "Green") {
ChatWnd.SendMessage('綠色');
PlusWnd.Close(0);
}
}
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?":
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 |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: [request]part of script
code: //個人專用 : 解讀MSN遊戲Uno的密碼, 可用於個人用途
var WndColor;
var uno = '0';
function OnEvent_Initialize(MessengerStart)
{
}
function OnWndColorEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "Red") {
MyChatWnd.SendMessage('紅色');
PlusWnd.Close(0);
}
else if(ControlId == "Blue") {
MyChatWnd.SendMessage('藍色');
PlusWnd.Close(0);
}
else if(ControlId == "Yellow") {
MyChatWnd.SendMessage('黃色');
PlusWnd.Close(0);
}
else if(ControlId == "Green") {
MyChatWnd.SendMessage('綠色');
PlusWnd.Close(0);
}
}
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?":
MyChatWnd = ChatWnd;
PlusWnd = MsgPlus.CreateWnd("Window.xml","WndColor");
break;
}
}
|
|
12-10-2006 05:58 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|
|