[SCR] [X3AP] Drone Mining and Trading System v1.2.2 [UPDATED 11/08/2014]

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

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

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Spoiler
Show
A dirty little secret I suppose that once you issue the command to start mining you could transfer the Mk3 software to another ship (or eject it from the cargo hold) and it would still run just fine. I knew that could happen, but I didn't expect anyone to actually do that. The downside would be that you couldn't issue or adjust orders and you'd have to rebuy it when the command stopped for out of minerals or whatever reason. The check for the MK3 software is built into the initial command and never checked again by the script.

But since you reported it I might just add a check to 1.2. I wouldn't be surprised if dozens of scripts worked like that, checking only initially and never again as long as the command runs. If you eject/transfer other things then the script will just rebuy them upon beginning the next cycle.
Regarding the .xprj it is the X-Studio project for the script. Handy if you want to open it in X-Studio but usually I delete it from the zip file after packing it. I imagine with X-Studio's new built in archive function you'll start seeing .xprj a lot more. I'm going to delete it from the 1.1 zip file and reupload, but it will still be available from the GitHub page.
d_ka
Posts: 254
Joined: Wed, 15. Feb 12, 18:00
x3ap

Post by d_ka »

Oh, sorry for that, mate. But, tbh. if someone wants to cheat that way, there is a tool from Cycrow available, imo.

So, this "xpj." thingy can be deleted, and i can paste scripts + t folder only, or is it somehow bound to the zipped doc.?

Additional feedback:

1. There was even more software missing, when i´d started your script. I saw the drones in the cargohold but not on the sector map, and was wondering if it was OK... apperantly not, because once i´ve installed ALL the equipment, the drones moved out and started working.
-> the software wasn´t installed on the ships even before i issued the order, so the ship was working "solo", so to say, collecting minerals ( and when i jumped to my sector i could see the smashed little asteroids in place where couple of larger ones were present earlier ).

2. When i issued the command with all the software needed, there was equipment missing this time ( optional ), and the ship jumped around in search for freight drones. It was cool watching it using the already available fr. drones to trade with stations the TL couldn´t dock at. But since i have negative rep with Borons ( -2. access to border sectors ), it failed to purchase the drones, and tried it again, and again ( don´t know how long it would repeat that ). So, one should pre load the wares in case one has not all the races as friends.

3. When i thought it has it´s drones etc. it now started buying missiles ( first it wanted to by 100 Zetas, but since i have them at my HQ i stopped the TL and loaded them; then it went for Spectres, iirc, which i don´t have, and i let it do the job, but it jumped to Aldrin... errr, well, it took a while, but it came back, and btw. scouted that huge sector for me :P ).
-> maybe it´s just me, but it´s somehow unproductive when the TL carrier jumps around for couple of missiles, breaking his work off ( and this not because of drone shortage, but because it nees 3 defence missiles ).

4. Now comes the funny part: My Ice Miner is stationed in my HQ sector ( unknown 17-11 in XRM ), and i don´t really need minerals, but wanted to clear it of some debree rests. But there are also other ships stationed, like my Patrol Shrike, and it seems after a while ( or after another random Pirate spawning, i can´t say because i´m constantly flying around, and fighting ), the FD II seem to have found a "better" host, and are landing on the said Shrike ( 2x times in a raw now ). and my Ice Miner sended me a message ( 2 times ), that it´s out of drones, and will dock at his home station, which is my HQ :lol:
"Only fools seek power, and only the greatest fools seek it through force".
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

d_ka wrote:So, this "xpj." thingy can be deleted, and i can paste scripts + t folder only, or is it somehow bound to the zipped doc.?
Yes, you can safely delete the DroneMiner.xprj file in the event that I accidently include it in the release it won't do any harm to your game.
d_ka wrote:1. There was even more software missing, when i´d started your script. I saw the drones in the cargohold but not on the sector map, and was wondering if it was OK... apperantly not, because once i´ve installed ALL the equipment, the drones moved out and started working.

