[SCRIPT] Auto Debris Harvestor v2.01 by Nividium 10/20/2007 UPDATED

The place to discuss scripting and game modifications for X³: Reunion.

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

Post Reply
User avatar
Nividium
Posts: 695
Joined: Tue, 21. Aug 07, 01:31

[SCRIPT] Auto Debris Harvestor v2.01 by Nividium 10/20/2007 UPDATED

Post by Nividium » Fri, 28. Sep 07, 20:36

Nividium Auto Debris Harvestor 2 for X3 Reunion, Script Package.

Name of Script Package Auto Debris Harvestor 2
Version Number 2.01
Date Released 9/28/2007
Last Updated 10/20/2007 UPDATED
Script Created For X3 Reunion v 2.0.02
File Package Available X3 Script Installer "SPK"

Download the "SPK" file format package here: Auto Debris Harvestor v2.01

Description:

Auto Debris Harvestor 2 adds a custom ship command called [Harvest Rock Debris]. This commands a Player owned ship to begin harvesting rock debris "clusters". It is completely automatic and is run by onboard computer software rather than a pilot. This means that you do not have to pay for a pilot's wages or cut them in on any of the profits. The Auto Debris Harvestor 2 software will: buy fuel for the ship, repair the ship, monitor for enemy attack and Jump-Out of harms way if attacked and finally sell or unload the minerals that it harvests. Just press the Command button and select a Sector for it to work in. It will continue working there until all the debris clusters are gone (except for debris of zero Yield, which it ignores). It will jumpdrive back and forth harvesting and selling by itself (very quickly). You will make friends and increase Notoriety very quickly with Auto Debris Harvestor working for you. You will also make alot of credits very quickly too. This new version adds some features and removed some other internal features.

Features:

The [Harvest Rock Debris] Command allows your ships to automatically:

- Monitor the level of, search for and buy fuel for the ship.
- If the Harvestor has a regular Station as a Homebase then this Homebase needs to have "credits" to enable the Harvestor to buy Fuel. Otherwise the Harvestor will fly all the way to a SPP and then realize there is not enough "credits" then it will fly all the way back again and start working without any Fuel. Then it will do the same again after it dumps it's load. This is a mining script not a Station Management script, so remember to put some "credits" in your Stations.
- If the Harvestor has another Ship as it's Homebase, then the Player will pay for Fuel. If the Player does not have enough "credits", then the Harvestor will behave as described above.
- Monitor the condition of ship hull, search for and buy ship repairs, if needed.
- Monitor for enemy attackers and Jumpdrive out (2 sectors away), if under attack.
- If ship loses it's Jumpdrive or has insufficient fuel for an Emergency Jump, then it Docks.
- Jumpdrive to and from sectors harvesting and selling.
- You can use any ship as a Harvestor as long as it can carry XL ware ie minerals.
- You can assign another ship as the Homebase of the Harvestor if it can carry XL ware.
- If a ship uses another ship as it's Homebase, then the [Ship-Homebase] needs to have a "marker/s" of 1 unit of the intended target mineral onboard in order to let it's children Harvestors know what kind of mineral to collect. Don't lose your "markers". So, you will need to somehow get these marker minerals into the TL, Carrier, Battleship. How, the heck are you going to do that? You need to dock at a Trading/Equipment/Headquarters that already has Ore/Silicon/Nividium stocked in it and transfer 1 unit of each mineral intended to be harvested, out over to the intended Ship-Homebase. This just makes it harder for you to get started with using a Ship as a Homebase.
- You can assign a station/dock/factory as the Homebase of the Harvestor if it uses minerals.
- You can assign a Headquarters as the Homebase. But beware, Harvestors do NOT stop delivering to a Headquarters even if some other setting is set to stop MK3, CAD, CAG or Agents from delivering.
- If this bothers you, don't use the Auto Debris Harvestor with your Headquarters.
- If the Homebase uses multiple minerals, the Harvestor will collect minerals randomly. Ie: it will pick a mineral and then collect that mineral till it's cargo bay is full then sell/unload. Then it will pick a mineral again, could be the same or it might be one of the other minerals.
- If the Harvestor has no Homebase assigned, it will randomly pick a mineral to collect and when it's cargo bay is full, it will search for buyers within a 5 Sector radius and sell the wares.
- Non Homebase assigned Harvestor will also sell to your other stations/Headquarters if your stations/Headquarters prices are set higher than NPC stations in the area.
- It is not uncommon to see a Harvestor in "Idle" mode. This is part of it's normal behaviour.
- The Harvestor collects minerals by rock debris "clusters" and will stop collecting if a "cluster" volume is greater than the free space available in it's cargo bay. So a Harvestor may not fill the Cargo Hold to it's maximum capacity. This avoids wasting a good "cluster". For referrance, your cargo hold needs enough space to add a "cluster". The volume of a "cluster" is as follows:

