[SCR] Commercial Agent [2010-04-28 X3TC 3.3.03]
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 39
- Joined: Tue, 30. Dec 03, 07:59
Hi I got a question about this script. Does it conflict with the script Station Financial Manager script?
Now the problem, when I use the function Start Commercial representation on my traders all they do is stay on Stand by mode in the base doing nothing.
I didnt edit anything all of them are on basic settings, the price to buy for the station is the average price and the station has 500k in cash in it. Of the 2 traders running the script 1 is on global paycheck and the other is on station paycheck but both of them aren't moving.
Now the problem, when I use the function Start Commercial representation on my traders all they do is stay on Stand by mode in the base doing nothing.
I didnt edit anything all of them are on basic settings, the price to buy for the station is the average price and the station has 500k in cash in it. Of the 2 traders running the script 1 is on global paycheck and the other is on station paycheck but both of them aren't moving.
-
- Posts: 17
- Joined: Sat, 10. Mar 07, 07:27
Thanks for this script! It rocks. I love not needing two have 2 ships assigned to one factory, in order to stock and sell.
Anyhow, I have a Wheat Farm with a CAG who buys/sells. However, oftentimes I see the CAG on standby at the wheat farm, meanwhile the cash reserve of the farm will jump down 100,000cr or so, and then a few minutes later, turn a nice profit. It's like someone takes money from the farm and invests it or something. And it's not a result of product being sold, because the number of products does not go down when this happens. Meanwhile... the CAG is docked and on standby. I figured he was responsible for it, but unless he is sitting around at the factory playing the stock market, it can't be him. I also don't have an auto-money transfer to or from the factory account, so it cannot be that. So it's a little confusing. I haven't read any similar reports, so maybe this is entirely unrelated to CAG. I'm not sure. Any ideas?
The only mods I am using are CAG and EST.
Anyhow, I have a Wheat Farm with a CAG who buys/sells. However, oftentimes I see the CAG on standby at the wheat farm, meanwhile the cash reserve of the farm will jump down 100,000cr or so, and then a few minutes later, turn a nice profit. It's like someone takes money from the farm and invests it or something. And it's not a result of product being sold, because the number of products does not go down when this happens. Meanwhile... the CAG is docked and on standby. I figured he was responsible for it, but unless he is sitting around at the factory playing the stock market, it can't be him. I also don't have an auto-money transfer to or from the factory account, so it cannot be that. So it's a little confusing. I haven't read any similar reports, so maybe this is entirely unrelated to CAG. I'm not sure. Any ideas?
The only mods I am using are CAG and EST.
-
- Posts: 12969
- Joined: Sun, 9. May 04, 21:26
You can, but need not. If the libs are to old, then you get a message in game.Razman23 wrote:Do I have to update my copy as well?
Can I see the log?IronDuke wrote:Hi I got a question about this script. Does it conflict with the script Station Financial Manager script?
Now the problem, when I use the function Start Commercial representation on my traders all they do is stay on Stand by mode in the base doing nothing.
I didnt edit anything all of them are on basic settings, the price to buy for the station is the average price and the station has 500k in cash in it. Of the 2 traders running the script 1 is on global paycheck and the other is on station paycheck but both of them aren't moving.
Main Menu -> Configure Reports -> Analysis to Log
This will create a log file called "log1000.txt" in the directory, where your savegames are. Please copy it and post it here.
Have any other freighters this station as homebase? For example UT/EST or so?JoshRose wrote:Any ideas?
You can send your savegame to me. I'll look in your game.
xscripts@lucike.info

-
- Posts: 39
- Joined: Tue, 30. Dec 03, 07:59
Ah I "solved" it already for some reason if station financial manager (SFM) is running first when I start the CAG they don't move so I just start it before running SFM.
Thanks though your script really helps me alot in running my trade empire
One question, where do I find how much the trader has to bug/sell to upgrade to the next level?
Thanks though your script really helps me alot in running my trade empire

