EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[SCR] OK Traders v1.7.1 (04-12-14)
Post new topic Reply to topic Goto page 1, 2, 3 ... 26, 27, 28  Next
View previous topic :: View next topic
Author Message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Tue, 14. May 13, 00:47    Post subject: [SCR] OK Traders v1.7.1 (04-12-14) Reply with quote Print

OK Traders

OK Trade (trade command)
- Operates as a free trader when no homebase is set (like UT)
- When homebased it trades multiple wares for its homebase (like CAG)
- Coordinates with other OK Traders
- Monitors profitability and replans trade runs
- Scans for hostiles and escapes before getting attacked.
- No micromanagement, levels or special equipment requirements.

Configuration Options
- Broadcast settings to multiple ships
- Auto-rename (off by default)
- Trade illegal wares (free trader only, off by default)
- Sector blacklist (for station selection, not move-pathing)
- Equipment config
- Respects dockware manager ware limits
- Optionally tether a free trader to a sector and set a range it can trade in.
- Economy boost mode for free traders.

Requirements
- Trade command software MK2

Compatibility
- Terran Conflict and Albion Prelude

Format
- ZIP file containing T file and script files.

Download



Release notes and details can be found in subsequent posts.

References
- Developed using X-Studio
- Hosted by XDownloads

Resources Used

The resource IDs have been selected based on available slots in the community script and download library thread. However this does not preclude the possibility of conflict as those IDs may only reflect resources used in the scripts that thread indexes.
Code:
Text File
  9055
Trade Commands
  448: COMMAND_TYPE_TRADE_48



Edit: added working download link. X2-Illuminatus


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.


Last edited by Shimrod on Thu, 4. Dec 14, 02:58; edited 38 times in total
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Tue, 14. May 13, 00:47    Post subject: Reply with quote Print

Change Log

1.7.1
- Fix a bug which could lead to station ware limit settings corruption, causing traders to gradually use more CPU. If corruption is detected in 1.7.1 the station ware limit config will be reset to default.
- Fix a bug where homebased traders with jumpdrives would perform a 'best chance' station search instead of 'best price'.
- When evaluating docks to buy or sell at, examine other elligible docks trading at the same price to determine a more favourable stock level.

1.7.0
- Add Stock Limits settings accessible from homebased trader menus to support intermediate ware trading. Traders avoid selling below the minimum stock limit and avoid buying above the maximum stock limit. The limits apply to all traders at that homebase.
- Fix a bug with trading energy cells that could cause homebased traders to sit around in a station (1.6.2 regression)

1.6.4
- Add option for broadcasting OK trade to AP fleets
- Allow broadcasting from free traders in addition to homebased traders

1.6.3
- Add a blacklist menu option for adding all sectors belonging to a selected race
- Fix a bug where homebased traders would sell all their jumpfuel before returning home after a sale (1.6.2 regression)

1.6.2
- Fix a bug with the blacklist Clear button not working (1.6.1 regression)
- Prevent traders from selling Replicators
- Optimize the amount of jump energy for homebased traders based on current activity and reduce free trader energy stores by 20%

1.6.1
- Remove the ship ID code from auto-naming and instead add it explicitly into the attached warning message
- Let stations be blacklisted in addition to sectors
- Set default ware trade mode for intermediate products to None

1.6.0
- Added a broadcast option for homebased traders to share settings with multiple ships.
- Changed auto naming scheme for homebased traders. Names now include job names where applicable (e.g. Weapons Dealer)
- Set default ware mode for dock class homebases to No Trade
- Added equipping options to disable cargo life support and duplex scanners
- Avoid buying duplex when triplex is available
- Fix traders were only buying from docks when no factories qualified
- Fix eco traders not buying from docks

1.5.2
- Exempt traders homebased at docks from the 'Min Stock Level Trade %' setting when selling the dock's wares. The setting still applies to buying.

1.5.1
- Add equipping option for rudder optimizations
- Disable laser and missile equipping by default for new installs
- Rename Settings menu to Global Settings
- Add config option to disable the alert noise when trader is targetted
- Add text files for DE, PL, CS, IT, ES, FR, RU with English strings.

