Space Engineers

Space Engineers

Demo Kristofs Lazy Drill script
25 Comments
Explicit Prophet 30 Jun, 2020 @ 10:04am 
Any way to set it up so the rotor just keeps spinning and to have the pistons go down 1 after another?
KristofDeRaver  [author] 21 Oct, 2019 @ 4:04am 
New version 1.5 - see change notes for full details

Drill Changes: Added a cargo container and added it to the group orecargo (see script change below)

Script Changes:

bug fix : removed a command that would reset the drill at each load of the game. Now it remains at the previous position.

* DRILL inventory protection: If your drill inventory would get full, the drill will pause. .

* CONTAINER inventory protection: Pause drill when a container group reaches a preset percentage filled. Usefull for ice to hydrogen production queue
KristofDeRaver  [author] 10 Oct, 2019 @ 4:52am 
New version 1.4 - see change notes for full details.

Drill changes: new cmd kickstart in button panel. Lowered power on pistons (see changes why), script 1.4 installed

Script changes :
support modded pistons > 10m range,
recovery mode (auto recover when drill gets stuck or hits obstacle)
kickstart command ; auto position drill head to ground level at start
KristofDeRaver  [author] 7 Oct, 2019 @ 12:44pm 
New version 1.3. If you use the previous drill, I recommend replacing the script by this version as version 1.2 had a bug in the speed calculation and when working with a negative rotor minimum.

See changes notes for full change details. Summary:

DRILL changes: extra button panel + Increased strength of pistons DOWN

SCRIPT CHANGES : bugfixes to speed and negative rotor, measurement of drill inventory, new commands extend1 and extend2 , much more LCD info.
KristofDeRaver  [author] 28 Sep, 2019 @ 10:53am 
@Zues : your requested adapted drill is ready for your testing here : https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1875137043
KristofDeRaver  [author] 28 Sep, 2019 @ 5:04am 
@game_space19 : can you give some more info ? Which actions did you try ? What info is the drill giving on the LCD. try to use the command "reset" in the programmable block as a start.
Zues 27 Sep, 2019 @ 6:36pm 
@KristofDeRever https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1874413517
Here is the blueprint as to what i was talking about its very crude I am sure you would be able to streamline it better. Just to show that 1 group go left 1 group go out and the 3rd go down
game_space19 27 Sep, 2019 @ 3:32pm 
it is not working for me idk why tho
Zues 27 Sep, 2019 @ 4:11am 
Ill get on that this afternoon I was about to head to bed when i noticed your post
KristofDeRaver  [author] 27 Sep, 2019 @ 2:13am 
@Zues. Thanks for the suggestion. To be sure I understand your idea, could you build this drill with the extra piston group and share it with me ? This enables me to be sure that I can adapt the script as expected.
Zues 26 Sep, 2019 @ 3:26pm 
One segestion i see is adding a 3rd piston group. so you have have it drill down "5m"
then out 15m then to the left/right 15m. this way you can efectively dig out a "basement" without having to use a ton of drills
KristofDeRaver  [author] 25 Sep, 2019 @ 7:38am 
I am really happy to announce script update V1_2, see the change log for details. Now you can use the CUSTOM DATA of your PB to change the parameters of your drill. Future updates will no longer overwrite your changes made directly in the script. You can use the link to the script only workshop if you have the demo drill already working. It will create the custom data on the first run.
KristofDeRaver  [author] 24 Sep, 2019 @ 4:18am 
@Babbayega Answer 2 on:

assume the PB knows the current position of the pistons. maybe an error check to see if the piston actually moved as expected might not be a bad idea. Just a thought.

SE code is kinda special, you can't wait for something. The code runs 60 times per second and you need to build in checks that every time determine if something is done or do something.
But I will see if I can find a way to determine that the expected move of a piston is taking longer than expected to provide a warning, maybe by reading out the system time. Keep the suggestions coming. Hope you enjoy the script.
KristofDeRaver  [author] 24 Sep, 2019 @ 4:14am 
Answer 1 (2/2)

So the script will NOT touch any blocks outside of its groups. So you can even have multiple of these drills on one grid, and multiple PB, as long as you make sure they have their variables set to different names.

