[SCRIPT] Manual Trade Extension v2.3.1 [2010-10-02]

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

Post Reply
ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

[SCRIPT] Manual Trade Extension v2.3.1 [2010-10-02]

Post by ThisIsHarsh » Tue, 18. Nov 08, 18:01

Manual Trade Extension

:arrow: Adds a new command to the Trade menu: "Best buy/sell loop". Uses straightforward best buy/sell in a loop, but with some advanced extras, such as trading more than one ware, trading from a parent storage ship, and prioritising player-owned stations as sources.


:arrow: Required: JSON parser library v1.1 (thread)

:arrow: Download: Manual Trade Extension


:arrow: Config menu example (jpg)

:arrow: Details:
  • When you start the command a menu will appear. The core of Manual Trade Extension is the buy and sell lists. In the simplest mode of operation you can just add a ware to both lists and the freighter will repeatedly best buy then best sell that ware, refueling as necessary if jumpdrive is available, autojump is enabled and refuel settings configured.
  • Requires: Trading System Extension; Trade Command Software MK1; Best Buys Locator, Best Selling Price Locator; Transporter Device (optional - for using homebase ship as depot).
  • The buy and sell lists can be configured independently. You can then simultaneously trade in a ware, stockpile another ware and sell off excess wares.
  • You can specify for each individual ware whether it should be bought/sold at below/above average price, or any price.
  • You may specify a list of your own stations/ships that are to be used as preferred sources for buying wares. Then individually set each ware to restrict it's purchase to preferred sources.
  • You can buy/sell from a homebase ship, provided the freighter has a Transporter Device. This means wares will be dropped off/picked up from the homebase ship after each round of purchases/sales.
  • Wares using the most volume in the cargo bay are generally sold off first. Conversely, wares using the least volume are bought up first.
  • Some examples of how this can be used:
    • Independent trader, buying then selling the same set of wares over and over.
    • Easily selling off scavenged wares.
    • Continuously buying up and stockpiling rare wares whenever they become available.
    • Keeping a carrier fully stocked with equipment from your own factories.
    • Network of traders using a larger 'hub' ship as a storage depot.
  • The way the freighter works its way through the buy/sell lists is as follows:
    1. The freighter goes through each item on the buy list in turn, attempting to purchase it. If "Buy until full" is disabled, then the freighter immediately switches to the sell list, otherwise the freighter will keep cycling through the buy list until it can't buy any more, for whatever reason.
    2. The freighter will then go to drop off it's wares at it's homebase ship, if applicable.
    3. The freighter then goes through the sell list. If buying/selling from its homebase, the freighter will take one ware at a time and return to dump unsold wares and pick up the next ware in the list. If "Sell until empty" is disabled, then the freighter will just do one loop through the sell list before returning to the buy list, otherwise the freighter will keep cycling through the sell list until it can't sell any more, for whatever reason.

Changelog
v2.3.1:
- Fixed: bug in menu "homebase max storage" only editing first option.
v2.3:
- Modifed: new menu system.
- Fixed: issues with trading energy cells.
v2.1.1:
- Fixed: workaround for issue with stock !lib.get.bestbuy/sell exclusion sectors.
v2.1:
- Added: 'buy until full' and 'sell until empty' options.
- Added: 'refuel from homebase' option.
- Added: tasks (buy only, sell only, buy + sell).
v2.0.1:
- Fixed: minor issue - added handling of null station return from lib.best scripts.
v2.0:
- Complete revamp, initial release.
v1.0:
- Initial release.
Last edited by ThisIsHarsh on Sat, 2. Oct 10, 20:44, edited 18 times in total.

999-JAY-999
Posts: 610
Joined: Mon, 7. Apr 03, 16:29
x3tc

Post by 999-JAY-999 » Tue, 18. Nov 08, 22:14

Hot off the press comes another fab script !
System Spec :-

AMD Athlon(tm) 64 Duel 6000+ (3.01GHz)
Windows XP Home Ed. SP 3
ATI Radeon HD 4850 (512)
Creative X-FI Soundard
2.00 GB of RAM
G9 RAZOR Mouse

User avatar
corhen
Posts: 335
Joined: Thu, 16. Oct 08, 08:45
x3tc

Post by corhen » Tue, 18. Nov 08, 22:59

sounds great, look forward to trying it out

Keep up the good work

User avatar
juanitierno
Posts: 435
Joined: Fri, 28. Dec 07, 18:06
xrvr

Post by juanitierno » Wed, 19. Nov 08, 02:44

whats the difference with the "manual trade run" command (i think supply software gives it) with the "repeat forever" option?

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Wed, 19. Nov 08, 03:19

juanitierno wrote:whats the difference with the "manual trade run" command (i think supply software gives it) with the "repeat forever" option?
Manual trade run continuously buys and sells at the same two stations over and over. It also doesn't automatically refuel ecells.