1.5.0
- Add simple global on/off equipment options to the config menu (lasers, shields, missiles, drones, docking computer, jumpdrive, triplex)
- If the trader lacks engine tunings or jumpdrive (if enabled) it will fly directly to docks to buy these goods in that order as top priority.
- For all other equipment the trader will only buy them if it happens to be docked at a station selling that item.
- Traders retain installed (i.e in shield bays or gun slots) lasers and shields regardless of whether the respective options are enabled.

1.4.3
- Fix: traders might not refuel before selling a ware outside their jump fuel range.

1.4.2
- Several performance enhancements, notably for economy boosting traders.
- Fix: exclude marines and mercenaries from being traded (always been present)
- Fix: free traders with docking computers would buy more wares than the destination station could buy. (1.4.0 regression)

1.4.1
- Improve eco trader performance a little when evaluating wares to trade
- Fix: prevent eco traders from selling secondary resources to stalled factories, not helping economy
- Fix: ships buying wares at docks would sell the ware back to the dock afterwards (1.4.0 regression)

1.4.0
- Add an economy boost mode for free traders, where they prioritize trading at stalled factories.
- Add free trader tether sector and tether range options to restrict free trader movement
- Have homebased traders observe dockware manager stock level limits configured on player docks.
- Traders now make use of docking computers when installed, and will buy a docking computer if they happen to dock at a place that sells one.
- Performance optimizations.
- Fix: repair shipyard selection was failing to respect blacklist
- Fix: homebased trader ware settings were not updated when wares were added/removed from the homebase tradeable ware list.

1.3.2
- Balance statistics are now resettable and display with comma separators. Collective balance now tracked in a global rather than summing trader values.
- Fix: balance statistics rollover when exceeding signed int max. Now tracks billions (thousand millions) in a separate integer.
- Fix: blacklisting non jumpable sectors could add duplicate list entries, and would blacklist sectors with jump beacons

1.3.1
- Homebased traders now only test the homebase can afford 1 unit of a ware rather than an amount equal to min(free space ship, free space station).

1.3.0
- Homebased traders now buy jumpdrives in addition to free traders.
- Traders repair hull damage at shipyard
- When docked opportunistically buy and equip a quantity of missiles, drones, tunings (not cargo), scanner, jumpdrive, shields
- Reserve against sale a quantity of supported missile types, compatible lasers (ex. TB, MDS), installed shields, drones, and a jump beacon.
- Launch missiles and drones when under attack
- Increase intelligence around refuelling and fleeing.
- Add blacklist options to add pirate, non-jumpable, and war sectors.
- Increase the attacked warning subtitle message duration from 3 to 6 seconds.
- Rapidly restart the command script on version upgrade, rather than waiting on action completion. May not take effect until +1 releases ahead.
- Display collective free trader balance underneath the current traders balance in the free trader's menu. Note this only includes profits from currently existing player ships.
- Disable selling wares to player owned stations.
- Fix: traders could erroneously believe they had sufficient jump energy to jump when they didn't (since 1.0.0)
- Fix: attempting to top up jump energy exceeding available cargo space (since 1.1.0)
- Fix: take into account infinite buyers when free traders assess trade run profits (since 1.2.0)
- Fix: monitor task could exit on version upgrade and not start again until the ship's move action completes, leaving traders vulnerable (since 1.1.0). May not take effect until subsequent upgrades.
- Fix: race condition where 2 free traders could perform the same trade (since 1.2.0)

1.2.3
- Switch display command to COMMAND_REFUEL when moving to an SPP.
- Revised criteria for searching stations by best-price vs best-chance vs nearest.
- When rerouting a buying mission check the ship can jump to the new destination, otherwise reevaluate.

1.2.2
- Fix if the cargo bay is completely full a trader won't sell the ware (introduced 1.2.0)

1.2.1
- Free traders will buy a jumpdrive if they don't have one already.
- Preserve free trader's profit tracking balance between command restarts. This primarily avoids resetting to 0 on upgrade.
- Fix attempting to buy a ware if there are insufficient funds to buy 1 unit.
- Fix docks not being taken into account when searching for a station to buy a ware at
- Fix a bug in infinite ware buying detection (introduced 1.2.0)
- Fix selling of wares to infinite buyers not awarding reputation
- Fix a bug where homebase traders would not return to homebase in order to load the ware for a sale mission (introduced 1.2.0)

