Space Engineers

Space Engineers

Not enough ratings
Demo Kristofs Lazy Drill script
   
Award
Favorite
Favorited
Unfavorite
Type: Blueprint
Mod category: Exploration
File Size
Posted
Updated
869.120 KB
20 Sep, 2019 @ 6:56am
17 Oct, 2019 @ 11:45am
6 Change Notes ( view )

Subscribe to download
Demo Kristofs Lazy Drill script

Description
This is a build to demonstrate my DRILL SCRIPT https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1867879631
It has the PB on it with the script and all elements are configured according to the variables in the script.
Check the information on the script if you want to make changes or use the script for another drill.

BASIC CONCEPT

Script runs a drill system for you where a rotor makes a turn from min to max and stops.
This turn should/could move a set of drills (group) arround that drill the ore that they touch.
When the turn is done, the pistons of a group1 are extended a bit (the ones where the drills are on usually), and the rotor starts another round from MAX to MIN.

This continues untill all pistons of group1 (downward) are extended 100%.
Then the drill retracts them all.

IF there is a second set of pistons (group2), they are now extended ONE by ONE by the amount set in the variable. And the whole process above is repeated.
This second group could have extended the arm more outward, and now the drills are drilling out an even bigger circle.
All this continues until all pistons1 and 2 are fully used. And you have a nice big hole and a huge pile of ore....


FEATURES:

Define 1 or 2 groups of pistons, and 1 drills group by putting them in a GROUP. You can tell the script to use these group names. You can add or remove pistons and drills from the groups, and the script will work without changes needed. You can adapt the drill,
it will just drill....

The drill uses a ROTOR which you identify with a specific name. You set the minimum and maximum rotation of the drill to determine its range.
You can do 0 to 360, but also 90 to 180, or -90 to 90. This enables you to drill a segment and have conveyors going out at the segment that is not drilled.

AUTO RECOVER : The drill will auto-recover when stuck (no movement when expected) and lift the pistons up until it moves again. This enables it to avoid obstacles, and in combination with "kickstart" let you just start the drill and have it find out when to move up.

KICKSTART : this command moves the drill head down until it touches the ground, and retracts it a bit. The ideal start position is reached. No need to wait for 20 turns before we get ore. In combination with the auto recover that will avoid obstacles left or right in uneven terrain. Important : down pistons should NOT have strength too high (in the red figures), as this will cause the kickstart to push the drill into the ground. No need for high strength as we skim the surface.

As all items are named and/or in groups you define, you can have the drill on a big grid without it interfering with other pistons, rotors, drills.
You can have multiple drills running if each has its own PB with the script and uses different names.

The default variables are in the top of the script, but they are copied to the CUSTOM DATA of the programmable block at its first run. The user can/should change them in the custom data. When the drill is stopped and started, the new variables will be used. If the script is updated and replaced, the custom data will stay and you will not lose your settings. When new variables are added in the script, they will be added into CUSTOM DATA, and the user can change them.

The script will make the ROTOR move faster when the drills do not obtain ore, and slow down when ore is found.
This can be useful if your terrain is not even. You determine this by 2 variables : slow and fast speed. If you don't like the fast movement, set fast to the seem speed as the slow.
The ROTOR goes slow from start, reaches max speed at the middle, and goes to slow at the endpoint to ensure a safe stop moment. If ore is found, it goes slow all the way until no ore is found.

The scripts saves the state when the game is saved and restores the state when loaded. Your drill will continue where it was.

Status LCD screen: HIGHLY recommended to have a WIDE lcd screen with the name specified in custom data. This LCD will display detailed information on the script running.
It will show the state (running, extending, retracting, none (idle), rotor speed and position, pistons per group and their current position.

Next to commands reset, start and stop, which enable you to stop the drills and make changes and start again, or reset when you made bigger changes, there are also commands to manual position the drills.
extend1, extend2, retract1, retract2, retractall can be called and will move the pistons of that group. You can use these commands on a button panel.

The status LCD will show the calculated inventory of the DRILLS. If drills are building up an inventory, this means your not getting the ore out fast enough... It could lead to explosion..
This is a preparation for a future version that enables a user to ask to stop the drilling if the drills are getting full. It could fill your containers and wait until that is processed before continuing.
But for now, we just calculate and show it. so watch it. :)

What can you change in custom data:

[Lazydrill_Settings]
DrillRotor=Rotor Name of the rotor to use
LCD_Name=lazydrills Name of the LCD for info
Pistongroup1name=down Name of the group 1 of pistons (MUST)
Pistongroup2name=outward Name of the group 2 of pistons (OPTIONAL)
Drillgroupname=drills Name of the group of drills
rotorspeed=0.5 Default speed of the rotor when ore is found
rotorspeedfast=2 Fast speed when the drills do not have ore in them (nothing found)
extendamountpiston1=0.5 How much the pistons of group 1 (the ones that push the drill) should extend after each round of the rotor
extendamountpiston2=5 How much for pistons in group 2 (mostly this group will push the arm outward, so they extend by default 5m)
pistonspeed=0.3 How fast should the piston move (do not put faster then your drill can handle when pushed down !)


Current IDEAS for extra features:

1. Stop/Pause the drill when the drills are filled above X %

2. Run the drill with a specific number of rounds to drill. You can run batches of ice mining when you leave. The drill will do 20 rounds and stop.
OR
3. Define a group of containers by name and let the drill stop when they are full?

4. Using a camera on the drill, make it detect how far the "ground" is and move down just above it to start. Maybe even go up and down when going arround to skim the ground level.
Using a sensor was tested and is not fine enough.

5. Detect when the drill is stuck (does not move for X time) and try to correct it by pulling back until it works again.

Big thanks to NomadMonster84 for making this build for my demo.
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.