Space Engineers

Space Engineers

[SCAM] Simple Concurrent Adaptive Min3r
 This topic has been pinned, so it's probably important
cheerkin  [developer] 14 Aug, 2021 @ 1:26pm
Script argument reference
Script argument reference
There are two types of args - command and toggle. Both can be used in CustomData boot sequence and directly by putting them as an argument and hitting Run button on PB.
Toggle flips its' state whenever you execute it.
Commands can also be seen as two general types - set-value and action.

Toggle reference
Pattern: toggle:<name>
Example: toggle:adaptive-mining

Name
Default
Meaning
adaptive-mining
false
If set, drone would analyze what kind of ore it gets and adjust max-depth and skip-depth dynamically. It also would send ban commands to Dispatcher so it would later reject shafts in said direction as being supposedly useless
adjust-entry-by-elevation
true
If set, drone would try to adapot to uneven terrain and get to actual mining quicker
log-message
false
Log IGC communication for debug purposes
show-pstate
false
Show persistent state contents for debug purposes
suppress-transition-control
false
Turn off thrusters
damp-when-idle
true
It's inertia dampening feature of AutoPillock
ignore-user-thruster
false
Ignore user WASD input when controlling drone


Set-value reference
Set-value is a container object representing some key-value pair that can be changed in runtime by script user.

Pattern: command:set-value:<name>:<value>
Example: command:set-value:skip-depth:95

Name
Default
Meaning
depth-limit
80
Max depth where drone stops hoping to get useful resource and skips shaft
max-generations
7
How many circles around initial shaft spot are created in the task
circular-pattern-shaft-radius
3.6
Radius of a shaft, needs to be tuned according to drones used. I use 3.6 for stock small drones, 7.5 for large grid gravity drone
echelon-offset
12
Difference between drone path lanes, needs to be larger than drone height
getAbove-altitude
20
Flat value that is added to pathing, useful when drones need to fly over a wall to docking area
skip-depth
0
Sets initial skip value in meters. Done would disable conv connection to drills so when they are full stone stops getting into drone and gets destroyed by the game. Useful for deep planetary deposits or just volume excavation for base building reasons
preferred-container
Container where to deposit stuff. If not set, it would push items to first available storage
logger-char-limit
5000
Log output to big screen would be roughly capped at this char count
group-constraint
general
When you create task from drone, this value is reported to Dispatcher. It would send mining only drones with matching group. Useful to differ drones like atmo, ion, large grid, etc, and incompatible models
cargo-full-factor
0.8
When cargo is occupied to this level (1 means 100%) drone considers itself full (drills, connector and crates)
battery-low-factor
0.2
Dropping to this level of charge forces drone to stay docked
battery-full-factor
0.8
Gaining this level of charge unblocks drones' departure from connector
gas-low-factor
0.2
Dropping to this level of H2 forces drone to RTB
speed-drill
0.6
Desired speed during drill phase (m/s)
speed-clear
2
Desired mining area traverse speed (m/s)
hold-thrust-on-rotation
true
Don't go full thrust unless oriented in general direction of destination
amp
true
Boost gyroscope rates for more aggressive rotation, useful on combat drones

Action command reference
Pattern: command:<name>:<p1>:<p2>:...:<pN>
Example: command:create-task