Ore Cluster = 300 ware count units and needs 2400 cargo bay volume to store it.
Silicon Cluster = 200 ware count units and needs 3600 cargo bay volume to store it.
Nividium Cluster = 100 ware count units and needs 400 cargo bay volume to store it.

- Harvestors auto coordinate their flight plans with other Harvestors to avoid selling to the same Stations at the same time.
- Only Player owned ships can use this command. The Playership cannot though.
- Known and unusual "Bug". If you are "In Sector" while the Harvestors are working, the "debris cluster" they collect will not vanish until you are "Out Of Sector". Graphics Card problem, I guess, who knows.


The Command ends if the Harvestor cannot find anymore debris to harvest, it is attacked and had to make an Emergency Jump-Out, or if you issue a new Command ie: Dock, Fly, Standby or Jump etc.

Required Equipment:

- Any class ship that can transport minerals ie XL cargo bay class
- Jumpdrive
- Transporter Device
- Mineral Scanner

Installation: Use the X3 Plugin Manager/Installer.

Uninstall: Use the X3 Plugin Manager/Installer. Uninstall any previous versions before installing newer versions of Auto Debris Harvestor. There is code to auto-restart the Harvestors when a new version is installed.

Version History:
Version 2.01 Fixed problem with Debris of 0 value recognition ie removed arrays altogether. Checks all types and yields in one go instead.
Version 2.00 Release 10/16/2007.
Version 1.00 Release 9/28/2007.

Command Slots Used: "<t id="747">COMMAND_TYPE_CUSTOM_47</t>"

Text File Used: 448085.pck
Last edited by Nividium on Sun, 21. Oct 07, 00:38, edited 7 times in total.

PimpMyNova
Posts: 26
Joined: Thu, 5. Oct 06, 03:54

Post by PimpMyNova » Fri, 28. Sep 07, 21:06

Sounds great, trying this right away :D

xxbluedragonxx
Posts: 374
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx » Fri, 28. Sep 07, 21:17

Awesome! Been waiting for this one. I'll try it soon as I can :D

p.s. just a small thing. Is it possible to move the command to the Special menu instead of Custom? Seems more appropriate to have it available as a Special order really...

xxbluedragonxx
Posts: 374
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx » Fri, 28. Sep 07, 22:52

I've been running this a short amount on my fleet of 7 mercury transports and so far so good. Some suggestions just personal preference really apart from putting the command under Special orders they do seem to harvest very quickly indeed. Not that I'm complaining but maybe slow it down a little bit if possible to make it more realistic? I watched my ships a bit and they were really hoovering things up compared to Bunny's script. That one was very slow, this seems very fast indeed.

Otherwise it's working nicely as they are using their jumpdrives back and forth! :D

At what point do they refuel? I noticed they buy 600-900 energy cells (from empty) which is quite a large chunk of the cargo bay. I suppose the cargo space is made up for with the speed increase as they harvest much faster and jump a lot too; just curious :)

User avatar
Nividium
Posts: 695
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Sat, 29. Sep 07, 02:09