1.2.0
- OK Trade can now be enabled on ships without homebases. They act as free traders and roam the galaxy in search of profit.
- When a ship is already running the command, the trade menu will display the ships's current settings or profit/loss so far in the case of a free trader.

1.1.0
- Change the OK trade command ID from 42 to 48 to resolve a conflict. Note that following upgrade from 1.0.0 existing OK traders will temporarily show "Unknown command!" until their current action completes and the scripts restart.
- Automatically enable autojump and set min jumps to 0 when starting the OK trade command.
- Detect danger and return to homebase. Display subtitle messages when a trader detects danger.
- Reroute to new destination if current trade mission is invalidated, for example if destination ware price becomes unacceptable with respect to homebase selling price
- Buy wares without first returning to homebase if ship has sufficient jump energy to get there and home again, or if the ship isn't jump capable
- Add a minimum stock level percentage trade threshold with default of 10% (sell when above 10% stock, buy when below 90% stock).
- Improve displyed command action details
- Fix amount of ware on order calculation to include amount in cargobay

1.0.0
- Initial release.
- Tested entirely in XTC 2.0.
- Expected to be compatible with vanilla and XRM TC/AP but remains to be tested. Uses no AP-specific script commands.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.


Last edited by Shimrod on Thu, 4. Dec 14, 03:06; edited 27 times in total
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Tue, 14. May 13, 00:48    Post subject: Reply with quote Print

Free Traders

When starting the OK Trade command on a ship without a homebase, it will operate as a free trader and roam the galaxy in search of profit. This is fully automated and requires no micromanagement.

The free trader will determine the most profitable ware to trade in the known universe then go trade it. It's profit balance since starting the trade command can be viewed in the trade menu.

Homebased Traders

When starting the command on a ship with a homebase, it operates as a homebase trader. The player can configure how the trader should handle each of the homebase wares in terms of buy, sell, or no-trade. Appropriate defaults are detected, so that the trading in all wares can readily be activated without adjusting these values.

The trader will then select the highest priority ware to trade, where priority is determined by the relative stock levels adjusted for amount of ware on order or already bought and being shipped in. A station is selected within the homebase max jumps range. If the ship has a jumpdrive and sufficient energy available the station will be selected using the 'best price' method within the station's jumprange. If the ship could jump there but not back again, the 'best chance' method is selected, otherwise it looks for nearest station with sufficient price.

When docked at a station that trades energy cells or at the homebase, the trader will stock up on 2.5x homebase max jumps worth of fuel. Typically the trader will have enough energy left after a sale to jump immediately to another station to buy a ware, without having to refuel, or to jump home to escape danger.

Note: Starting the OK Trade command enables autojump and sets minimum jump range to zero. This is to enable automatic jumping using the stock movement scripts.

Auto Equipping

Equipping settings (jumpdrive, docking computer etc) can be configured globally in the OK Trade menu.

Note that the trader will only go out of its way to buy a jumpdrive and engine tunings. Other items such as scanners and docking computers are purchased lazily, if the trader happens to dock at a station selling that ware.

Optimizations

- If the script detects that the target station can buy an infinite amount of the ware (e.g. docks that buy shields, lasers, missiles), it'll load as much as it can carry when selling to that station. Note: the detection mechanism is only known to work with XTC.
- If incoming hostiles or missiles are detected in scan range the trader will try and reroute its trade, or flee to a homebase or safe station before being attacked. A subtitle warning message is displayed to alert the player.
- If the price at the destination changes and no longer meets the homebase price, the trader will reroute to a new station or return home and re-evaluate.
- After selling a ware the trader can buy a ware without returning home first, if the ship has sufficient jump energy.
- The amount of a ware on order and in cargo bay by other traders is taken into account when comparing stock levels to determine what to trade.
- The trader will not perform an identical trade mission to another OK trader; ware, destination and trade mode (buy/sell) must differ.

Stock Limits

The homebased trader menu contains a Stock Limits section. This allows a minimum and maximum threshold to be set for each of the homebase wares. These settings apply to the homebase rather than per-trader so only need to be set once.

Min Stock % is used to set a floor amount traders won't sell into This is useful for trading intermediate wares. The default of 0% means traders will sell everything.

