[SCRIPT] UTProfit (v 1.0 28-04-09)

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
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

[SCRIPT] UTProfit (v 1.0 28-04-09)

Post by euclid » Fri, 24. Apr 09, 18:38

What it does:

A trader utility script for those of you who run lots of MK3 traders. Thanks
to the new menue features it's a bit more comfortable than the X3R version.

Just execute it from your ship to get a list of all your MK3 traders, then
click on any in the list to get the overall profit. Hit Esc to get back to the
list and select another of your traders or hit Esc again to quit the script.


Installation:

Copy the 7006-L044.xml into you t folder, copy the setup.UTProfit.xml and the
UTProfit.xml into your scripts folder.


Resources:

It uses trade command 41, t-file 7006 with pid 2010 (tid 441) and (also in
the 7006 file) pid 9900 (tids 01-03).


Where to get it?

Updated version 1.0: local trader added, info on current sector and status added.


[ external image ]

(Big THANKS to all that helped to sort the URL out, in particular to Giskard
who finally solved the puzzle).


Example

Execute UTProfit from the trade menue of your ship to get
[ external image ]

then select one MK3 trader and click to get further details like this
[ external image ]


Feedback

Please don't hesitate to post any feedback. I'm currently improving the info and have added trader's current location (the sector he's in atm) and the trader's status (local, sector or universe trader). Any other useful info to be added?





Hope you will find it useful.


Cheers Euclid

Edit: images added.E.
Edit2: version 1.0 info added.E.
Edit3: tested with X3:TC and AP - works just fine; even no need to activate SE. Just install as instructed and use it. E.
Last edited by euclid on Wed, 9. Jan 13, 19:06, edited 8 times in total.
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob » Fri, 24. Apr 09, 20:38

Hi,

Useful script!

Have downloaded and will try later...

Cheers,

Scoob.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 28. Apr 09, 14:23

Hi, need help with this install.

I have the 2 files in scripts folder and 1 file in t folder, and run the trade command Profit.

But the result is a blank window with an Info word on the top right. Hitting ESC gives me a new window saying:

Trader: Unknown Object
ship: null
profit: 0

Any suggestions?

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 28. Apr 09, 15:03

It should happen only if you don't have any MK3 trader. How many MK3 trader do you have?

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 28. Apr 09, 15:19

6, all ST traders but all >L8 and all are currently running ST when the command is fired.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 28. Apr 09, 15:23

Could you please check which script is running on any of them? To do that enable additional script info in the SE and then find one of your STs and get the ship's info, scroll down and you should see all scripts running on that ship.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 28. Apr 09, 15:49

I wrote to my logbook the array size in your original script. Start was 25 ships. After scanning thru *.galaxy and *.sector the value is 0.

I did a hack job:

Code: Select all

$ships =  get ship array: of race Player class/type=Moveable Ship
002   $nships =  size of array $ships
003   while $nships
004   |dec $nships = 
005   |$ut = $ships[$nships]
006   |$gain = $ut -> get local variable: name='Gain'
007   |if $gain > 0
008   ||$sgain =  convert number $gain to string
009   ||$pilot = $ut -> get pilot name
010   ||write to player logbook: printf: pageid=9900 textid=4, $pilot, $ut, $sgain, null, null
011   |end
012   end
013   return null
It was able to print into my log showing all my STs' name, ship and profit.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 28. Apr 09, 16:22

That's very odd. Every MK3 trader should have either plugin.autotrade.sector (sector trader) or plugin.autotrade.galaxy (universe trader) running.

Please check which scripts are running on any of your traders. Can you see either of the above?

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 28. Apr 09, 16:28

plugin.autotrade.local and plugin.autotrade.local.start

8)

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 28. Apr 09, 16:50

Thanks :-)

Okey, there are 3 types of MK3 traders: local, sector and universe. Atm UTProfit covers only the last two. I will upload a new version that adds the local trader.