One question, where do I find how much the trader has to bug/sell to upgrade to the next level?
-
- Posts: 1409
- Joined: Wed, 16. Nov 05, 13:33
Might I just ask something for clarification?
I'm guessing my assumption is correct but, if I set the price for say a wheat farm Wheat (product chosen at random) to one credit below average sale price and don't allow other races to trade. Then set a distillery to buy wheat at avg-1 max and with my station the following will happen:
The CAG on my Wheat farm will look for sales at the highest price first and only sell at Avg.-1 if he absolutely has to.
CAG belonging to the distillery will still trade with my wheat farm and look for wheat at lowest price first and only buy at avg-1 if he has to?
I'm guessing my assumption is correct but, if I set the price for say a wheat farm Wheat (product chosen at random) to one credit below average sale price and don't allow other races to trade. Then set a distillery to buy wheat at avg-1 max and with my station the following will happen:
The CAG on my Wheat farm will look for sales at the highest price first and only sell at Avg.-1 if he absolutely has to.
CAG belonging to the distillery will still trade with my wheat farm and look for wheat at lowest price first and only buy at avg-1 if he has to?
-
- Posts: 142
- Joined: Tue, 4. Mar 08, 02:39
-
- Posts: 130
- Joined: Sat, 3. Jan 09, 15:03
Re: [SCR] Commercial Agent [08-12-26 X3TC 3.2.01]
I hate to assume so I'll have to ask.....Lucike wrote: Required: X³ Terran Conflict Version 1.3 (not compatible with X³ Reunion) !!
Did you mean to say.....
Required: X³ Terran Conflict Version 1.3 or greater (not compatible with X³ Reunion) !!
-
- Posts: 1409
- Joined: Wed, 16. Nov 05, 13:33
-
- Posts: 1399
- Joined: Wed, 6. Nov 02, 20:31
If the resource is below the % threshold for stock levels and it sees a cheaper product in range it will therefore buy it as they are both intermediates.Luke Skyscraper wrote:Interesting Feature:
I have a mature CAG (Major Dealer) transferred to a lone SPPL in Antigone Memorial.
The Selling Price for E-Cells is set to 15 (avg-1)
The Buying Price for Crystals is set to 1683 (avg-1)
The CAG is BUYING Both E-Cells and Crystals.
What's with that?
Best adjusting thresholds.
You could also alter prices so that it will have more of a level before it will attempt to buy them or exclude them as blacklist wares so that he doesnt trade in them.
However if you are relying on your CAG Dealer to sell these and the product is in high demand at your factory you will still end up with these problems. The good thing to know however is it he will be likley buying low to then sell at a better or equal price so best scenario is he's still making money or at worst raising stock levels then to be sold.
Question is if he has to buy these chances are you dont need a CAG to sell them as they sound in demand so blacklisting those that do sell well and only ask of him to sell those that dont might improve overall efficiency. However if he is purely only there to help sell stocks on a closed e-cell loop setting him up so he only sells might do what you want.
Hope that helps, it can be hard to get your head around all the variables.
I can see what you are trying to do though, get a higher return by setting the price higher and getting the CAG to sell the stock. Hard one to balance with all the neighbouring NPC Solar plants I imagine. I think if you set the buy threshold stock level to a point where he wont buy it will probably still allow your attempts to maximise profits.
Personally so far I let the factorys run and set their levels to run best. Then have a CAG sell the intermediates for maximum return by setting their price sells above average to capatalise on those sales opportunities when needed. To be honest I'm not sure which will work out better as you probably will get a few credits more for all the extra crystals you sell, just hope it doesnt go below stall levels. I would hope the default thresholds would stop this however? I might be underusing my CAGs if so but I see them as a helping hand when it comes to selling intermediates rather than an earner as they are there to sell products primarily. I might have to invest some time into doing this and see whats possible. Problems is its so much dependant on supply and demand that it will be an invovled process I imagine.
Something else you could do is tag on a small wheat farm or cattle ranch. Yes it removes some e-cells from the selling pot but your CAG may then spend more time selling the product that he might not get around to buying e-cells or will do so less frequently, of course he will then likely sell less e-cells but a single M tagged on might help stock management. Its hard to say if this will help as I dont know what else you have set-up locally or wether you are using this fab as supply for other complexes etc.
-
- Posts: 1471
- Joined: Wed, 3. Aug 05, 08:15
If it's a lone SPPL, why would it have intermediates? I would have thought that it would just have the products (E-Cells) which it should only purchase, and resources (Crystals) which it should only buy? Haven't built a factory in TC yet so it might have changed, but I wouldn't think so.pelador wrote:If the resource is below the % threshold for stock levels and it sees a cheaper product in range it will therefore buy it as they are both intermediates.Luke Skyscraper wrote:Interesting Feature:
I have a mature CAG (Major Dealer) transferred to a lone SPPL in Antigone Memorial.
The Selling Price for E-Cells is set to 15 (avg-1)
The Buying Price for Crystals is set to 1683 (avg-1)
The CAG is BUYING Both E-Cells and Crystals.
What's with that?
Best adjusting thresholds.
You could also alter prices so that it will have more of a level before it will attempt to buy them or exclude them as blacklist wares so that he doesnt trade in them.
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD
-
- Posts: 1399
- Joined: Wed, 6. Nov 02, 20:31
Oooh, yes my mistake, apolodies I literally thought it was a closed loop configuration when I saw it and hence trading in intermediates. Err, well then Yes, it makes no real sense why it should buy products and sell resources even if its making a profit.strude wrote:If it's a lone SPPL, why would it have intermediates? I would have thought that it would just have the products (E-Cells) which it should only purchase, and resources (Crystals) which it should only buy? Haven't built a factory in TC yet so it might have changed, but I wouldn't think so.pelador wrote:If the resource is below the % threshold for stock levels and it sees a cheaper product in range it will therefore buy it as they are both intermediates.Luke Skyscraper wrote:Interesting Feature:
I have a mature CAG (Major Dealer) transferred to a lone SPPL in Antigone Memorial.
The Selling Price for E-Cells is set to 15 (avg-1)
The Buying Price for Crystals is set to 1683 (avg-1)
The CAG is BUYING Both E-Cells and Crystals.
What's with that?
Best adjusting thresholds.
You could also alter prices so that it will have more of a level before it will attempt to buy them or exclude them as blacklist wares so that he doesnt trade in them.
-
- Posts: 13647
- Joined: Thu, 15. Jul 04, 04:41
- assuming that you set a Homebase for the CAG - just call up that station and look in "Owned Ships"b1rd wrote:Is it possible for a CAG to disappear? lol I had 3 running in my game, trying them out for the first time. now one of them is nowhere to be found. No ship destroyed message, no attack message from him, nothing :\
- the CAG should be listed, you can find it's whereabout via the "Info" option..
- if you don't rename the CAG, it's possible to lose track of an "unBased" trader among your other ships
- as well as making it easier to spot in your property-list,
- the renaming option will tell you a bit about the ship's basic functions, as well..
- the whole universe is running in BETA mode - we're working on it.. beep..!!