Max Stock % is used to set a ceiling where traders won't buy stock above that level. This works in the same way as a dockware manager limit except it is percentage based. The default of 100% means traders will buy the ware to full stock level.

The menu also shows any dockware manager limits in a read only fashion. If a dockware limit is set the minimum absolute stock level between the OK setting and dockware setting will apply.

The global settings page also contains a Min Stock Level Trade % setting. This is used to create a buffer which must be exceeded before a homebased trader will trade a ware. The purpose of the setting is to avoid traders performing small trades, such as immediately re-buying the jumpdrive energy they refuelled with. This setting only applies to triggering a trade run; the trader will still use the full range of the stock level, or as limited by Min and Max Stock Level % settings described earlier.

Setup

Install
- The script and t folders from the zip should be copied to the folders of the same name in the Terran Conflict folder. For Albion Prelude, copy into the script and t folders in the addon subfolder.
- The setup script should run after starting or loading a game. The OK Trade command should then appear in ship trade menus.

Upgrade/Downgrade
- Replace the script files and load the game. The setup script will automatically upgrade settings, re-creating them on downgrade.
- Running OK Trade scripts will restart themselves following completion of their current activities

Uninstall
- First run the uninstall command from the OK Trade menu. This will replace running scripts with appropriate default commands (sell ware, buy ware, return home) to avoid disrupting immediate activities.
- Then save the game and remove the setup script. Upon reload the trade command should be gone.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.


Last edited by Shimrod on Fri, 22. Aug 14, 18:39; edited 9 times in total
Back to top
View user's profile Send private message
joelR





Joined: 09 Jul 2007
Posts: 1972 on topic
Location: Seattle
Thank you for registering your game
PostPosted: Tue, 14. May 13, 01:12    Post subject: Reply with quote Print

This is great Shimrod thanks.


_________________
XRM AP Map
XRM Statistics
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 14. May 13, 01:30    Post subject: Reply with quote Print

No problem, cooperating traders seemed the only solution for keeping my energy guzzling weapons complex stocked Smile


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 5705 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Tue, 14. May 13, 03:08    Post subject: Reply with quote Print

Better/easier traders are always welcome, Shimrod!

Do you envision this as a replacement for CAG?


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 14. May 13, 03:38    Post subject: Reply with quote Print

I've barely used CAG so I can't properly review or compare it. From the CAG forum post it does appear to have similar functionality, but with particularly emphasis on experience levels, training courses, special equipment capabilities.

OK traders is designed to be immediately useful, to automate as much as possible and minimize micromanagement.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 5705 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Tue, 14. May 13, 03:42    Post subject: Reply with quote Print

That makes sense. I stopped using CAG for exactly those reasons.

Thanks for contributing this. I expect that your customary high code quality will result in a very useful script.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Mad_CatMk2





Joined: 22 Feb 2009
Posts: 517 on topic
Location: Argon Prime
Thank you for registering your game
PostPosted: Tue, 14. May 13, 04:45    Post subject: Reply with quote Print

DrBullwinkle wrote:
That makes sense. I stopped using CAG for exactly those reasons.

Thanks for contributing this. I expect that your customary high code quality will result in a very useful script.


Agreed with Dr. B above too (nothing against Lucike or his code/work tho!)

Shimrod might you extend this script to mirror Lucike's complement of trading scripts (CAG, EST, and the like) but to give them the same focus as this script? That might be pretty cool to have.


_________________
I fly an OWP. What about you?
Back to top
View user's profile Send private message
joelR





Joined: 09 Jul 2007
Posts: 1972 on topic
Location: Seattle
Thank you for registering your game
PostPosted: Tue, 14. May 13, 04:51    Post subject: Reply with quote Print

Shimrod will OK traders work if homebased to a TL?

For example: I have a TL dedicated to salvage. If it gets full would I be able to have the homebased OK traders sell the wares in the ship?

EDIT: Figured it out. Looks like its only focus is on the station. Still a fantastic alternative to CAGs. Thanks again.


_________________
XRM AP Map
XRM Statistics
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 14. May 13, 11:23    Post subject: Reply with quote Print

Quote:
Shimrod will OK traders work if homebased to a TL?

v1 only trades for station homebases. Does another script already do this , or is there a well known absence of scripts to manage this?