This script searches for the station with the best price to buy/sell at in all sectors where you have property (e.g. satellite network). It also automatically refuels ecells as necessary.

PaulP
Posts: 185
Joined: Tue, 18. Nov 08, 01:50
xr

Post by PaulP » Sat, 22. Nov 08, 19:06

Why does this have two t files? 7103-L044.xml and 7103.xml, both are english and exactly the same inside.

Should I delete one of them?

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 22. Nov 08, 19:28

PaulP wrote:Why does this have two t files? 7103-L044.xml and 7103.xml, both are english and exactly the same inside.

Should I delete one of them?
7103.xml is packaged. The plugin manager automatically copies+renames it, asssumedly to whatever language you are using (english being L044). It is safe to delete one of them, but not necessary.

All future versions of my scripts I'll package with the -L044 there straight away, so perhaps best to delete the 7103.xml, but it really doesn't matter which you delete or if you don't delete at all.

PaulP
Posts: 185
Joined: Tue, 18. Nov 08, 01:50
xr

Post by PaulP » Tue, 2. Dec 08, 05:22

Haha, just playing around with it I made it so that this script used my Gateless Jumpdrive.

Talk about overpowered... the combination of the two scripts is just ridiculous. The ship jumps directly to a station, docks within about 20 seconds, jumps to the next station, docks within about 20 seconds. Even with the minor delays in buying and such the trader is probably doing a complete buy/sell every minute.

I was thinking about making a modification of the move scripts to make ships use the GJD when their auto jump was on and minimum jumps was set to 0, but after seeing this I'm thinking it would be too unbalancing.

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Tue, 2. Dec 08, 05:44

Yeah I try to avoid scripts which modify the game mechanics to such a degree in general, not least for the reason you just mentioned. If you were to make such a change, you would have to balance it in other ways.

Already a lot of my freighters are on standby most of the time because they have milked the profits to be had for the given ware dry.

rascalcmos
Posts: 6
Joined: Mon, 12. Jan 04, 11:07

WANTED: Repeat "Remote Best Buy"/"Remote Best Sell" Script

Post by rascalcmos » Fri, 9. Jan 09, 20:00

EDIT: found it here:
http://forum.egosoft.com/viewtopic.php? ... ght=repeat

Hi,

I know this script exists (I remeber seeing it) - it basically consists in being able to repeat the "Remote Best Buy"/"Remote Best Sell" for a given product...

Problem is: I can no longer find it (tried the search without success).

The "Queue Command" script would be fine - but it doesn't seem to work yet with the 1.4 version I am using?

Thanks for pointing me to that script.

Rascal


{You did find, so I did merge. jlehtone}

Crapgame
Posts: 130
Joined: Sat, 3. Jan 09, 16:03
x3tc

Re: [SCRIPT] Manual Trade Extension: Best buy/sell loop v1.0 [2008-11-18]

Post by Crapgame » Mon, 26. Jan 09, 17:13

ThisIsHarsh wrote: :arrow: The ship will only buy at less than the ware's default price and only sell at equal to or greater than the default price.
I'm missing something here.

Where do I set this "default price"?

:arrow: I have a properly equipped freighter.

:arrow: I select best/sell loop from his trade window. It asks me to select a sector which I do. It asks me to select a station which I do.

:arrow: Then it asks me to select a ware and it lists both the product and the required resources for that station. Lets use a Solar Plant for example. It will ask me to select E-Cells or Crystals.

:arrow: If I select e-cells it just goes on it's way. Where exactly, I'm not sure.

Where do I select this "default price"?

How far away will it go to sell this load?

What if there is another solar plant in the same sector that offers a lower price, will he start going there?

If I select crystals, I assume he'll go buy crystals at the best price and bring them back here. How far will he go for that?

When he buys ecells for jump fuel, how much will he buy?

Does this not work if your have the Trade Command MK3 software installed? I tried to set one of my STs to do this and the command doesn't show.

Is there a limit to how far he'll go? I set one to buy Teladianium and he's just idling. Granted, there is no Teladianium in that sector to buy, but I assumed he'd go find some.

Crapgame
Posts: 130
Joined: Sat, 3. Jan 09, 16:03
x3tc

Post by Crapgame » Thu, 29. Jan 09, 00:10

Anyone using this script know?

User avatar
apricotslice
Posts: 13734
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 29. Jan 09, 04:31

The price would be whatever you set on the factory sell/buy price.

The jump range is set on the factory as well.

Not using it, so cant answer any of the other questions.

Re UT though, one would need to check that the command slots being used didnt conflict.

Crapgame
Posts: 130
Joined: Sat, 3. Jan 09, 16:03
x3tc

Post by Crapgame » Thu, 29. Jan 09, 14:09

So I have to OWN the factory?

I didn't get that from the original explanation.

User avatar
apricotslice
Posts: 13734
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 29. Jan 09, 14:15

:lol:

Sorry, cant help it, but that made my day ! :D

Post Reply

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