Are there escape characters in MCSI?
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Are there escape characters in MCSI?
Such as in other languages for example /n for a newline carriage return?
If so can someone point me at the correct reference?
thanks
** edit
What I want to do is pull data on a sector and output it on multiple lines on a single write to log file operation.
I can of course do a write to log file for each line of data I want to write but I consider that inelegant.
If so can someone point me at the correct reference?
thanks
** edit
What I want to do is pull data on a sector and output it on multiple lines on a single write to log file operation.
I can of course do a write to log file for each line of data I want to write but I consider that inelegant.
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
See that doesn't work,
If you do
What gets output to the logfile is:
This is \n a test
rather than:
This is
a test
as you might expect.
But thanks for the input.
If you do
Code: Select all
$test = "This is \n a test"
write to log file # 1972 append=[false] value=$test
return null
This is \n a test
rather than:
This is
a test
as you might expect.
But thanks for the input.
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
read the newline char from a t-file instead of writing it directly in the script, because the newline is parsed then (it is possible to add iit directly into a script, but tricky)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
OK. So I have the following script:
and the following file "1971.xml" in the t directory
the output to my test logfile is :
Where am I going wrong?
Code: Select all
$newline = read text: page=1971 id=1
$test = 'This is' + $newline + 'a test'
write to log file 1971 append=[FALSE] value=$test
return null
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated using X-Studio -->
<language id="44">
<page id="1" title="Title" desc="Description" voice="no">
<t id="1">\n</t>
</page>
</language>
Code: Select all
This isReadText1971-1a test
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
You have to load the text file first.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
I highly recommend to put all your texts into your t file. Here is an example :
In the t file :
The name of the sector will be displayed in yellow (Y). Other colors : White, Silver (A), Green, Orange, Red, Default (X), Magenta, Blue and Cyan.
Refer to this to not use a t file already used by another mod.
Code: Select all
$Text.Page = 7321
load text: id=$Text.Page
$Greetings = read text: page=$Text.Page id=100
$MySector = [SECTOR]
$Author = 'Big Daddy'
$Text.f = sprintf: fmt=$Greetings, $Author, $MySector, $Value, $Value, $Value
write to player logbook $Text.f
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<language id="44">
<page id="7321" title="Title" descr="Desc">
<t id="100">[author]%s[author]Hello,\n\nWelcome to \033Y%s\033X !</t>
</page>
</language>
Refer to this to not use a t file already used by another mod.
You test file is not correct. You are looking for test in page 1971, but in your text file you put it in page 1Luke Skyscraper wrote:OK. So I have the following script:
and the following file "1971.xml" in the t directoryCode: Select all
$newline = read text: page=1971 id=1 $test = 'This is' + $newline + 'a test' write to log file 1971 append=[FALSE] value=$test return null
the output to my test logfile is :Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Generated using X-Studio --> <language id="44"> <page id="1" title="Title" desc="Description" voice="no"> <t id="1">\n</t> </page> </language>
Where am I going wrong?Code: Select all
This isReadText1971-1a test
you need to make the page id from the text file match the one you are using in the script.
you also need to load in the text file, using the load text:id= command
Yoush! Got it. Thanks Cycrow - Just this little thing has been a valuable lesson in how t files work.Cycrow wrote: You test file is not correct. You are looking for test in page 1971, but in your text file you put it in page 1
you need to make the page id from the text file match the one you are using in the script.
you also need to load in the text file, using the load text:id= command
My output to the logfile is now
This is
a test
Just as I wanted. Now I can use that newline char to build better log messages.
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04