Very simple script - very simple problem (I hope) |
Author: |
Message: |
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. Very simple script - very simple problem (I hope)
Hi, first of all, sorry for my bad english, I'm italian and i'm trying to translate better as possible. Here's my problem: I have to make a very simple script: some phrases personalizables in some points, such as:
Hi there! Today i'm *PERSONALIZED TEXT*
I want to make an XML window with a text box to write personalized text, but I cannot find the function to get the text and send the phrase with personalization in the chatwindow.
If possibile, i want to make another text box to specify the chatwindow where the text will be written (I.E. e-mail of the receiver)
Surely this is an useless script, but is the base to improve other scripts
This post was edited on 02-26-2009 at 11:04 AM by Oceanor.
|
|
02-25-2009 01:41 PM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
up: i've reviewed some scripts to understand how xml works, but i have just a problem: why in the JS file some controls are named BtnCancel, BtnClose, BtnAbout and in the XML file the corrispondent control have IDs named BtnCancel, BtnClose, BtnDisable? How can i create a new control if names are different?
This post was edited on 02-26-2009 at 11:04 AM by Oceanor.
|
|
02-26-2009 11:04 AM |
|
|
djdannyp
Elite Member
Danny <3 Sarah
Posts: 3546 Reputation: 31
38 / /
Joined: Mar 2006
|
RE: Very simple script - very simple problem (I hope)
You can call the control whatever you want
You could call it BtnDestroyTheWorld and as long as when attributing the function you used that name, then it will do whatever you tell it
|
|
02-26-2009 11:25 AM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
Thanks for the answer
My problem if different: I'm watching a script (message gradiator) and in the XML file there are 3 buttons:
<Control xsi:type="ButtonControl" Id="BtnDisable"><Position Top="220" Left="45" Width="60"/><Caption>Disabilita</Caption></Control>
<Control xsi:type="ButtonControl" Id="BtnClose"><Position Top="220" Left="115" Width="60"/><Caption>Salva e Esci</Caption></Control>
<Control xsi:type="ButtonControl" Id="BtnCancel"><Position Top="220" Left="185" Width="60"/><Caption>Annulla</Caption></Control>
Ids are "BtnDisable",BtnClose",BtnCancel", and they are 3 buttons to save, cancel and exit from the xml window.
If i want to rename these IDs or create another button to quit from the window, where I have to change something? If I change IDs, buttons become useless.. so, in other words, where the ids are linked?
Ps. no traces of these IDs with a search in the JS part.
This post was edited on 02-26-2009 at 12:10 PM by Oceanor.
|
|
02-26-2009 12:08 PM |
|
|
djdannyp
Elite Member
Danny <3 Sarah
Posts: 3546 Reputation: 31
38 / /
Joined: Mar 2006
|
RE: RE: Very simple script - very simple problem (I hope)
quote: Originally posted by Oceanor
Ps. no traces of these IDs with a search in the JS part.
Javascript code:
function OnOptionsEvent_CtrlClicked(Wnd, ControlId)
{
var Email = Messenger.MyEmail;
if(ControlId=="BtnAbout"){
var Wnd = MsgPlus.CreateWnd("gui.xml", "About");
}
if(ControlId == "BtnClose") {
var optionSaved1 = new ActiveXObject('WScript.Shell').RegRead(MsgPlus.ScriptRegPath + Email + "\\command3");
var optionSaved2 = new ActiveXObject('WScript.Shell').RegRead(MsgPlus.ScriptRegPath + Email + "\\command4");
MsgPlus.DisplayToast(ScriptName, "Options sauvées.\n\nCouleur de début : " + optionSaved1 + "\nCouleur de fin : " + optionSaved2);
optionSet1 = optionSaved1
optionSet2 = optionSaved2
Wnd.Close(1);
}
if(ControlId == "BtnDisable") {
var StartColour = "BtnDisable";
var EndColour = "BtnDisable";
new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command1",StartColour);
new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command2",EndColour);
MsgPlus.DisplayToast(ScriptName, ScriptName + " a été désactivé !");
Wnd.Close(1);
}
Look more carefully
|
|
02-26-2009 12:17 PM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
oh god thank you! I'll try to make a script from 0 in some hour..
|
|
02-26-2009 01:20 PM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
This post was edited on 02-26-2009 at 05:41 PM by Oceanor.
|
|
02-26-2009 05:40 PM |
|
|
matty
Scripting Guru
Posts: 8332 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Very simple script - very simple problem (I hope)
BtnCancel is automatically supported by Plus! to close the window without the need of any code. Therefore your function may not actually be called. Turn on Event traceing in the debug window first off.
Secondly post all of the code from the XML and the JS file so we can take a look at all of it. Just giving us what you did doesn't show any issues. (Reason I am asking is your Window may not actually be called Options. function OnWindowIdEvent_CtrlClicked() therefore you replace WindowId with the name of yoru window.)
This post was edited on 02-26-2009 at 06:44 PM by matty.
|
|
02-26-2009 06:36 PM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
Many many thanks.. finally i found the solution to my problem
I forgot to rename
function OnOptionsEvent_CtrlClicked(Wnd, ControlId)
in
function OnFinestracomandiEvent_CtrlClicked(Wnd, ControlId)
because I didn't know this modify to the function before..
So, thanks djdannyp and matty, if i can do something for you, just afk me
This post was edited on 02-27-2009 at 02:34 AM by Oceanor.
|
|
02-27-2009 12:02 AM |
|
|
Oceanor
New Member
Posts: 10
– / /
Joined: Feb 2009
|
O.P. RE: Very simple script - very simple problem (I hope)
Err, sorry again, another question ^^'
How can i edit a XML window having a preview of it? For now every change that i make i have to rar the xml file into the archive, rename it to plsc, import the script, start the script from messenger and view the window..
|
|
02-27-2009 10:04 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|