In hisec it is desirable for looter in Orca to sit in belt with the miner and gather ore continuosly while boosting the miner. I can get my Orca currently to 81k m3 cargo space, so it is quite a lot of time that the Orca can spend in belt boosting instead of warping back and forth and sitting in station as it does with the vanilla version.
I have looked at the looter algorithm and have devised a quick hack to get the Orca to sit in belt with the miner.
In the algorithm I made following modifications:
1st modification:
330 UndockSub is moved before 280 LooterManager. This is to get the looter to undock as soon as possible and spend time in space instead of in station, so it can boost miner most of the time.
2nd modification:
I have to get Orca to stay in belt and move away when the belt is empty.
I searched for a function that can tell looter to return to LooterManager when the belt is clear of asteroids (it already does that when the cargo is full).
The only function I found that I think can do what I want is CheckTank. The function checks if tank is present in location. What "location" means is not explained, so I presume that it means the belt.
So I made the following modification:
New functions:
400 CheckTank 0:200+ 1:410
410 Sleep(60000) 0:410 1:380
Modified function:
380 LooterTS 4:400+
The idea is that the looter when finished looting cans in belt (380), if cargo not full, checks if tank is present in belt (400), if tank is present the looter sleeps for a set amount of time (in my case 60 sec) and then returns to LooterTS (380) to loot any new cans if present. If tank is not present, the looter returns to station (200), unloads, undocks and gets back to LooterManager.
This way the looter can only miss the last container which the miner jettisons before moving on to next belt while still spending most of the time in belt.
The resulting algorithm makes the looter sit in belt as expected.
The problem is that it doesn't seem to notice when the tank leaves the belt, beacuse the looter still sits in belt when the tank has moved on. Luckily, it seems that when the miner has made a new container at the new belt the looter is made to move anyway by some obscure hidden mechanic which is hidden from the algorithm editor. Anyway, it prolly doesn't work at all as I expect because of my limited knowledge of the algorithms and no way of knowing the details.
All in all the algorithm editor is great, although it is desirable to get some new functions which are more general in nature so that the algorithm aditor has more freedom of choice.
The modified graph and the script are attached.