-
- Posts: 7
- Joined: Sun, 19. Nov 06, 16:18
-
- Posts: 13647
- Joined: Thu, 15. Jul 04, 04:41
after opening the zip..
- just move all folders over into the Egosoft/X3TC folder..
- each time you do this, any updates will automatically find their correct destinations..
- just opt to overwrite the previous version if prompted..
- just move all folders over into the Egosoft/X3TC folder..
- each time you do this, any updates will automatically find their correct destinations..
- just opt to overwrite the previous version if prompted..
- the whole universe is running in BETA mode - we're working on it.. beep..!!



-
- Posts: 63
- Joined: Mon, 29. Mar 04, 23:00
-
- Posts: 130
- Joined: Sat, 3. Jan 09, 15:03
I've been running CAG on several factories for a few days.
I have one factory where the 2 traders assigned are behaving strangely.
It's a T-Foundry and it's currently at 232/3330 Teladiaum and 3500/25000 E-Cells.
Neither CAG is doing anything. One is a Dealer and the other is a courier.
Just now one of them decided to go two sectors away to get 40 E-Cells. He has 100 in his freight already and the station obviously could use some, so why the 40 thing?
The other one has now filled his cargo hold with Teladium but sits idle at the foundry even though there are places in that very same sector buying all he can carry. If I go in and RemoteSell him, he goes right away. If I set him on CAG duty, he just idles.
UPDATE: One of these CAGs got with the program and is now trading normally. The other one never got started, I reassigned him to another factory and he's doing fine. I guess he just didn't want to work there.
I have one factory where the 2 traders assigned are behaving strangely.
It's a T-Foundry and it's currently at 232/3330 Teladiaum and 3500/25000 E-Cells.
Neither CAG is doing anything. One is a Dealer and the other is a courier.
Just now one of them decided to go two sectors away to get 40 E-Cells. He has 100 in his freight already and the station obviously could use some, so why the 40 thing?
The other one has now filled his cargo hold with Teladium but sits idle at the foundry even though there are places in that very same sector buying all he can carry. If I go in and RemoteSell him, he goes right away. If I set him on CAG duty, he just idles.
UPDATE: One of these CAGs got with the program and is now trading normally. The other one never got started, I reassigned him to another factory and he's doing fine. I guess he just didn't want to work there.
-
- Posts: 27
- Joined: Sat, 10. Jul 04, 17:41
I don't know if anyone else has seen this, but I was running into a problem with several ships where as soon as I assigned a home base and pulled up the CAG main menu, it would *delete* the home base, so that when I clicked "Start", it would do nothing. The ship was a TS docked at a station with Nav Mk1 and Trading Mk1 and 2. What seemed to solve it for me was to escape out of the ship dialog entirely after setting the home base, and *then* go back in and start the CAG.
For great justice.
-
- Posts: 37
- Joined: Sat, 10. Jan 09, 16:42
Help with CAG/EST/CLS
Im really struggling trying to manage the supply chain between stations at the moment.
To give you the quick run-down, ive just set up my first spegetti complex and ive got a wheat farm, argau beef farm, solar plant and rimes fact all linked to a hub. In the same sector i have 4 silicone mines, and am about to set up a couple crystal fabs onto the hub. Ive got 3 TM's with all the extensions etc which should apply (trade1&2, best buys/sells, nav, trading ext etc etc)
Im really not having much joy using the CAG/EST/CLS scripts to automate the process of obtaining resources, selling products and (especially) trying to automagically supply the mines with energy cells.
Can someone point me in the direction of a step by step simpletons guide to using the est/cag scripts pls, or even better just step by step tell me how to...
a) Set one transport to supply the four mines with energy
b) Set one transport to sell products
c) Set one transport to get resources (crystals till i get the fabs set up)
Just a general poke in teh right direction would be great - to be honest i cant figure out from the descriptions which of the three scripts i should even use for each of the above so knowing that would probably be a start!
Thanks in advance and please, dont mock the afflicted...
To give you the quick run-down, ive just set up my first spegetti complex and ive got a wheat farm, argau beef farm, solar plant and rimes fact all linked to a hub. In the same sector i have 4 silicone mines, and am about to set up a couple crystal fabs onto the hub. Ive got 3 TM's with all the extensions etc which should apply (trade1&2, best buys/sells, nav, trading ext etc etc)
Im really not having much joy using the CAG/EST/CLS scripts to automate the process of obtaining resources, selling products and (especially) trying to automagically supply the mines with energy cells.
Can someone point me in the direction of a step by step simpletons guide to using the est/cag scripts pls, or even better just step by step tell me how to...
a) Set one transport to supply the four mines with energy
b) Set one transport to sell products
c) Set one transport to get resources (crystals till i get the fabs set up)
Just a general poke in teh right direction would be great - to be honest i cant figure out from the descriptions which of the three scripts i should even use for each of the above so knowing that would probably be a start!
Thanks in advance and please, dont mock the afflicted...