-> the software wasn´t installed on the ships even before i issued the order, so the ship was working "solo", so to say, collecting minerals ( and when i jumped to my sector i could see the smashed little asteroids in place where couple of larger ones were present earlier ).
You issued the standard 'Collect Rocks' command or the standard 'Mine and Trade' command. Those commands will be available to you as part of the base game. Nothing to do with my script. My script does not contain commands to make the TL collect rocks itself. My script makes the TL sit still and watch for hostiles, controlling drones from afar.
d_ka wrote:2. When i issued the command with all the software needed, there was equipment missing this time ( optional ), and the ship jumped around in search for freight drones. It was cool watching it using the already available fr. drones to trade with stations the TL couldn´t dock at. But since i have negative rep with Borons ( -2. access to border sectors ), it failed to purchase the drones, and tried it again, and again ( don´t know how long it would repeat that ). So, one should pre load the wares in case one has not all the races as friends.
That is odd. Thank you for reporting it, I need to add some additional checks. I thought I had added enough tests to ensure that it would exclude stations that the drones couldn't dock at, but clearly not.
d_ka wrote:3. When i thought it has it´s drones etc. it now started buying missiles ( first it wanted to by 100 Zetas, but since i have them at my HQ i stopped the TL and loaded them; then it went for Spectres, iirc, which i don´t have, and i let it do the job, but it jumped to Aldrin... errr, well, it took a while, but it came back, and btw. scouted that huge sector for me :P ).
:lol: Well, I personally avoid ever entering Aldrin so in my game it is unknown and non of my stuff ever goes there. Version 1.1 adds the foundation for a future blacklist, so I will try and see what I can come up with to help avoid those annoying sectors.
d_ka wrote:-> maybe it´s just me, but it´s somehow unproductive when the TL carrier jumps around for couple of missiles, breaking his work off ( and this not because of drone shortage, but because it nees 3 defence missiles ).
The Drone Miner breaks off mining when the sector is empty or whenever its cargo hold is reduced to under 800 space left (plus some room for a full load of energy). After it finishes mining it performs its unload/trade operation. Then before returning to mining it replenishes its consumables. That is just the way it is going to be. You can turn off Use Missiles under advanced settings. A blacklist may help it avoid massive sectors.
d_ka wrote:4. Now comes the funny part: My Ice Miner is stationed in my HQ sector ( unknown 17-11 in XRM ), and i don´t really need minerals, but wanted to clear it of some debree rests. But there are also other ships stationed, like my Patrol Shrike, and it seems after a while ( or after another random Pirate spawning, i can´t say because i´m constantly flying around, and fighting ), the FD II seem to have found a "better" host, and are landing on the said Shrike ( 2x times in a raw now ). and my Ice Miner sended me a message ( 2 times ), that it´s out of drones, and will dock at his home station, which is my HQ :lol:
Interesting, sounds like another script is collecting them. I'll check the code, but when the drones are created they are given a [HOMEBASE]. The homebase can only be changed by a script and the drones can only return to [HOMEBASE]. I have a Tern I'll set patrolling my home sector, but I am skeptical that this is something in the script itself.

Edit: Another possibility is that they are being destroyed, hostiles attacking the, friendly fire, being shot by missiles (AI enemies may be targeting them with missiles), in sector collisions. Drones can also run out of energy, though 1.1 does a better job of monitoring for this. Also, is it Fighter Drone MK2 that are disappearing or the Freight Drones, please let me know, so that I know where to check.

Edit 2: Ohhh... I think I see what could happen, FD Mk2 could work themselves to death. Did you bust a roid? I've not seen this happen under normal conditions, but the problem is clear.. FD Mk2 could exceed their 10 minute lifetime. Its a small change, I'll hotfix it.
Last edited by zanzal on Mon, 13. Jan 14, 00:35, edited 3 times in total.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Unofficial Features for Power Users

Post by zanzal »

A couple posts have mentioned using this script to clear rocks from their home sector. One thing that might surprise some is that the script won't necessarily do that, because it is possible that some rocks have a mineral yield of 0 and the script will intentionally ignore them.

For those that are interested, many of my scripts contain unofficial configuration variables located towards the top of the script file. For example, if you needed it to clear a sector of all debris (even yield 0 rocks) you could edit line 41 of plugin.zanzal.droneminer.mine.xml and change $config.minimum.yield to 0 and restart the command.

Please note however, that if you choose to change any of these hidden settings then your Drone Miners may not function as I intended. But it is handy to know that they are in there in case there is something that you need the script to do that isn't part of the official package.
d_ka
Posts: 254
Joined: Wed, 15. Feb 12, 18:00
x3ap

Post by d_ka »


