[SCRIPT] MK3 Trading Log (plus MK3 Technical Datasheet)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

[SCRIPT] MK3 Trading Log (plus MK3 Technical Datasheet)

Post by SymTec ltd. » Wed, 17. Jun 09, 15:31


MK3 Trading Log
Logging function for Trade Command Software MK3
(for X3TC 2.1 and higher)

[ external image ]

MK3 Logging

Setting up a MK3 trader takes a lot of money. You need to buy a good ship, with excellent shielding and quite expensive software extensions. As soon as you start the trader, you give him full access to your bank account, so he could possibly be spending all your money to buy fighter drones and jumpfuel. With all that in mind, you should be very interested in your trader's cashflow.

The MK3 Trading Log uses a debug logging function of X3: Terran Conflict to write a detailed log for your traders' actions. You can then view this log with every web browser. The logging function has been part of the MK3 Software since X2, but many people forgot about it in the meantime. You can view a log of my personal trading empire here.



Links and Downloads
  • datasheet_en.pdf (Outdated link) - Manual for the Trade Command Software MK3, including a chapter on the logging function
    logging.zip (Outdated link) - Files to activate and deactivate logging and view the log (New link from xdownloads: logging.zip)
    x2trader.xml (Outdated link) - example log
Quick Readme

Step-by-step-instructions to get to your trading log
1.: Download "logging.zip" and extract the folder "trader" to the X3TC game folder
2.: Double-click "logging_on.bat" in the "trader"-folder to turn the logging function on
3.: Play the game
4.: Double-click "create_stats.bat" to create the trader log
5.: Double-click "view_stats.html" to view the trader log

If your log gets too long: Double-click "clear_log.bat"
To uninstall: Double-click "logging_off.bat" to turn the logging back off.

If you want easier access to the "create_stats" and the "view_log"-buttons, you can create a shortcut to the respective file and move it wherever you like. As the logging function is a mostly external tool that changes almost nothing inside the game, this tool does not create a *modified*!


Color codes
  • Grey: Loading a new savegame
  • Green: Starting a new trader
  • Yellow: Completed trade run
  • Orange: Pilot Training
  • Red: Buying ship upgrade/Energy/Drones
Known Limitations
  • This tool works only with English and German windows installs. For other languages, you must edit the file "create_stats.bat"
  • ".bat"-files are very powerful and are therefore blocked by some virus scanners. It is possible to work without them, but that's not as simple
  • This tool does not work with X3TC versions prior to 2.1
  • It is not possible to turn the logging on or of depending on your savegame. Every game will log to the same file.
Links

UTProfit by euclid
MK3 Handelsprotokoll (German)

[ external image ] [ external image ]


Edit: Added working xdownloads link for main download (logging.zip) and marked outdated links. X2-Illuminatus
Last edited by SymTec ltd. on Wed, 17. Jun 09, 16:06, edited 1 time in total.

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Wed, 17. Jun 09, 15:31

You may also want to take a look at the MK3 Blacklist Manager, a little plugin for managing a blacklist of sectors and stations that will be excluded from MK3 trading.
Last edited by SymTec ltd. on Sat, 10. Apr 10, 22:56, edited 1 time in total.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 18. Jun 09, 20:43

I've been taking a look at the logging feature and it's cool 8) . Could I use this feature on my FDN mod? Please.....


LA

Edit: I'll have to test the feasibility as the amount of entries FDN will generate could get huge, especially with lots of stations :(

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Thu, 18. Jun 09, 21:28

Logain Abler wrote:I've been taking a look at the logging feature and it's cool 8) . Could I use this feature on my FDN mod? Please...
There's nothing stopping you from writing things to a specific logfile, but you should not break the syntax, no additions to the stylesheet, and give the players the choice of using it or not (i.e. include a switch to turn it on or off).

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 18. Jun 09, 21:34

SymTec ltd. wrote:
Logain Abler wrote:I've been taking a look at the logging feature and it's cool 8) . Could I use this feature on my FDN mod? Please...
There's nothing stopping you from writing things to a specific logfile, but you should not break the syntax, no additions to the stylesheet, and give the players the choice of using it or not (i.e. include a switch to turn it on or off).
Cheers your a star.