If you don't like the fact that you need to do this in the script header, I could make it possible to do this in the CUSTOM DATA in some way, like pistongroup1=groupname.

KristofDeRaver  [author] 24 Sep, 2019 @ 4:14am 
@Babbayega answer 1 (1/1):

On i could see the need to be able to designate the rotor, the down, the outward, and the drill groups to use. For a stand alone unit, this works great. but if i was to limit the arc and attach it to a base with conveyors, i could see it messing with other pistons.

This should not be an issue as the script DOES use specific names for the rotor, drills group, piston groups; They are set as variables at the top of the script and can easily be adapted.
string DrillRotor = "Rotor";
string Pistongroup1name = "down";
string Pistongroup2name = "outward";
string Drillgroupname = "drills";

Babbayega 23 Sep, 2019 @ 6:56pm 
i assume the PB knows the current position of the pistons. maybe an error check to see if the piston actually moved as expected might not be a bad idea. Just a thought.
Babbayega 23 Sep, 2019 @ 6:54pm 
i could see the need to be able to designate the rotor, the down, the outward, and the drill groups to use. For a stand alone unit, this works great. but if i was to limit the arc and attach it to a base with conveyors, i could see it messing with other pistons.

but it works as indicated very well.
Babbayega 23 Sep, 2019 @ 6:26pm 
I am happy to say that the outward pistons now work. i didn't do anything beyond update the script. of course a game reload was involved and all. Well, i did have to repair some parts of it with a welder. a meany NPC was taking pop shots at it...
Babbayega 23 Sep, 2019 @ 3:33pm 
I used it as is. I watched while all the vertical group one pistons extended, and there was just a pause after they retracted. I assume that was when it should have moved out 5M. then the first group repeated, etc. so everything worked fine, expect the outward group. the LCD showed that it found the rotor and both piston groups.

I will try the updated script and see how it goes. This is by far the best and most stable auto driller i have seen yet.
KristofDeRaver  [author] 23 Sep, 2019 @ 1:38pm 
updated to version with script version 1.1
KristofDeRaver  [author] 23 Sep, 2019 @ 5:02am 
@Babbayega 2/2 : I will update the script to provide more detailed info to the user on the actual process, such as the piston being processed and its position and max set. This may help the user in debugging.
Also I found a way to allow to set the min level of the rotor to negative if desired. So you will be able to mine -20 to +20 if needed.

A way to test your issue fast is to put only one piston of each group into the group names, then use "reset". Then use "stop" to halt the drill if needed. Now set the MAX of the extend piston to 9,5m and give it some positive velocity to have it move out. Wait for it to finish. Now use "start" (not reset). Your drill will reach the full extend soon and you can check if the other piston will be used now.

Feel free to share your build if you want me to have a look. I hope that I can solve it with you.

KristofDeRaver  [author] 23 Sep, 2019 @ 5:02am 
@Babbayega Some stupid questions to rule out some things:

1. Did you use the demo build "as is" , or did you modify it.
2. Did all pistons from group 1 extend to max already when you expect the down group to extend ? They only extend when all the extend ones are done 100%. The extend ones should then first retract even.
3. Is the LCD showing the 2 groups of piston as found and is the count correct ?
4. Check ownership off all blocks, I don't think that is an issue, but check maybe.

The min and max of pistons are controlled by the script and set to the correct values at the moment they need to move only. They are all set to 0 at the reset. So that is no issue.
Share inertia I tend to set on to prevent shaking. Should not be an issue.


Babbayega 22 Sep, 2019 @ 4:45pm 
I do see that the outward pistons don;t have a min/max distance set, so I assume thats why they are not moving. the min/max is being set on the down group of pistons.

Suggestions on why this would not be being set by the PB?
Babbayega 22 Sep, 2019 @ 4:43pm 
hmm, i really like the demo. I have a question though. The pistons in the down group extend as indicated, but the outward group doesn't move. i check that enough force is applied. I see that shared inertia is on, is that an issue?
KristofDeRaver  [author] 21 Sep, 2019 @ 6:29am 
Setup info of the script is available in the linked script mentioned above.
You can check the setup instructions to find out how you can adapt this demo build if you want.
Also the commands you can use are listed.