That is odd. Thank you for reporting it, I need to add some additional checks. I thought I had added enough tests to ensure that it would exclude stations that the drones couldn't dock at, but clearly not.
I can dock at stations in border Boron sectors, actually, it´s just that i can´t trade. So the Freight Drones were docking, but were unable to buy anything.
You issued the standard 'Collect Rocks' command or the standard 'Mine and Trade' command. Those commands will be available to you as part of the base game. Nothing to do with my script. My script does not contain commands to make the TL collect rocks itself. My script makes the TL sit still and watch for hostiles, controlling drones from afar.
IIRC, i told the Mining Ship to collect the minerals, and then wait for further orders ( could also be to unload them at Homebase; trade&sale ain´t a choice for me actually in my HQ sector ).
The Drone Miner breaks off mining when the sector is empty or whenever its cargo hold is reduced to under 800 space left (plus some room for a full load of energy). After it finishes mining it performs its unload/trade operation. Then before returning to mining it replenishes its consumables. That is just the way it is going to be. You can turn off Use Missiles under advanced settings. A blacklist may help it avoid massive sectors.
I see, but would it be possible to create kind of supplier for the Mining Ship, similar to Lucikes Tender, which would ressuply it ( i could supply the ship by external Tenders, but if their timing isn´t perfect, the ship would still jump away ).
At least it would be good for the ship to send a message it needs equipment, and after a period of time it would give up waiting, and go search for the wares itself.
Interesting, sounds like another script is collecting them. I'll check the code, but when the drones are created they are given a [HOMEBASE]. The homebase can only be changed by a script and the drones can only return to [HOMEBASE]. I have a Tern I'll set patrolling my home sector, but I am skeptical that this is something in the script itself.

Edit: Another possibility is that they are being destroyed, hostiles attacking the, friendly fire, being shot by missiles (AI enemies may be targeting them with missiles), in sector collisions. Drones can also run out of energy, though 1.1 does a better job of monitoring for this. Also, is it Fighter Drone MK2 that are disappearing or the Freight Drones, please let me know, so that I know where to check.

Edit 2: Ohhh... I think I see what could happen, FD Mk2 could work themselves to death. Did you bust a roid? I've not seen this happen under normal conditions, but the problem is clear.. FD Mk2 could exceed their 10 minute lifetime. Its a small change, I'll hotfix it.
They were Fighter Drones MK II, 20 of them, all 20 landed at my Shrike, 2 times in a raw. Since there were hostilities i can imagine some routine has been activated, but which? Drones ain´t civil ships, like my CAG´s, but maybe they are treated as such since they are not for the self defence purpose?
Actually that Shrike of mine was running CODEA + SRS from Lucike, but it was stationary, though it´s action radius is quite big ( at least 50km ).
But CODEA doesn´t collect even it´s own drones used by fighters, or fleet ships, so i don´t know.
On a different note: would it be possible to add Keris drones along with the MK II ones, - i´m playing Terran char, and do not produce Commonwealth stuff, actually ( would be neat ).
And no, i didn´t use the "Bust the Roid" command, firstly because i need them for my local plex, and also because you said it wasn´t yet safe to be used.

About the sector clearing of rocks - it´s nice to know you can still do it by editing the files, just a question: once i´ve edited, and am done with a particular sector, can i safely reverse the changes, so that my Mining Ship would start working "normal"?

Thanks for taking your time :)
"Only fools seek power, and only the greatest fools seek it through force".
Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 »

Man, this script is sweet,
remind me of a little antfarm, alot of ants running around digging
just like discovery channel, you just sit and stare at em for hours hehe,

- I noticed once or twice, while IS that when I would relocate the Mineship, to a new sector(sector I was in), and there was debris right at the jumpgate, that it would stop right infront of the gate, and unload the drones, at stand infront of the gate, until I would jump OOS, (it seem to move right after I jumped)
I guess it dosnt really matter that much, unless something tends to use the gate while im IS,
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Sounds a little dangerous being parked in front of a gate. Unfortunately it may be difficult to try and convince it to park elsewhere since it chooses the closest stopping point. I'll add it to the list of things that should be improved. Maybe what I can do is check when it stops and see if its within 4km gate and if it is, then try and convince it to choose a spot a little further away. Could be tricky, though.

I should be able to fix if I can recreate it. What sector did this happen in?

EDIT: :lol: I Just realized that if minerals are within 10km of the gate, the ship could very well just stop immediately after jumping in, leaving it parked right in the gate. Yeah that ones gotta be fixed.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