LA

Shagsbeard
Posts: 63
Joined: Wed, 13. May 09, 22:28

Post by Shagsbeard » Fri, 19. Jun 09, 00:47

I haven't been able to get the log to work... I'm using STEAM version so it might be that. I believe I've read the instructions correctly and have turned logging on, but am getting nothing but a blank page for the view_stats document.

Edit: Here's the path to my folder:

C:\Program Files (x86)\Steam\steamapps\common\x3 terran conflict\trader

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Fri, 19. Jun 09, 15:43

Shagsbeard wrote:I haven't been able to get the log to work... I'm using STEAM version so it might be that. I believe I've read the instructions correctly and have turned logging on, but am getting nothing but a blank page for the view_stats document.
Hm, I didn't test with steam installs.

* In your "scripts"-folder, can you give me the "last modifed"-date of file "!plugin.autotrade.logging.pck"?
* Does a file "log01500.txt" exist in your "\My Documents\Egosoft\X3TC"-directory? (Do you have such a directory?)

Shagsbeard
Posts: 63
Joined: Wed, 13. May 09, 22:28

Post by Shagsbeard » Fri, 19. Jun 09, 20:04

There is no "!plugin.autotrade.logging.pck" in my scripts folder.

There is a log01500.tex file... its current with my last game played and 64K in length. I can cut/paste it here if you want it.

scaseman
Posts: 78
Joined: Sat, 13. Mar 04, 19:24
x3tc

Post by scaseman » Sat, 20. Jun 09, 01:34

Im had a few problems as well, But after a bit of poking around I found that the .xml file ends up in a subdirectory of trader called files. This subdirectory is hidden for some reason. You can just view this file as normal.

XGamer
Posts: 2355
Joined: Sun, 25. Apr 04, 19:09
x4

Post by XGamer » Sat, 20. Jun 09, 03:23

the view_stats.html does nothing else than redirecting to said .xml file. the files folder is hidden so that ppl dont mess around with the more or less important stuff in there and / or dont get confused with the techinal stuff behind it ;)

While I myself open the xml file directly aswell its working fine with the view_stats.htm file. Try using a proper Browser and check if there is an Option and / or Plugin (in case of FireFox) that prevents Autoredirection. If so you have to disable said Option and allow Autoredirecting for it to work.

If thats not the case then check the (hidden) files directory for an x2trader.xml File. If there is none or its empty you will have to doubleclick create_stats.bat again. If its still not there or still empty something is blocking the bat execution. In this case see below.


@Shagsbeard:

You have to doubleclick the logging_on.bat File in the Trader Folder first. After you doubleclicked said file there will be a black window popping up for a splitsecond. Once this has happened check the scripts folder again for the File Symtec mentioned. If it still does not exist your Antivirus, or Firewall Software probably blocked it and you will have to turn both of them off. After you turned those off try again from the beginning of this Text (doubleclicking logging_on). If it worked then you can turn your Firewall and Antivirus on again.

greetz
XGamer
X:BtF: 7/10 | X2: 8/10 | X3:R/TC/AP: 8/10 | X:R: 3/10 | X4: 0/10 (3 points for split ships and stations, 4.0 -> -50 points).
If you are raising pirate activity, give me meaningful ways to deal with them PERMANENTLY. Better things to do than replacing ships every 10 minutes, or babysitting ships getting harassed.
Stopped playing X4 with 4.0 due to outrageous, needless and pointless nerfs to everything. Don't change what wasn't broken in the first place.

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Sat, 20. Jun 09, 11:10

!plugin.autotrade.logging.pck is a default file of X3TC (and my .bat's don't remove it), so I don't believe that it isn't there.

