Ratting bot: anomaly and/or asteroids with Sanderling

@Morpheus: first, thank you for the feedback it is really valuable.

problem solved :ok_hand:

Well, there it was a problem; Iā€™m a lazy person and I used variables. It seems Sandy doesnā€™t love lazy guys :d :)). Andā€¦ now I followed Terpla advice.
So problem solved ( and extended at other statements)
Anyway, the wrecks are looted in the new version.

@pikacuq

You have right, even if it is a script and is slower than your main bot :slight_smile: It happened one time when i was fucked by 6 ewar ships.
The problem is ā€¦ I cannot distinguish between scramble, web, etc.
The ewartypeEnum who take the int of each ewar icon packaged into an array throw an argument null exception at first argument of Intersect.
If i put the listEWarPriorityGroupTeamplate !=null

&& listEWarPriorityGroupTeamplate !=null && listEWarPriorityGroupTeamplate.Intersect(entry.EWarType).Any())

then it ignores any ewar attack. :frowning:

Now, the way to solve all that is ( from alot of documentation over net):
step 1 identifyng each ewar id in overview
step 2 comparing him with my list using HashSet and a void - to return the all thinsg if null = ā€¦
step 3 make the intersect
step 4 creating the list to attack

Another way is to use directly an" foreach ewar in overview" if is enum.scramble then attack. The problem is again, enum because are not directly accessible.
Anyway, the all process takes time and since I donā€™t have ( unless I create him) a memory buffer specifically for ewar ā€¦

So, unless somebody with bigger experience and knowledge ( i cannot do all that and find an reliable solution) in programming, I will stay at the simple version:

?.Where(entry => entry != null && (!entry?.EWarType?.IsNullOrEmpty() ?? false) && (entry?.EWarType).Any())

or something like that :slight_smile:
I really thank you for feedback,it was really instructive.
The next version will be in a couple days :slight_smile:

1 Like

you dont need anything complicated.
ewar ships are frigates they die quickly ā€¦ but if you are concerned about scram to be prioritized do something like that instead

				EWarTypeEnum[] EWarPriority = { EWarTypeEnum.WarpDisrupt, EWarTypeEnum.WarpScramble };

				EWarTypeEnum[] EWarRest = { EWarTypeEnum.ECM, EWarTypeEnum.Web };

note, if your ewar is ignored, i do believe itā€™s caused by entry != null condition.
My bit of working code looks like this

var EWarToAttack =
					listOverviewEntryToAttack.Where(entry => (!(entry?.EWarType?.IsNullOrEmpty()) ?? false ) && EWarPriority.Intersect(entry.EWarType).Any()) 
					?.OrderBy(entry => bot.AttackPriorityIndex(entry))
					?.ToArray();

later on I have simple condition to begin with my code

if (EWarToAttack.Count() > 0)
// DO STUFF

that is done from the begining and throw argument null exception :)( did you read the script?) and crash when is ewared

Sorry for the noob question but did you updated the code somewhere ? i see only your version of 4 days ago on github

Btw if you need more test i can help. As said to Viir iā€™m not able to write code but understand when i read it :slight_smile:

Happy to help

no, not yet. ok I will make an update right now
The only problem ( from my test) is the ewar, so i let only their presence

the update is online on git. Thank you @Morpheus.
Viir helped me with his post and learn everybody how to configure this bot. there are a lot of setting :slight_smile: ( to be honest I forgot about that)

**** LATER:
I tested the asteroids last entire night on HS so var RetreatOnNeutralOrHostileInLocal = false. - that means if you run him on null, you have to put him on true

Yeah on my side iā€™m only using it in 0.9 or 1.0 system so i have no rats in system ā€¦ Less profit but less work to do :slight_smile:

i might need your Help to develop an Orca version iā€™ll throw you a PM about it :slight_smile:

Is there specific short cut settings that have to be made for this ?

Also ā€¦ the retreat when neut/red in local isnā€™t working ā€¦