d_ka wrote:They were Fighter Drones MK II, 20 of them, all 20 landed at my Shrike, 2 times in a raw. Since there were hostilities i can imagine some routine has been activated, but which? Drones ain´t civil ships, like my CAG´s, but maybe they are treated as such since they are not for the self defence purpose?
I've not used CODEA, but I can confirm that whatever is happening is some sort of interference by another script. I don't know if it is CODEA or not. But your Shrike is stealing the drones away, not the drone miner telling them to go land on it. You might be able to test this by deploying drones from another ship during combat and see if after combat the Shrike steals those drones.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

I dug around in the CODEA code and spotted it quickly thanks to Lucike's very explicit naming conventions. I've provided a patched version of Lucike's CODEA script file plugin.codea.ship.order.collect.drones.pck that will exclude drones launched from the Drone Miner.

You can get it here:

CODEA Drone Miner Compatibility Patch
Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 »

zanzal wrote:Sounds a little dangerous being parked in front of a gate. Unfortunately it may be difficult to try and convince it to park elsewhere since it chooses the closest stopping point. I'll add it to the list of things that should be improved. Maybe what I can do is check when it stops and see if its within 4km gate and if it is, then try and convince it to choose a spot a little further away. Could be tricky, though.

I should be able to fix if I can recreate it. What sector did this happen in?

EDIT: :lol: I Just realized that if minerals are within 10km of the gate, the ship could very well just stop immediately after jumping in, leaving it parked right in the gate. Yeah that ones gotta be fixed.
Zyarth's Stand, west gate with xrm, but again, just happens IS, jumping out and wait abit and then in again, and it has moved away, :) I havent tried to recreate it, and really not that big a bug imo, people should know by now that TL's jumping to gates IS is dangerous, can't count the times a Alabtros has squased me while not paying attention

- Is there a difrence to the TL's Hangars? how fast the drones can dock? I've been using Elephants, and it look pretty sweet that they make a swarm behind the TL waiting for they turn to dock there's abit of a waiting time (still faster than any other miners I've tried) sometimes cause there is only 1 hangar they can dock at (Why dont they hit each other? if you would have 100 M5's flying around, im pretty sure they would hit each other all the time)
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Figge04 wrote:- Is there a difrence to the TL's Hangars? how fast the drones can dock? I've been using Elephants, and it look pretty sweet that they make a swarm behind the TL waiting for they turn to dock there's abit of a waiting time (still faster than any other miners I've tried) sometimes cause there is only 1 hangar they can dock at (Why dont they hit each other? if you would have 100 M5's flying around, im pretty sure they would hit each other all the time)
I haven't really tested the impact of hangers and how it affects the drones ability to dock. Assume more is better, but there are limits to how much it helps. As long as you have 5-6 free docks they should all dock eventually. I did observe what appeared to be two lanes of drones whenever I was testing with my TLs. Perhaps the docking procedure is impacted by lanes available for docking (I've not really looked at how that works at all). When I have the time I'll do a performance test and see how different TLs perform as drone miners. My initial criteria for best TL was the one most capable of dropping an M2 by itself, but I am sure there are other considerations. :)

As to why drones don't crash into each other as 100 try to dock at once, it is not anything I've done special to them. It is just the way freight drones work. I assume X3 disables collision on them by default since it is easier than making them dock in an orderly fashion.
wanderer
Posts: 279
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by wanderer »

@zanzal

A question regarding your footnote 'Current Universe: X3AP, XRM, Lost Colony Expansion, Pirate Guild 3, Phanon Corp for XRM, Improved Races 2.0'.
So - you installed them alltogether?
If yes in witch cat/dat order, and also, did you create an own bod file?

Some hints to do it also would be nice. In the moment i have IEX, XRM, IEXi, TCPlots in AP running. But I want to open to a bigger universe...
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Greetings wanderer,

Because the question doesn't really relate to thread you've posted in, I'd ask if you could message me these types of questions instead in the future. I'll PM you the info you are asking about.
gastovski
Posts: 152
Joined: Tue, 3. Dec 13, 11:20

Post by gastovski »

I had full my Mammoth three times with nvidium and made alot money with this. But i can't mine anymore nvidium or any mineral. It's just suddenly stopped working. I select collect and wait options and one second later it's finished. Tried this stuff in many sectors but results are same.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Greetings gastovski,

