Ratting bot: anomaly and/or asteroids with Sanderling

yes, why not. you can send me in pm all changes.

Honestly, about 800km it didnt hapened to me, but I still think from the begining at that. I said well, it isnt happen. but if you experienced that, I can add them in script.

It happened to me also, couples times, but since I test all time the script and fix some errors or coding another script, I thought is because of that…
You can send also that in pm and I put that or another failsafes ( you see what I have in mind, but if your solution is better, you can be sure I use that).
And Really thank you for the feedbacks.

1 Like

I’ll send you some snippets later tonight when I get back to my computer, cheers

1 Like

anytime man. anyway, for the next version I planned some things and the next commit will be in max 1 week, after i test them.

I’ve been using this in the InBeltMineStep portion of the code to prevent chasing rats too far, the shinmaneuver portion is added to prevent it from saying the site is finished as we are warping into a site but the rats are showing > 160km

if(!(ListRatOverviewEntry?.FirstOrDefault()?.DistanceMax > 160) && (ShipManeuverTypeEnum.Warp != ManeuverType))
{
Host.Log(“Site Finished because of distance”);
SiteFinished = true;
}

And I put this snippet at the beginning of the defensesteps to make sure it always launches drones if it has a target, there might be a better way to do this, but so far it has been working for me.

if (null != targetSelected && DronesInSpaceCount < 5)
{
DroneLaunch();
}

I have been trying to make it use a mobile tractor unit next and a cloak for safespotting when locals arrive if not using a station or POS as your docking point. If I figure it out I will also post my snippets,
keep up the good work

if (Measurement?.ShipUi?.Indication?.ManeuverType == ShipManeuverTypeEnum.Orbit) //if orbitting something in site, engage defense step
{
return DefenseStep;
}

this snippet in your inbeltmine step, will allow the bot to start defense fighting if already orbitting an object but has no drones out, otherwise as your code sits now, he will just sit there forever tanking.

About launching drones I didn’t pay attention and misread attacking drones ( it happens that to me from time to time and I was glad somebody experiment also that). Actually, he didn’t just sit and tank never and this is a first

I suppose you use sitefinished for more than logout time, because in original is used only for that, and in next version will disappear entirely any usage ( will stay just for show, maybe). What it useful is the return to mainstep( in original).

For (ShipManeuverTypeEnum.Warp != ManeuverType) you can use ReadyForManeuver because if you are just warped to station and you have there some rats at 20km, you are in problems.ReadyForManeuver has docking included the states between warps and static.
if you use

if (null != targetSelected && DronesInSpaceCount < 5)