Name
Values
Meaning
set-value
name, value
See above
add-gui-controller
Control seat name on Dispatcher
Add controller for GUI in front of main panel
add-panel
LCD name
Add output LCD
add-logger
LCD name
Add logger in addition to PB screen
create-task
Starts mining task. Position drone above desired mining area, run command. Drone would remember its' orientation and Down unit vector would define the direction of mining. This is sent to Dispatcher to inform all active drones with the same group-constraint value
create-task-gps
point-x:point-y:point-z:normal-x:normal-y:normal-z
Starts mining task based on GPS and normal (optional on planets). Normal point should be above entry point, it would define the direction of mining, as if you positioned drone aligned with this vertical. Dispatcer log shows you those points when you create task. This command is supported by Dispatcher only. What Agents are affected is defined by group-constraint value
skip
Abandon current mine shaft and request next one from Dispatcher - use if you thing that current shaft is out of useful ore
set-role
Agent/Dispatcher/Lone
Configures drone mode, without role program won't do anything useful
create-task-raycast
Run while pointing drone or dispatcher camera (AND actively looking through it) to ground where to mine
force-finish
general
Stop and return to base
mine
Run when there is a Dispatcher task already to resume mining (after force-finish, for example) or to add drone that was not taking part in the work for some reason
recall
Use on Dispactcher - halts task and broadcasts force-finish to all drones
static-dock
Sets static dock location, you need to be on top of base connector. For Lone mode with no Dispatcher to handle docking, obviously does not support docking to moving carrier. Run command:static-dock:clear to remove
set-state
State type name
Set autopillock core state, for debug reasons
clear-storage-state
Clears state
halt
Stop drone, release control, disable drills, clear state. Equivalent of GUI Emergency Halt button
save
Saves state to PB storage (done automatically on world save and script recompile)
static-dock-gps
Writes static dock value GPS-formatted into forward-gyro Custom Data
dispatch
Force drone to not give a damn for Dispatcher and proceed where it wants to (if there is a sort of deadlock or problem with a drone that owns section lock)
global
command argument
Broadcasts a command/toggle to all agents via IGC network. E.g.: command:global:command:clear-storage-state
Last edited by cheerkin; 10 May, 2023 @ 2:27pm
< >
Showing 1-15 of 21 comments
pro100tv 16 Aug, 2021 @ 9:31am 
Nice, that is very useful to get 100% out of this script!
chiefben 18 Aug, 2021 @ 2:50am 
Perfect! Thank you very much
cheerkin  [developer] 23 Aug, 2021 @ 12:37pm 
No problem! Updated to reflect 0.9.42
pro100tv 17 Feb, 2022 @ 2:02pm 
skip-depth - that's a huge feature. If I understand correctly there's no need to setup the ejection system as the software will block most of the stone. Saves a lot of weight!
cheerkin  [developer] 17 Feb, 2022 @ 3:20pm 
Yeah, that's correct. And it gets adjusted in adaptive-mode based on depth where they start getting an non-stone ore.
Dashawk 18 Feb, 2022 @ 2:36am 
hi @cheerkin, are you open to putting this in github so that the community can help on the development?
cheerkin  [developer] 18 Feb, 2022 @ 2:41am 
Yup, I could do that later after 1.0. Currently it has a part copied from another script which is under work, so the code is a bit of a mess, and some unfinished stuff.
Sander 12 May, 2022 @ 4:12pm 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
BAKADAKALAKA556 28 Jan, 2023 @ 4:05am 
Is there a way to output the Gui onto the control seat or a cockpit rather than a wide screen?
cheerkin  [developer] 28 Jan, 2023 @ 4:22am 
No. The gui would hardly fit there so I did not bother adapting layout to smaller screens. You just won't be able to read the text.
BAKADAKALAKA556 28 Jan, 2023 @ 4:59am 
Originally posted by cheerkin:
No. The gui would hardly fit there so I did not bother adapting layout to smaller screens. You just won't be able to read the text.
bummer cool script tho what about the flight seat? that one has a big wide screen?
cheerkin  [developer] 28 Jan, 2023 @ 3:11pm 
The amount of info to be displayed needs Wide LCD, no other options.
mr-mcfeely 8 Feb, 2023 @ 6:54pm 
I'm trying to get to some ore beneath Ice, but it hits the stone and goes to the next shaft. Is there a way to push a bit more and get it to go further down? It has maybe 10-15 more meters to hit the gold. Thanks in advance!

Edit: I also currently have the depth-limit as about 150 but the gold is maybe 30 below the surface.
Edit again: I also can't seem to get skip-depth to change. I had a thought to skip the ice depth, but it's always mining it out.
Last edited by mr-mcfeely; 8 Feb, 2023 @ 7:02pm
cheerkin  [developer] 9 Feb, 2023 @ 4:33am 
Current version treats ice like valuable ore (i.e. trash = stone, but not ice). So I don't recommend adaptive mode if you are mining ores beneath ice. Just turn adaptive mining off (so it won't dynamically change skip-depth and max-depth) and set those values explicitly. I plan to add an option to treat ice like stone later at some point.
Rezun 24 Mar, 2023 @ 1:59pm 
Hey, how can I get rid of the drone that has been handshaked but was lost/destroyed? Is there any command so it no longer appears in the UI?

Also, I noticed drones wait for each other. There's only one drone that locks at the same time, while other waits. Is there a way to speed it up?
< >
Showing 1-15 of 21 comments
Per page: 1530 50