If the log01500.txt already exists, then you turned the logging on correctly (this means that batch execution works and you don't have to worry about the logging.pck anymore). In this case, the following problems are possible:

* you did not execute create_stats (solution: do so)
* the path to your log01500.txt is not "My Documents/Egosoft/X3TC/", so that create_stats does not find the file (solution: correct the path in create_stats.bat)
* the redirect-function of your browser is disabled (solution: open /trader/files/x2traders.xml with your browser)

Shagsbeard
Posts: 63
Joined: Wed, 13. May 09, 22:28

Post by Shagsbeard » Sat, 20. Jun 09, 14:20

Thanks everyone. It was the third one. The xml file was there in the hidden dirrectory and I could view it correctly when I opened it.

siman
Posts: 5
Joined: Fri, 7. Nov 08, 05:36
x4

Post by siman » Sat, 27. Jun 09, 19:14

if you are using Vista, the log is in the folder "document" instead of "my document"

I modified create_stats.bat to work on my pc:
if exist "%userprofile%\Documents\Egosoft\X3TC\log01500.txt" set logfile=%userprofile%\Documents\Egosoft\X3TC\log01500.txt

louwok
Posts: 26
Joined: Mon, 27. Jul 09, 19:52
x3tc

Post by louwok » Sun, 2. Aug 09, 13:33

hello
I'm french and I would know how I can translate the wiew stats in french please. Because I have translate a file but it doesn't work after :D
and I don't understand what is "Checksum total" ???

and it can possible to update the log only with a refresh of the page in the browser ???

floppo
Posts: 15
Joined: Sat, 8. Aug 09, 00:45
x3tc

Post by floppo » Sat, 22. Aug 09, 06:05

I have a problem using this. I can't find either !plugin.autotrade.logging.pck (there's one called plugin.autotrade.writelog.pck, though), or log01500.txt. I tried disabling my virus scanner before running the bat file, but it still doesn't seem to work.

Kazantia
Posts: 41
Joined: Wed, 6. Nov 02, 20:31
x4

logging for trade command software mk3

Post by Kazantia » Thu, 7. Jan 10, 16:28

hey all,

i am playing X3TC for a while now and bought me that autotrader mK3
i enabled the logging and all logging is wotking fine, except one (the jump log)

i know fom X3R hat that logging worked fine but now in X3TC it displaus NULL for the fuel it used and for the Fuelonboard

is this a bug in the script?
I hope someone can help me or solve this, i want to know what my ship is costing me to trade

i am playing X3TC version 2.5

Greetz Kazi


{Merged/tidied (to here) - Carlo}

Kazantia
Posts: 41
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Kazantia » Thu, 7. Jan 10, 23:43

i have no mods or whatever installed even no additional scripts.

Is there anyone who also uses the logging option?
if so please let me know if you have the same problem as i have

I know from the past that X3R didn't had that problem!

i am writing a parser that will put all these things in a database and calculate the real profit for the ships
hopefully i wil be able to put them one day online

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Fri, 8. Jan 10, 19:51

At the actual topic: The "null"-entries look like a bug, though I am currently not able to fix any script bugs at that level. To fix it, you have to find a scripter to find and solve the problem (most likely a simple variable error); otherwise you just have to live with it.

At the question why the topic on the trader logging is posted in S&M: The debug log is not meant to be used for other purposes than debug logging. The logging functionality is inside the MK3 software (which is why this plugin doesn't create a *modified*), but is still activated by a script, there are bugs, and the installation process is not always easy - these properties make it more S&M than X-U.

STL

As for the merge: This topic would actually be a good destination.

festa_freak
Posts: 207
Joined: Sat, 29. Dec 07, 18:16
x3tc

Post by festa_freak » Sat, 16. Jan 10, 06:43

I seem to have a little trouble :S

I get an error message.

Here is what I did:

1) turned logging on.
2) played game.
3) about an hour later I alt-tabbed and clicked create_stats.
4) clicked view_stats and got this vvv

Code: Select all

XML Parsing Error: not well-formed
Location: file:///C:/Program%20Files/Steam/steamapps/common/x3%20terran%20conflict/trader/files/x2trader.xml
Line Number 12601, Column 76:<attack ship="UT 1" sector="Unknown Sector" attacker="Unknown Object" ID=" <invalid>HP-11" escapestation="Free Argon Trading Station(Nathan's Voyage)" />
---------------------------------------------------------------------------^
Do i have to do this out of the game? Quit completely, then create stats? This appears in the .xml that opens in firefox.

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Sat, 10. Apr 10, 23:00

Looks like the "<invalid>"-tag is a problem. You have to remove that from the original log file (with notepad/any editor, search for that string and delete it), or clear the log.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”