Any further info that I should add to the info screen (see first post)?


Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 28. Apr 09, 17:21

New version uploaded. Please try this one arcana75 and thanks again for the feedback :thumb_up:

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 28. Apr 09, 17:44

Thanks for the fix! I'll try it out tomorrow as it's abit late here.

What's the diff between local and sector trader? FWIW my STs run Sector Trader with 3 Jumps.

As for info, I dunno if the data is available but the following would be nice to have:

- Total runtime (good for benchmarking)
- Current load (eg e-cells) or maybe current command (eg buy ware best price... e-cells)

A suggestion not sure if possible, maybe divide the MK3 Trader list in the menu to Universe, Sector and Local traders? Then in the individual trader display there is no need to display "trader status" and it's a quicker way to sort out a player's traders.

User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER » Tue, 28. Apr 09, 19:00

I would add the sector the trader is in and his id code to the main menu.
So entries like this would be generated:

Argon Prime: Mistral UT 13 (YRKS-23)

Would give a better overview, in my opinion.

It would also be interesting to see, how the numbers my script 'Trade Overview' gets, differ from the numbers your script gets directly from the merchants.
I think I'll have to check that. =)

Greets,
ScRaT

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Wed, 6. May 09, 12:16

arcana75 wrote: .........What's the diff between local and sector trader? FWIW my STs run Sector Trader with 3 Jumps.
I think if you restart a sector trader of level +8 it requires a max jump range and that makes him a local trader.
arcana75 wrote: ......As for info, I dunno if the data is available but the following would be nice to have:

- Total runtime (good for benchmarking)
- Current load (eg e-cells) or maybe current command (eg buy ware best price... e-cells)
.........
The script is very simple and accesses the already available local variable $Gain. The total runtime is not recorded and would require additional variables. It's also tricky because the player may decide to stop his trader for a while which is next to impossible to detect via scripting. However, the current load/command is easy to add.

Thanks for the feedback.


Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Ezuku
Posts: 140
Joined: Sat, 21. Jan 06, 00:31
x2

Post by Ezuku » Wed, 20. May 09, 06:32

Looks cool, haven't tried it out yet (no UTs in my current game), but I think you could improve it by having a profit / hour display, overall profit isn't nearly as important.

eddieg
Posts: 153
Joined: Tue, 9. Dec 03, 16:10
x4

Post by eddieg » Thu, 18. Jun 09, 02:09

Is this profit since the first time that pilot ever started trading, or since the script has been added?

This might be one of my first scripts, it sounds very informative.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Sat, 20. Jun 09, 17:47

It's the profit the pilot made since the last start of the UT/ST command.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
Reisser
Posts: 745
Joined: Mon, 28. Feb 05, 15:39
x4

Post by Reisser » Wed, 16. Dec 09, 22:33

Nice script - thanks ;)

I use it for the german version of TC and translated the few lines of the t-file. But some text is hardcoded in the script itself. Ok - I can change this too - but I don't want to have different script-versions.

If you make an update of this script - would it be possible to put all text (window-titles etc) in the t-file please?

It's not so that I can't read english - haha - but I prefer to have the whole game in only one language *g* By the way I could publish this script in the german community too

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Fri, 18. Dec 09, 15:26

Reisser wrote:Nice script - thanks ;)

I use it for the german version of TC and translated the few lines of the t-file.... ***snip***.... By the way I could publish this script in the german community too
By all means, please feel free to publish your German version.


Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
perkint
Posts: 5191
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by perkint » Fri, 26. Feb 10, 15:46

Hi Euclid,

Would it be possible (ie is it possible and do you have the time!) to include the current instruction of the trader?

In other words to include on the report whether he's:

1. Sector trader
2. Local Trader (include base sector and jump radius)
3. UT.

As I say, not sure if this info's even available, but would be fantastic if so :D

Tim
Struggling to find something from the forums - Google it!!! :D

Post Reply

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