the retreat is working, for everybody and for me; the window has to be biggest possible, not scrollable ( like in all scripts for sanderling.

all shortcuts are in the setting, at the beginning of the script. if you played with shortcuts and you use other ones for orbit(w), attack drones (f), you can change them in settings in code

Also from your deleted post, I have no idea if is working on v17 of sanderling since is an older and local chat is changed in-game from then
The latest version includes the import of script from git https://github.com/Arcitectus/Sanderling

1 Like

Older Version - Working ā€¦

Shortcut Settings - Thanks for clarification, i figured that what it was but just wanted to get clarity

When I said retreat not working ā€¦ it appears to be partially working for me ā€¦

it recalls drones ā€¦ then opens systems window ā€¦ at that point it throws an error for myself ā€¦ do you need a botconfig file with retreatbookmark listed in it or is it good enough to name it in the cs file?

on the lines 74+ on script are the settings:

//	Bookmark of location where ore should be unloaded.
string UnloadBookmark = "home"; //supposed your bookmark is named home

//	Name of the container to unload to as shown in inventory.
string UnloadDestContainerName = "Item Hangar"; //supposed it is Item Hangar


//	Bookmark of place to retreat to to prevent ship loss.
string RetreatBookmark = UnloadBookmark;

that means your bookmark for retreat is named ā€œhomeā€, but you can change how you want
I advise you to read all settings

1 Like

I added a new commit with some improvements asked in pmā€™s or on this post.
Honestly, the improvements are made over the time and more than the ones mentioned in the description ā€¦ I donā€™t remember.
I run this script almost every day on different ships, different systems, in null, HS, LS, on asteroids, or anomaly, sometimes in safety systems, sometimes like a ninja. Remember, reds have their background in red, and local chat must be bigger possible, If you are in a system with 500 players in local, is not safe, because they are in the scrollable area.
About fitting, I use
[Vexor Navy Issue, coco]
F-89 Compact Signal Amplifier
Capacitor Power Relay II
Drone Damage Amplifier II
Drone Damage Amplifier II
Drone Damage Amplifier II
Medium Armor Repairer II

Drone Navigation Computer I
Drone Navigation Computer I
100MN Y-S8 Compact Afterburner
Large Compact Pb-Acid Cap Battery

Drone Link Augmentor I
Drone Link Augmentor I

Medium Ancillary Current Router I
Medium Capacitor Control Circuit II
Medium Capacitor Control Circuit II

heavy drones x5

or myrm
[Myrmidon, Myrmidon coco]
Capacitor Power Relay II
Medium Armor Repairer II
Medium Armor Repairer II
Reactive Armor Hardener
Drone Damage Amplifier II
Drone Damage Amplifier II

Drone Navigation Computer I
Large Compact Pb-Acid Cap Battery
Large Compact Pb-Acid Cap Battery
Cap Recharger II
10MN Monopropellant Enduring Afterburner

Drone Link Augmentor I
Drone Link Augmentor I

Medium Auxiliary Nano Pump I
Medium Anti-Kinetic Pump I
Medium Anti-Thermal Pump I

drones at your choice

So, feel free to test ( at least) this bot, but watch him, to be sure

1 Like

Hey dude and thanks for sharing this. Just a pointer, it seems the retreat bugs out if a red/neutral leaves system before it has finished. I had my ship recall drones, warp off and dock at its bookmark, when it was in station the red was gone and the script stopped.

recall drones - ok
the script stopped. The only reason to stop the bot automatically is stated here :

bool MeasurementEmergencyWarpOutEnter =>
   !(Measurement?.IsDocked ?? false) && !(EmergencyWarpOutHitpointPercent < ArmorHpPercent);

void RetreatUpdate()
{
   RetreatReasonTemporary = (RetreatOnNeutralOrHostileInLocal && hostileOrNeutralsInLocal) || (listOverviewDreadCheck?.Length > 0) || (listOverviewEntryEnemy?.Length > 0) ? "hostile or neutral in local" : null;

   if (!MeasurementEmergencyWarpOutEnter)
       return;

   //	measure multiple times to avoid being scared off by noise from a single measurement. 
   Sanderling.InvalidateMeasurement();

   if (!MeasurementEmergencyWarpOutEnter)
       return;

   RetreatReasonPermanent = "Armor hp";
}

and is commanded here:

        if (0 < RetreatReasonPermanent?.Length) { Host.Log("bot stop"); return BotStopActivity; }

Until you warped home, did you took damage from rats? it was activated armor repairer ? ( that was the reason to activate him when you retreat, and also if the red come on you, you could have couples second in +.
So the only reason to stop the botā€™s when you take damage too big to be safe on ratting in your area. Its a safety used once when you take dmg too big from rats and the second when you have to retreat because of reds and also you take damage too big.
So, from the first point of view for this bot I had in mind, its safety, not speed.
So, i have to ask you next :

  • what anomaly you take?
    -what ship you use?
    -what is your fitting? Itā€™s a speed tank fit? armor tank?
    -at what distance you orbit?
    -what was the damage you sustained or armor?

and now it begins some theory :slight_smile: ( sorry for that)
first: you canā€™t control the position of your home and anomaly.
the most bad combination is : armor tank, 10mm afterburner ( something like my fit of myrm) , smallest orbit : 20-30 km.
Why? because you are too close to rats. and because you will take all the time dmg and you will stay only in armor repairer. Imagine yourself notthis situation:
a red is comming
the bot stop the burner,
repairer in on already
and align to home point.
now, you pass right between the rats
it pass 5-6 sec when you have not speed and you take the bigger possible dmg, from 3-8 battleships
And remember you stay on armor, not shield.
So that means you already have the armor at 80% ( any value actually)
and you take from 4-8 ships 200-600 dmg /2-4sec
and until you become invincible from warp, your damage is multiply 2-3
I meant you have 60-80% chances to lose the ship in this conditions, even like a human, a bot ā€¦ is a bot; he follows some steps

In this case you have to review your strategy game.
After i lose some ships ( ~ 12-16 vni at 250m) i come to use my fit.
its a speedy tank, and I orbit at 40-43 km.
Of course the bad thing is F-89 Compact Signal Amplifier , but he increase thetarget range and also my sig.
So, i keep aggro on me( so my drones are safe and also speedy), and also usual, even with 20 rats around me I take 0 -5 dmg/ 10min ( except the beggining of anomaly)

So IF i have to go between rats, I have all shield and 60% of armor to warp and dock home. In 7-8 sec until I warp, i can fly 10-15k until the full dmg from rats , and only 50% from them (so 2-4, not 4-8 rats)

Now you do the math I have 100% armor + 60%armor to lose and have a bot stop.
you had 10-70% armor to lose for a bot stop.
In 4 months i lost 0 ships with this fit and strategy, and is the reason for using the myrm from time to time ( and also for testing new systems) because Im bored of same ship

Iā€™ve found that it will crash if your inventory and probe scanner windows overlap. Perhaps that is the issue?

ā€¦ but ā€¦ is common sense from all others scripts : each window have to be clean and not stocked and not intersected with another oneā€¦ ( i Will state that in next versions)

overlapping windows will make bot trying to click on something which cannot be reached, but it definitely should not crash anything.

actually, the measurements are fucked up an could cause a crash ( but he talked about bot stop man, so once again, read the entire post /code not in triagonale)
If you wanna made an experiment: when the mouse made a clik on retreat bookmark and exaclty when he must made a click on dock, you made a click on asteroids, you take a crash in your a-bot.
in a-bot you work on levels for menuā€™s and he make on last lvl a reading of string. if when he must click on string identification but you move the mouse between his measurement and the command to click, you take crash
not on my script.
cheers

he said crash :wink:

anyway, any c# program can crash when it experience unhandled nullexception,.
But in case of overlapping windows, reading is not fucked because memory holds info on all windows in viewport and so knows where to click, but he just cant do because something is blocking it.
So bot will not crash nor stop, he will just be stucked in infinite loop trying to do what he should but cant

damn @pikacuq ā€¦ your triagonale go to blackholes. thatā€™s why I remember you all time, read the entire post or first his postā€¦