Hi xxbluedragonxx,
They assign 1/4 of the registered Cargo Bay Size as a "Fuel Tank".
Then, they apportion 1/4 of that as the minimum amount allowed before they start looking for fuel again. The bigger the ship the bigger the fuel tank :D

Yes, the Harvestors are very fast because they use Jumpdrives exclusively and Transporter Devices to beam the rock straight into their Cargo Holds. This is the 25 Century, isn't it? It just seems very fast, compared to traditional methods ie: horse and buggy as apposed to a new Ford of today. The old timers keep telling them to slow the Ford down to make it more realistic too. :D

Code: Select all

001   * ====== START Check Fuel
002   $current.cargo.bay.size = $ship -> get cargo bay size
003   $fuel.tank.size = $current.cargo.bay.size / 4
004   $min.fuel.allowed = $fuel.tank.size / 4
005   $energy.available = $ship -> get amount of ware Energy Cells in cargo bay
006   if $energy.available <= $min.fuel.allowed
007    $wanted.ware.count = $fuel.tank.size - $energy.available
008   end
009   * ====== END Check Fuel
010   return $wanted.ware.count

Pogi
Posts: 521
Joined: Thu, 13. Apr 06, 12:35
x2

Post by Pogi » Sat, 29. Sep 07, 07:39

This has been needed in my opinion for a very long time. Now instead of using utilities to get rid of rock debri in the universe. You can harvest it quickly, make profit and reduce your lag all at the same time...Good stuff

Have not tested yet, but if it uses the same AI as the Preacher, then I will be deleting a few scripts I run now for early warning on my mining TS..

Good Stuff Nividium.... :thumb_up: :thumb_up:
X3..The most fun a man can have...With his clothes on.

Pogi
Posts: 521
Joined: Thu, 13. Apr 06, 12:35
x2

Post by Pogi » Sat, 29. Sep 07, 09:45

Opens up (set as known) new sectors for you as a result of it's harvesting activities.
Tested and I like this alot! One question..I started in Herrons N. with a Merc. Only had H.N and Argon Prime as "discovered on the map" He made several runs back and forth with no problems..When his 500 e-cell (seed) ran down to 160, he e-mailed me and went on "standby". I noticed that he "will not jump" for e-cells unless the sector with e-cells is a "discovered one"..When I dropped a n.sat in The Wall and restarted him at H.N, he jumped right over to The Wall first to refuel. (good stuff). The AI of the Preacher runs a little different I noticed and goes for e-cells in un-discovered sectors.

This is by no means a problem for me at all though, as this script ROCKS :D in my opinion. Thought you may wish to clarify this though....Cheers
X3..The most fun a man can have...With his clothes on.

xxbluedragonxx
Posts: 374
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx » Sat, 29. Sep 07, 11:21

Hey I am not old :lol: but it was just a personal thing no biggie. Got used to the new speed quite quickly. Now to find where to move menus :lol: Thanks for this script! It is now my mobile miner script of choice!

xxbluedragonxx
Posts: 374
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx » Sat, 29. Sep 07, 23:19

Still running well here but a couple of things. One mining ship got attacked somewhere and jumped to Empires Edge. There was no alert or message in the log detailing where and what attacked it so the only way I noticed it had been attacked was quite by chance looking at the Property page and noticed it was flashing red but no other info apart from that.

It seemed to be Idle so I manually stopped it and restarted harvesting. All my mining ships are clearing out Home of Light so I sent it back there.

The other was a ship in Pontifex Realm. It was not flashing red but was just sitting Idle near the south gate for some reason. It had a full load of silicon. That one I did a stop and restarted the script to get it going again by sending it back to HOL.

User avatar
Nividium
Posts: 695
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Sun, 30. Sep 07, 05:20

Hi xxbluedragonxx,
it is normal for the Harvestors to idle. There is no need to restart them.
They idle for a number of reasons, ie: they are checking out the demand, they are checking out places to sell their minerals etc. You should not have to restart them, in fact this will screw up their schedules and make them angry. :D