-
- Posts: 157
- Joined: Sat, 29. Nov 03, 23:20
First off:
EST: variable AI station <-> variable AI station
CAG: fixed Player station <-> variable AI station
CLS: fixed station <-> fixed station
There's various better summaries floating about but that is the basics.
You won't need to use EST because it is meant to trade with any station 'it' wants (preferably not your stations).
You can use CAG to buy resources 'and' sell products (So B & C).
You can use CLS to transfer energy from your complex to your mines and silicon back (So A).
I'm sure more experienced people will give you better configurations but the following should work:
[CAG]
# Navigation Command Software MK1
# Trade Command Software MK1
# Trade Command Software MK2
-Take 2 of your 3 transport ships and set their home-base to your complex.
-Dock these two transport ships to any station (preferably your complex).
-Start the 'Start Commercial Representation' command (a menu will pop-up)
<optional 1>
+Select ware-list
+Select 'ware-list type' (It will turn from black-list to ware-list)
+Select Ware-list (0 entries)
+Select add-ware
+Select a product or resource you want the Cag to buy/sell
+Select add-ware (repeat untill you have all wares you want)
+Press 'Exit' (it will return to the previous ware-list menu)
+Press 'Exit'
<end optional>
-Select start comercial agent
The above 2 ships will now start buying crystals (credits permitting) and anything else your complex 'needs'. If you specified specific wares it will only try to buy/sell those.
Keep in mind that CAG will only 'buy' ware until it reaches a certain pilot level, so you will have to make sure that it is able to buy at least some of the wares you selected or are required by your complex.
When you add crystal fabs the ships will start buying ore too, again you can specify that in the ware list.
[CLS (external)]
# Navigation Command Software MK1
# Commodity Logistics Software MK2
-Take the remaining transport ship and dock him at any station.
-Start the command 'Start external commodity logistics'
-Select way points.
<Before crystal fabs>
+Select add waypoint
+Select 'load'
+Select your complex
+Select energy cells
+Select maximum cargo space
+Select add waypoint
+Select 'unload'
+Select one of your silicon mines
+Select energy cells
+Select maximum cargo space
+repeat all of the +'s until you have all of your silicon mines
<After crystal fabs>
+Select add waypoint
+Select 'unload'
+Select your complex
+Select silicon wafers
+Select max cargo space
+Select 'load'
+Select your complex
+Select energy cells
+Select maximum cargo space
+Select add waypoint
+Select 'unload'
+Select one of your silicon mines
+Select energy cells
+Select maximum cargo space
+Select 'load'
+Select the same silicon mine
+Select silicon wafers
+Select max cargo space.
+repeat all of the +'s until you have all of your silicon mines
<END>
-Press exit to go back to the main CLS menu
-Select 'Start external commodity logistics'
Now again experts will give you a better setup but this will basically do the following:
You ship will fly to each of your mines in turn and try to deliver energy cells (ignoring energy cell availability or supply). If you added the crystal fabs it will try to pick up wafers from the mine it visits and drop it off at the complex. Things can go wrong if the cargo space of your complex or mines are filled with resources. In that case you can use 'half cargo space' instead of 'max cargo space' to keep things from stalling.
Again it's a basic setup, but if you play with CLS, CAG and EST some more (and their options) you'l eventually learn to use them better. I suggest you try playing with the 'Automatic naming' and 'Data storage' options first as they make things easier but don't interfere with the main functions.
If you want to know more I suggest reading the main posts of these addons.
EST: variable AI station <-> variable AI station
CAG: fixed Player station <-> variable AI station
CLS: fixed station <-> fixed station
There's various better summaries floating about but that is the basics.
You won't need to use EST because it is meant to trade with any station 'it' wants (preferably not your stations).
You can use CAG to buy resources 'and' sell products (So B & C).
You can use CLS to transfer energy from your complex to your mines and silicon back (So A).
I'm sure more experienced people will give you better configurations but the following should work:
[CAG]
# Navigation Command Software MK1
# Trade Command Software MK1
# Trade Command Software MK2
-Take 2 of your 3 transport ships and set their home-base to your complex.
-Dock these two transport ships to any station (preferably your complex).
-Start the 'Start Commercial Representation' command (a menu will pop-up)
<optional 1>
+Select ware-list
+Select 'ware-list type' (It will turn from black-list to ware-list)
+Select Ware-list (0 entries)
+Select add-ware
+Select a product or resource you want the Cag to buy/sell
+Select add-ware (repeat untill you have all wares you want)
+Press 'Exit' (it will return to the previous ware-list menu)
+Press 'Exit'
<end optional>
-Select start comercial agent
The above 2 ships will now start buying crystals (credits permitting) and anything else your complex 'needs'. If you specified specific wares it will only try to buy/sell those.
Keep in mind that CAG will only 'buy' ware until it reaches a certain pilot level, so you will have to make sure that it is able to buy at least some of the wares you selected or are required by your complex.
When you add crystal fabs the ships will start buying ore too, again you can specify that in the ware list.
[CLS (external)]
# Navigation Command Software MK1
# Commodity Logistics Software MK2
-Take the remaining transport ship and dock him at any station.
-Start the command 'Start external commodity logistics'
-Select way points.
<Before crystal fabs>
+Select add waypoint
+Select 'load'
+Select your complex
+Select energy cells
+Select maximum cargo space
+Select add waypoint
+Select 'unload'
+Select one of your silicon mines
+Select energy cells
+Select maximum cargo space
+repeat all of the +'s until you have all of your silicon mines
<After crystal fabs>
+Select add waypoint
+Select 'unload'
+Select your complex
+Select silicon wafers
+Select max cargo space
+Select 'load'
+Select your complex
+Select energy cells
+Select maximum cargo space
+Select add waypoint
+Select 'unload'
+Select one of your silicon mines
+Select energy cells
+Select maximum cargo space
+Select 'load'
+Select the same silicon mine
+Select silicon wafers
+Select max cargo space.
+repeat all of the +'s until you have all of your silicon mines
<END>
-Press exit to go back to the main CLS menu
-Select 'Start external commodity logistics'
Now again experts will give you a better setup but this will basically do the following:
You ship will fly to each of your mines in turn and try to deliver energy cells (ignoring energy cell availability or supply). If you added the crystal fabs it will try to pick up wafers from the mine it visits and drop it off at the complex. Things can go wrong if the cargo space of your complex or mines are filled with resources. In that case you can use 'half cargo space' instead of 'max cargo space' to keep things from stalling.
Again it's a basic setup, but if you play with CLS, CAG and EST some more (and their options) you'l eventually learn to use them better. I suggest you try playing with the 'Automatic naming' and 'Data storage' options first as they make things easier but don't interfere with the main functions.
If you want to know more I suggest reading the main posts of these addons.
Last edited by mostlikely on Thu, 5. Feb 09, 13:15, edited 1 time in total.
-
- Posts: 37
- Joined: Sat, 10. Jan 09, 16:42