Do you imagine trading from homebased ships that can dock at the TL (can M3 carry ore?), or beaming/droning freight to nearby TS, given the general absence of TS docking slots?

Quote:
Shimrod might you extend this script to mirror Lucike's complement of trading scripts (CAG, EST, and the like) but to give them the same focus as this script? That might be pretty cool to have.

I'll be sure to look at these for ideas, but my immediate focus is with improving trader intelligence, such as escaping hostiles, seeing if it can buy a ware in the local sector after selling one.

An intuitive enhancement would be permit a non-homebased trader to act as either a free trader, or to trade for all player stations. I'm also interested in whether huge ships like TL's could trade via drones without docking.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 5705 on topic
Location: Boston, USA
Thank you for registering your game
modified
PostPosted: Tue, 14. May 13, 11:46    Post subject: Reply with quote Print

Shimrod wrote:
I'm also interested in whether huge ships like TL's could trade via drones without docking.


Transfer Freight via Drones works great after adding engine tunings to the drones and increasing their transporter range (Freight Drone Transfer v08). Automating trade with freight drones would be a welcome addition to the game.
    (In-sector docking takes a long time, so I simulate Docking Computers on the drones by using Gazz's Docking Lockup Fix in my own game. You could customize your code similarly.)


CLS2 (Bonus Pack) will trade from a TL, but setup is complicated because CLS2 is really designed for automating specific cargo runs rather than general-purpose trading. CLS2 will dock if it can, or will use the Transporter Device if available. AFAIK, CLS is the only current trade script that works from TL's.

Falcon Haulers can carry Ore. They are the only M3's with XL cargo space in the vanilla game.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)


Last edited by DrBullwinkle on Sat, 14. Dec 13, 14:15; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Vayde





Joined: 06 Feb 2004
Posts: 830 on topic
Location: England,UK
Thank you for registering your game
PostPosted: Tue, 14. May 13, 20:38    Post subject: Reply with quote Print

So this works in a similar way to a CAG and buys and sells wares for a single station or a complex?

This script set does not require pilots to train levels?

Does it keep stock levels at required amounts?

Oh never mind I'll get off my arse and test it myself...


_________________
DDTC

Please visit us at the DDTC Forums or HERE at our Egosoft thread.
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 886 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 14. May 13, 20:51    Post subject: Reply with quote Print

Quote:
So this works in a similar way to a CAG and buys and sells wares for a single station or a complex?

Yes, it trades only for a station homebase. This might get extended in future but no concrete plans..
Quote:
This script set does not require pilots to train levels?

No levels, just trade command software mk2.
Quote:
Does it keep stock levels at required amounts?

It'll buy until 100% and sell until stock level is 0%. It selects which ware to trade based on stock level percentage, adjusted for amount currently on order by other OK traders from the same station.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
jessterg





Joined: 05 Dec 2009
Posts: 18 on topic

Thank you for registering your game
PostPosted: Tue, 14. May 13, 22:20    Post subject: Reply with quote Print

Super cool! I too had stopped using the CAG and manually took care of the shopping and selling from my staion hubs. Shimrod, Dr B, Vayde, just found this script : http://www.x1tp.com/root/index.php?option=com_jdownloads&Itemid=6&view=viewdownload&catid=62&cid=984

If it does what Al_main and his buddy advertises, I can use my TL to trade with stations after I utilize the debris I've taken from stations wrecks , find a great buy while building stations for someone and . . . Way cool!-- to load up on energy cells or ore and foodstuffs for after the build! Ie, rather than going through the process of using multiple TSs to hurry and purchase the goods to sell the empty stations. I'll see how it goes and report if no one else does it before.
(thanks again for your and JoelR's help for the save: TESCGs script, Salvage Command Software http://forum.egosoft.com/viewtopic.php?t=223882.) In case you've never cleaned up Prez End, Homily of Perpetuity and I think the unknown sector between New Income and Montalar. you can repair several Mining TLs and a lot of Mercury Hauler wrecks. Great fun for me! When my resources get low on the TL for repairing wrecks I can just zip to one of my factory hubs and beam what I need. (Once I remake them from my computer crash. Evil or Very Mad

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3 ... 26, 27, 28  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Tue, 17. Oct 17, 22:33

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 1.18519 seconds, sql queries = 29