Mining in HS 0.9-1.0 another script

mining

#1

this script is made for a friend of mine.
Is specially designed for his demand. It uses only drones and doesn’t have any special features.
It use bookmarks, but all bookmarks for mining have to be in a folder.
Is a version of basic mining scripts created by Viir and Terpla so all thx go to them


2018 in Review
Bot 7E301560 - /* Ver: 1.1 ORCA DRONES: SPACE 1.0-0.8
#2

Love the idea of drone mining and thank you for your efforts!

But unfortunately I cant get it to work with my orca. It constantly switches asteroid for the whole group of minig drones instead of controlling them individually and only if status is “Idle” :tired_face:


#3

man, I cannot test if is work with mining drones , because i cannot use them. And I’ve created this script exactly after specifications.
My friend tested him, and says is ok (?).
did you took the last commit? because switching the targets it was at beginning.
LATER :
:d sorry, I fixed this in pm with him but didn’t upload the commit.( this script stay the from almost 1 month)
now it should be ok ( but I w8 a feedback from you also, to see if is working the entire script)


#4

It works now, thank you!

Putting each drone on separate asteriod will be way more effective in hisec. Also option to activate shiled hardeners would be nice! :wink:


#5

shield for what? you don’t have rats there :)) ( later: is designed for 1.0 space)
splitting the job between drones is more complicated( calc how many you have, if one of them is idle or not and send each drone separately) and honestly this script is meant to be simpler;
In the future, if I have time ( because I have another project) I could develope one more usable even in lower space.
the most interesting thing in 1.0 sec is protection from bumping ( you can see that on my rating script)


#6

I’ve added shield hardeners activation, it’s now suitable for 0.8 systems mining :yum:

https://pastebin.com/M4y37pZj


Bot 7E301560 - /* Ver: 1.1 ORCA DRONES: SPACE 1.0-0.8
#7

Hey Svs, looks like you have discovered a new bot! Thank you for sharing this with us!
I added this bot to the bot catalog:


#8

Yes we are developping that version with Kaboonus since a couple of weeks now

We trying to improve it as much as (we) he can :wink:

Their might be an issue with the warping to bookmark … We are testing it since 2 days … Might be on my side too so we will keep you updated with the dev.

We might also reduce the number of lines used too … So be patient new versions will come in the next days


#9

SVS we decided to make the script for 0.9 and 1.0 where no rats incoming that’s why we did not developped the hardners parts otherwise we should stop mining

The idea of 1 drone by asteroid will be next step in the dev … but requires more effort. Depending of the number of drones you have , the number of target you can lock ( max 7 with Orca as far as i know )

I prefer to have it siple and develop step by step when we are sure that previous step is working 100%

Can you tell me if you have same problem as me ? It’s not warping to BM 2 when asteroi belt n°1 (BM 1 ) is empty.


#10

Yes, I can confirm it


#11

the only way to test that for me is to hide in the overview the asteroids. and is working for me. He warp to nextbelt
I have exactly the same script( the insitebelt function and mainstep), based on beginner miner script, and is working day after day.
what are the messages ? because the script is full of messages for debug.
@Svs since you started to add features, and, most important, you have an orca and you can mine with drones, can you keep working with the script?
If you look at beginner script, you’ll see I have changed modules with drones, with modules is working but not with drones and since I cannot test him to see each line if is executed, is almost impossible at my level to debug him
I can say you to change the lines

	if(null == asteroidOverviewEntryNext)
	{
		Host.Log("no asteroid available");
		//return null;  //comment this line
return MainStep; // add that
	}

but honestly, I cannot see if is working or not and the impact, since I cannot test the script

is not only that. you have to read how many drones you have, make the calculation if you have enough asteroids, doing again the math to distribute for each drone an asteroid and if not, to add 1/2/3 ( up to 7) drones to available asteroids. Now, if you read the forums, with miner modules, that doesn’t work 100% all times with 2 mining modules( it does not activate the second module on the last one asteroid). And honestly, is way beyond my newbie programming skills to manage 7 drones separately ( this thing is made by pro programmers on carriers at ratting).
More than that, my only experience in mining is adding at the beginner mining script to run like a chicken when there are rats on site and running a venture from time to time.
More than that, I used the warp to next belts used in my ratting script (asteroids part) and is working like a charm, daily. Is changed only from “asteroid belts” to any folder bookmark naming " mining sites" generally. This doesn’t have any impact.
Anyway, these days I’m fully loaded with personal stuff. Yesterday I was so broken than I sleeps on the sofa at 19h when I tried to relax after I dinned. and I wake-up now at 2 in the morning. And all week like that, so I cannot work at all on scripts


#12

Your fix is not working. It still keeps picking first bookmark from folder even if it’s empty.
I’ve also noticed strange behavior if only one asteroid left in belt. It recalling drones, then launches them again, putting them on asteroid and recalling them again.

Maximum number of drones in space is 5, you can hardcode it for starter.

Same as mine. I’ll try to fix it myself when I got free time.
The ultimate idea is to store all bookmarks or asteroid belts (which is better) with amount of ateriods left in array and blacklist empty ones to reduce number of useless warps to a minimum. But that is beyond my skills.
If someone would be kind enough to implement this I’ll be happy to test.


#13

actually the only reason is not changing the site is because of bookmarks, is working 100% if you change your folder bookmark to " asteroid belts".
When you use “asteroid belts” and you are in respective belt, first entry of menu is Look at.
When you use bookmarks your first entry is approach location all time.
Now, when I created first time this script I already tried to combine the warp the 2 functions of warp from the script with bookmark and from beginner script mining, but it isn’t work.
So the only option, unless somebody more skilled recreate a function to do that, with actual script is to let the " asteroid belts" how I posted in script

I will look upon that. Maybe is because there are more conditions for using drones the script enter in mainstep but since there is a last asteroid, then he re-renter in insitebelt.I will try to regroup the conditions. But my fixs will be purely at coding, since I cannot test the solution will be hard

Since I dont have any skill at mining, and morfeus told about 7 drones I asumed there are 7.

Feel free to code and test, that’s the way to developpe you skills and create more complicated scripts, at your needs. I can assure you nobody could create a script at your please and needs. Also its the way we all suggest by posting generals scripts and explaining different way’s to solve things. From there, each of us developpe the script at our needs
So look at how a script was made, take a good look at https://github.com/Arcitectus/Sanderling/wiki/Script-Engine, because I can see what target you have and a way to do that. So the only wish is be brave, accept the provocations and do not let the fear stop you


#14

Kaboonus you missread my post i was talking about targets you can target 7 roids with orca but max drones is 5.

Sorry for the confusion as English is not my mother language


#15

anyway man, 5 or 7 is the same to manage each one separately with his own target in case you don’t have enough targets you start to redistribute.


#16

Ok i found something

in fact the “asteroid belts” folder you’are talking about is the directory of the game where are put all the belts in the system you are in

If you make a personal folder whatever the name you choose and whatever the number of BM you have in … it does not work.

so the line 36 and 37 does not interract correctly with line 500 if i can read the script.
The script seems to use only the systemmeu folder and not a custom one

But anyway i would like to thank you for what you already developped for us !

Another idea just came as i was reading the script … Should this instruction

PickNextMiningSiteFromSystemMenu

take only the system name of the belt and not the “custom” BM ?


#17

pickNext (… ) do this:


	var nextSite =
		availableMenuEntries
		?.OrderBy(menuEntry => visitedLocations.ToList().IndexOf(menuEntry?.Text))
		?.FirstOrDefault();

he take in order the entries from an menu, it doesnt mater if is bookmark folder or system

But is matter another thing:
The script record the location, he confront the stored location, identify and take next; You have the location under system name: " v farouh asteroid 2"
and the script try to go to next location from BM3 to BM4 but he recorded “farouh5 asteroid 2” so he doesnt know where it is.
I tried naming the bookmark how they are ( just clik ok and not naming BM1) but it doesnt work.

So in the end you have to chose: or you want to take the asteroids in order and use system default core ( naming “asteroid belts” )or to use your own BM and use the random generator ( there is no way, at least for my skills to take Bm in order by incrementing the number).That’s why I supose the original creators used the random generator, because you avoid to store the names and index the place ( bm 1 is on first place, … bm 25 is on 25 place) and take the index , take the corelation from database to his name ( string) and use that string; and over all that, to increment this number (index) each attempt to warp.
I didn’t know about that and also about onther thing:
CCP implemented and use a paradox from physics: using the formulas to reach a point (object), you’ll never reach that point because you’ll have always 1/2 from the initial distance to do. Also he make a difference between real points ( with brackets like for belts) and “virtual ones” from bookmark. Is the reason we have the approach to bookmark all time

about drones bug i talk in next reply because i need place to put all code. I offer you 2 versions of what to do, but Im not sure if something is working or not; so be careful


#18

I cannot test any of versions, so there is no guaranty
version 1 just get out the parts with drones launch out of the loop and will look like that:

		if (0 < DronesInBayCount && DronesInSpaceCount < DroneNumber)
        DroneLaunch();

		if (!(0 < DronesInSpaceCount))
        DroneLaunch();
	if(0 < setTargetAsteroidInRangeNotAssigned?.Length)
	{
		var targetAsteroidInputFocus	=
			setTargetAsteroidInRangeNotAssigned?.FirstOrDefault(target => target?.IsSelected ?? false);

		if(null == targetAsteroidInputFocus)
			Sanderling.MouseClickLeft(setTargetAsteroidInRangeNotAssigned?.FirstOrDefault());
// the parts with drones launch was here and put them before 	if(0 < setTargetAsteroidInRangeNotAssigned?.Length)
		//MineTarget();
	//	 Sanderling.KeyboardPress(VirtualKeyCode.VK_F);
		if (droneInLocalSpaceIdle && (Measurement?.Target?.Length > 0))
		{		
			Host.Log("drones idle");
			//MineTarget();
			Sanderling.KeyboardPress(VirtualKeyCode.VK_F);
			Host.Log("mining a new asteroid");
		}
		return InBeltMineStep;

version 2 will look like that

		if (droneInLocalSpaceIdle ) // comment from here and put ")" before && (Measurement?.Target?.Length > 0))
		{		
			Host.Log("drones idle");
			//MineTarget();
			Sanderling.KeyboardPress(VirtualKeyCode.VK_F);
			Host.Log("mining a new asteroid");
		}

obvie=ously, you can try to combine the 2 versions: put the drones launch before the if and comment like in the second version.
you can try like that: try version 2, if its not working, get out the drones launch ( this will be the combination) and if its not work, then change purely to version 1 .

IF is not working, i will make an debug version, to help us to find the behavior and why is not work