Questions:

Q1: Did you recently install or upgrade any script that could have triggered the change in behavior (including an upgrade to Drone Miner)?

Q2: Did you alter any of the miners parameters under advanced?

Q3: When the miner script has to abort, it sends you a message. What does the message say at the bottom?

The message it sends looks like:

Code: Select all

Drone Mining / Trading operation completed.

Completion Code: <reason why I stopped>
You might double check the drone miner settings to make sure they all look right. My gut feeling would be that it is related to settings. Keep in mind not having a homebase set might cause a malfunction and that could have happened if you entered the ship (X3 resets the ships homebase when you enter a ship.) Also, let me know if you manage to fix it just in case others run into the same issue.
gastovski
Posts: 152
Joined: Tue, 3. Dec 13, 11:20

Post by gastovski »

It says "no minerals of kind left..". Pretty sure entire sector is filled with any kind. And i did not touch any settings before. I didn't set a homebase. Also only upgraded LIFE and Advanced Fight Scripts but i doubt they would cause this.

As i said this was working with no problems but now it does not. Doing usual stuff; scan corner sectors, find nvidium rock, send TL and start collecting.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

gastovski wrote:It says "no minerals of kind left..". Pretty sure entire sector is filled with any kind. And i did not touch any settings before. I didn't set a homebase. Also only upgraded LIFE and Advanced Fight Scripts but i doubt they would cause this.
Agreed.
gastovski wrote:As i said this was working with no problems but now it does not. Doing usual stuff; scan corner sectors, find nvidium rock, send TL and start collecting.
My gut feeling is that the script is working fine. One of the gotcha's I discovered early on was that there are rocks with a yield 0 of a particular mineral type. When mined, these rocks yielded nothing and as a result caused the miner to waste a bunch of time. Since I wasn't interested in miners mining nothing, I raised the threshold detection to yield 1 minimum for mining.

So if say you are using a script to detect the presence of Nividium, perhaps that script doesn't exclude yield zero. I'd move on to another sector, but if you want to know for sure you can edit line 41 (using the in game script editor) of plugin.zanzal.droneminer.mine.xml and change $config.minimum.yield to 0 and restart the command.

Assuming you are using Dr. B's Detector, you can also reconfigure it to exclude yield 0 by editing plugin.bw.detector.detect.ware.pck line 79 change min yield from 0 to 1.

Hope this helps resolve the confusion. If it doesn't let me know which sector you were getting these results/behavior in and I'll investigate. Also, if the script editor is too intimidating I can get you a link for patched versions of either file. Just let me know.
gastovski
Posts: 152
Joined: Tue, 3. Dec 13, 11:20

Post by gastovski »

Thanks i will look into it when i go home but there are plenty high yielded minerals around(not only nvidium). As i said i did collect nvidium in these sectors (Lethan's Legacy, Blue Horizon, forgot the third). After these three i went both Shadow's End and Atreus Delta(25 and 42 here) but don't collect.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Spoiler
Show
gastovski wrote:After these three i went both Shadow's End and Atreus Delta(25 and 42 here) but don't collect.
I assume these are yields of Nividium asteroids you found? Did you break them yourself, because the script won't break roids of that high yield itself (safety feature). The maximum yield you can configure it to break is 19. Anything higher and you'll have to break it yourself.
Echofinder
Posts: 250
Joined: Mon, 18. Jun 12, 06:05
x3tc

Post by Echofinder »

I must say I am loving this script, it's cheaper, less tedious, and less taxing on the CPU, and much more efficient than setting up a massive mining fleet of Falcon Haulers. Thank you for this.

May I make a few suggestions?

1. Since this is supposed to be used in lieu of a mining station, I suggest it use energy cells while operating. I'd say 1-3 energy cells per deployed drone. I see drones bringing in at least 3 units of ore per trip and they can hold a maximum of 100 (Particularly after breaking large asteroids) so this is more than a fair trade.

2. The ability to deploy satellites and lasertowers for use as a screen. Both can be held by freight drones so they can be used to set them up and take them down for extended mining operations.

3. The ability to store and use items in docked fighters. M7Cs were made for this type of activity, but lack the cargo space to do so. So the ability to store excess ECs and Mk2 drones (and minerals in the case of Falcon Haulers) will help alleviate the cargo issue.

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