After they have been attacked, they will idle for awhile to let their shields recharge and to get their bearings. They go back to work on their own. There is no need to restart them after they are attacked.

If any of the above is not happening, then let me know.

xxbluedragonxx
Posts: 374
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx » Sun, 30. Sep 07, 15:55

Oops my bad then :lol: Is it possible to add a log entry or alert if one gets attacked so we could then go and spank the naughty pirate or xenon or khaak who tried to steal our ore? :D

User avatar
Nividium
Posts: 695
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Sun, 30. Sep 07, 17:56

xxbluedragonxx wrote:Oops my bad then Is it possible to add a log entry or alert if one gets attacked so we could then go and spank the naughty pirate or xenon or khaak who tried to steal our ore?
Yes it is possible and I did have the code in there to do that, but, I removed that functionality. I did not want the Player to be annoyed by getting lots of emails or log entries. If you have lots of Harvestors working all over the place and many as a result will be attacked. As they are capable of looking after themselves, it did not seem worthwhile to harrass the player with emails about enemy and attacks from many dif Sectors that they might visit etc. If you are keen to retaliate, you could watch your "Property [ship] list and when a Harvestor is attacked an flashes red, you or task force could be sent there (jump) and get the badies that way. :D

Pogi
Posts: 521
Joined: Thu, 13. Apr 06, 12:35
x2

Post by Pogi » Sun, 30. Sep 07, 18:59

Another way is to use the script "Signal Targeted"..I don't think there will be a compatibility issue, but I have not tested..I run it, but my miners have not been jumped yet...It works very well for Bunny's miners..I think Nividium is right though..The AI in this script reacts to situations very sweet...If you just want to know that they have been targeted, then this script will do the job...Cheers

http://forum.egosoft.com/viewtopic.php?t=158071
X3..The most fun a man can have...With his clothes on.

Gammel
Posts: 654
Joined: Tue, 10. Jul 07, 08:07

Post by Gammel » Tue, 2. Oct 07, 00:34

Well I'm going to love getting rid of all the debris about, I might even smash some of the larger roids into debris and have the miners clean that up too. Nothing makes me sweat more then watching my TL try to navigate its way round a sector full of debris. Usually I do it OOS but I don't like to stray far cause I don't have enough money to afford a couple ships for an escort. I have confidence that my TL is armed enough to handle most threats. But thats the way the X-universe works, the minute your confident your ok, your start losing things left, right, and center.

But yeah, back to what I wanted to ask. Is it possible to get ships to gather only certain types of minerals? Cause Id like to sell all the ore, but keep the silicon. Or will I just have to periodically check them and if they are carrying any silicon then I will need to change their orders and get them to set it aside.
!!! Caution!!!
Signature lost!
Please contact your Admin!

User avatar
Nividium
Posts: 695
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Tue, 2. Oct 07, 02:42

Gammel wrote:...But yeah, back to what I wanted to ask. Is it possible to get ships to gather only certain types of minerals? Cause Id like to sell all the ore, but keep the silicon. Or will I just have to periodically check them and if they are carrying any silicon then I will need to change their orders and get them to set it aside.
Yes it is. You can assign your Auto Debris Harvestor/s to a [HOMEBASE]. Whatever the homebase uses for minerals is what the Harvestor will gather for you and deliver to your homebase/s. Because they are so fast at harvesting, I would not use more that one harvester per homebase.

EDIT: Forgot to mention that you can also link up 3...6 or more Mines to form a "Complex" ie: make 3 or more Silicon Mines into a Complex, then assign 1 or more Harvestors to the Complex ie make the complex their Homebase. Then, don't bother buying any Energy Cells, just let the Harvestors collect all the Silicon for the Mines. There are many places where Asteriods are close enough together to join them all into one big Ore or Silicon "Complex". :D

Post Reply

Return to “X³: Reunion - Scripts and Modding”