it means you launch drones even near stargate or station if you target them manual or by error. Also, you launch the drones, even before the orbit or verifying if the site is owned not?
you could use this on right after this lines:

    if (null != targetSelected)
    {
        if (shouldAttackTarget)
        {
  drones launch

exactly because you wanna check the site and take the aggression on the ship. but that depends on fit and sec space.

Defence start because there are rats, not because he orbits. and with that, being in Belt, if other rats come and you are not in orbit ( you take the wrecks) you go back to the first problem because it could happen to not launch the drones, again. So is not a fix, is not solve the situation.
If you want, you can put directly in insitebelt if rats>0 then drones launch and return DefenseStep;

Launching the drones is strictly sticked to how many drones you have in space and in the bay, and here it could be your problem
Do you have window drones big enough to read all drones?
I advise you to put some debug messages inside your code for example:
one at the beginning of defensestep, to see if he entered in defence or not.( but since it targets the rats, he is in defence step)
one between Orbitkeyboard(); and if (DefenseEnter), and so on. Like that you can identify where is the problem.
You have window drones big enough to read all drones? how many drones does it show in stats?

sorry, but in original script if you entered in defensestep, from there you get out only if you are not orbiting ( and get to insitebelt) or return null if you dont have rats. and in this case, you get to mainstep and from there to insitebelt. Also we are a lot of people who use regularly this script and never it happens to not launch the drones and tank.
Im the only one who get the problem with attacking not launching.
So I like a little more documentation on this bug, a log with a lot of debug messages is more than perfect

2 Likes

@Botfather did you transformed the distance from km to m?
I ask you because if you didnt transform the 160 ( you said its km) and since sanderling use m, you actually have there 160m. And, not having rats at distance < than 160m then you will be forever in “site finished” ( remember is used only for timeout session) and orbit and tank , indeed like you said, forever.
And indeed, you need a line like: if you orbit, then enter defense; how you posted early.
Its a common mistake ( myself done it right now, copying your line( I was lazy and not completed myself in sanderling)

1 Like

Now it ignores the rats further than 120km ( configurable in settings)
Warp configurable in settings
Changes in messages :slight_smile: R2D2 love you this time and Master Yoda teach you to feel the Force.
Default settings ( because the bot could be load from the web).
And some other gifts, but I let you use the script and discover them.
As usual, the master branch, open source and free to use:

3 Likes

hm, I see this fit work also ( copy and import directly in-game ), orbit at 30 km
[Vexor Navy Issue, **]

Omnidirectional Tracking Enhancer II

Medium Armor Repairer II

Drone Damage Amplifier II

Drone Damage Amplifier II

Drone Damage Amplifier II

Drone Damage Amplifier II

Drone Navigation Computer I

Republic Fleet Large Cap Battery

AML Compact Omnidirectional Tracking Link

100MN Monopropellant Enduring Afterburner

Drone Link Augmentor I

Medium Ancillary Current Router I

Medium Capacitor Control Circuit II

Medium Capacitor Control Circuit II

Praetor x8

Tracking Speed Script x1

Sorry for the delay, I wasn’t home, and let my cats at play;
So they improved a little the code and became addict to the game. My male love to look now the rats be killed hour after hour, all day.
The female, like all women’s, had complaints; she cried all the time she wants back. You know, cats have patience, isn’t? well, she wanted back at the same hole; again and again, until she finishes the rats.
So In the end, they caught rats all day and days.
So, sorry for the delay. :slight_smile: the code is ready from the beginning of the week, but I didn’t have time to publish and didn’t want to perturb the cats.
like usual the master branch show you the changes :slight_smile:

2 Likes

Just tried this … the bot seems to attempt to ignore all anomalies for some reason …

I did make edits to not ignore any on the line where the list of anomalies to ignore are stated

1 Like

I’m glad you made him work for you, even if you had to edit the script. For me and a couple guys is working without any modification. and is work like a charm.
More than that the git is the exact copy of what is running on my computer. I just let him in other room and check him from time to time.
Now, why for you is ignoring all anomalies? Beat me if I know. It could be 2 causes:

  1. you ask him that. I mean even if you put
string AnomalyToTake = "Forsaken Hub"; 

but if you have on

string IgnoreAnomalyName = "hub";

he will ignore the forsaken hub because he has inside “hub”.
So you have to be careful to distinguish between “forsaken hub” and any other anomaly with “hub” inside.
2. your readings are not all right, because the window is too small or is stacked with other windows.

There is also a 3-rd cause. The bot is like a woman, you know? If you take out his clothes to make love, and in a moment you put back his clothes because you change your mind, and again after couples min, you take out again his clothes and put back again, and again and again and again…; well from a moment she starts to cry . Or she starts to tape you :))
BAck on bot, if you modify something and start/stop the bot and again and again, more than that if you change the chars, then he will start to twist the readings.

1 Like

Good evening my friends … I’m reviewing my codes to make my BOT more coherent and I found the following code …

				var memoryMeasurementAtTime = bot?.MemoryMeasurementAtTime;
				var memoryMeasurement = memoryMeasurementAtTime?.Value;

				if (!memoryMeasurement.ManeuverStartPossible())
				{
					yield break;
				}

Could someone tell me the function of this command line? What is it checking and what function is it performing?

this simply breaks code execution during warp/dock

you have upper in you file defined ManeuverStartPossible ( it should be about warp/dock/undock states)
the sign ! it means the negation of affirmation and result when the manoeuvres are not possibles info here

about yield is here: yield statement - provide the next element in an iterator - C# | Microsoft Learn
and break here: Jump statements - break, continue, return, and goto - C# | Microsoft Learn.
that means, indeed, if the ship is in warp /dock and maybe undocking state, it terminate/stop the loop

  • but this it should be in learn category so if you ask someting, use the proper category, pls

Thanks my friends … now I understand the operation of this command.
Another situation is:

  • Would it be possible for me to check which type of craft I’m flying at the moment (for example, I die and stay in POD)
  • And if I’m in POD it calls a function (such as Retreat)

why don’t you make a post ? or you think there we don’t respond? Asking here and there in other posts is the most confusing

Sorry my friend … I avoid creating topics not to pollute the forum, I found that answering existing topics will be better, the next time I post … sorry.

Actually isn’t better to ask different questions in a post unrelated with your subjects. Thats why is really hard for anybody to find an answer at his questions, because even with searching, if the exactly word is not used or the code , then you have a problem.

Let’s say you search pod related subjects. You wont find , because the word pod is not used. If you search capsule, then you have a chance. BUT you have to search each post where is this word.
Isn’t better to create a post? you know the questions and answers are there.
I can offer you many posts where the subject was one and the discution was on complettly different subjects. Like that I’ve come to read 90% of forum; Is not bad, but also it’s a time eater.
That’s why, in my opinion, is better to have post = subject.
Also, if you look better on my bot ( ratting, I offerred you multiple times examples from there and the link) you will find your answer.
You will see how I defined the existence of capsule and how i manage

1 Like

buddy your bot can not do rock haven because you need to add a waiting time for rats to spawn

1 Like