Space Engineers

Space Engineers

Stone Removal
103 Comments
Leon 19 Jul, 2020 @ 7:16am 
updat
Dots 19 Jul, 2019 @ 11:57am 
this script is soo outdated and obsolete mainly because stone now can officially be used in the survival kit
[✚] Patrick [✚] 11 Jan, 2018 @ 7:55am 
@Reptar Hello, i got a question about your script.
is it possible that if its script related to trow out more than 6.7k stone at a time ?
if not is there a way to go around it ? cause i got like 5 connector ejecting each 6.76k stone a a time and i dont see where to change it or how.

Kind regards
Nagell 2 Jan, 2017 @ 9:53pm 
Awesome, does this work with the latest build?
Topazadam 17 Nov, 2016 @ 1:58pm 
Seems the latest update has bricked (excuse the pun) this. Please fix!
Firedrake_13 26 May, 2016 @ 5:52pm 
works pretty well most of the time, but I catch it not using all ejectors fairly often....not sure why this would be...
W0lf3y 21 Oct, 2015 @ 3:38pm 
ok, Thank You
Reptar  [author] 21 Oct, 2015 @ 2:54pm 
@W0lf3y I might get around to updating it sometime, but by all means you are more than welcome to upload your own.
W0lf3y 21 Oct, 2015 @ 12:42pm 
Hi, I eddited your script to include drills as well. I encountered a situation where it was beneficial.
http://pastebin.com/HSuWJGma is the editted script, link is good for 1 month. If you choose not to update your script, I'd like permission to upload it to my own workshop with citation to origional.
HayateKusoni 18 Sep, 2015 @ 4:54pm 
Hey I dont know if you still update the mod but it throws an error when it I try to use it ( even if I use the unedited version ) and it states " Caught exception during execution of script: Object reference not set to an instance of an object "
Mikel71 5 Jul, 2015 @ 8:53am 
Is there a way to add Iron to the script, to be thrown out as well, currently i run 2 program, but somtimes they get confused taken ore back to the container, so I just turn the timer off when mining. Was just curious. I have used your scripts since you first posted them, Inv sort and Sel Refining as well. So far they have done the best in this catergory, good job
Camulorix 27 May, 2015 @ 1:20am 
Why not add these features to the item sorting script? It's somewhat the same: Sort stone in another inventory :)
xenolego 5 Apr, 2015 @ 10:27pm 
Thank you!
Reptar  [author] 5 Apr, 2015 @ 10:25pm 
@xenolego Sure man, go for it.
Reptar  [author] 5 Apr, 2015 @ 10:25pm 
@Curzon Dax If you remove all the instances where you find Content.ToString().Contains("Ore") (should be like 3 or 4) it will remove stone and gravel instead of just stone.
xenolego 5 Apr, 2015 @ 9:58pm 
Mind if I use a modified version of this script in my workshop ship ? I haven't included the script in the ship yet but was wondering if it would be cool if I modified the script slightly and added it to the ship.
HayateKusoni 5 Apr, 2015 @ 2:15pm 
Hey is there a way to make it eject gravel as well as stone?
se7en 23 Mar, 2015 @ 5:10am 
How could i change this so it will drop for example "stone" only when there is at least "10k gravel" total in containers?
Solirin 12 Mar, 2015 @ 4:56pm 
Thanks for the script. One issue though.

I named my ejectors "Trash" and my timer block "Trash Timer" and the result was an exception, because it tries to use the timer as an ejector.

To fix this, the timer needs to be named something without "trash" in the title.
Anubis 12 Mar, 2015 @ 4:04pm 
I apologize for my English but even so I want to ask you if you can separate script to accelerate Timer Block.
danibw0i 11 Mar, 2015 @ 11:09am 
Ah, thanks for the help :)

[Edit]: My second comment was for kittle, not M4jor P4In
Reptar  [author] 11 Mar, 2015 @ 10:36am 
@danibw0i If you comment out or delete this part of the script, it should stop it from enabling or disabling throw out. It is almost at the very bottom of the script, the last part of the ClearTrash function.

if(!cleared)
{
if ((trash as IMyShipConnector).ThrowOut == true)
(trash as IMyShipConnector).GetActionWithName("ThrowOut").Apply(trash);
}

else if ((trash as IMyShipConnector).ThrowOut == false)
(trash as IMyShipConnector).GetActionWithName("ThrowOut").Apply(trash);
danibw0i 11 Mar, 2015 @ 1:17am 
Thanks for an actual working script on stone removal. None of other ppls scripts made to do this works properly. I was wondering, is it possible for me to edit the script so that it doesn't auto-enable "ThrowOut" on the connectors? Would be nice to have the option to do that manually.

@M4jor P4In: It does pull from the drills, but the u have to enable "Use conveyor system" on the drills. Personally I have that ability on the hotbar to "release" ore into the system when needed.
mar3usmc 4 Mar, 2015 @ 6:01pm 
Sometimes works, sometimes not in that it throws out other ores, even when I have no stone, while I am mining. When I stop mining, it stops throwing out the wrong ore, even though I still have ore in the inventories. Is this a known issue?
M4jorP4In 15 Feb, 2015 @ 8:29am 
Thx for that script. Its working perfect on my drillships. Now i have a question. Can this script be modified to throw out Iron insteed of stone? Because in my singleplayer world im playing i got more than enough iron in my base and while drilling my ships get stuffed with stone and iron and i want to get the iron out too.
kittle 12 Feb, 2015 @ 10:30pm 
This doesnt work with drills...
I use the large drills in my mining ship as storage, and it would be nice to have it pull stone from the drills too.
DarkBlaze 9 Feb, 2015 @ 6:19pm 
I think I may have figured out what's happening. I found Trash Removal X, and it does something similar. I watched the Refinery that had the stone, and it kept disappearing and reappearing. This may have something to do with the conveyors.
DarkBlaze 9 Feb, 2015 @ 5:49pm 
I commented out a lot of the functional code. I brought it down to my refineries because one of them had stone in it. It's erroring out on moving it to the trash.
I have a timer named "TrashTimer" and I have a connector named "TrashBin". I set everything to my ownership to be safe. It seems that it's not kicking the stone over.
Exuvo 5 Feb, 2015 @ 7:03am 
@Evers I also got those errors and i rewrote parts of the code for mining ships and have not gotten any more errors. Can't remember what the actual problem was. Unfortunantely i don't have the even distrubution code in mine. Search for "Stone Disposal" published by Exuvo.
SneezyBoulder 4 Feb, 2015 @ 11:15pm 
Love all your scripts and when combined they are the reason im able to play this game.

this script is the only one ive had trouble with, but that was due to an over full inventory. it threw out a few tons of platinum and silicon before i caught it. luckily i hate silicon its like stone to me.

i wanted to make a suggestion for another script if you have the time, as i cant stay concentrated long enough to read any scripting tutorials. anyways, i want a simlar script to the sorting but i want it to see a priority container so i can set a transfer container on a seperate ship then recieve what i want by naming the container. i cant make this work without changing the names on the sorting script every time or else no sorting occurs while im welding.

do you have a quick change i can make myself or can you make this?
Reptar  [author] 30 Jan, 2015 @ 7:17pm 
@Evers Looking at the code again, I can't think of any reason why you would be getting that exception. Do you have a connector named Trash? Have you edited any of the script yourself?
Evers 25 Jan, 2015 @ 4:35am 
I'm getting "Caught exception during execution of script: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name; index"
when I run the code, any idea why?
Anathor 24 Jan, 2015 @ 5:06am 
Nice work, i use your script with some modification( only affect cargo with a name contains "Trash" for easy docking) for my semi auto drill machine. Thank You for the sharing.
老婆讓我改個名 22 Jan, 2015 @ 9:38pm 
Love this script, saves me tons of efforts
Reptar  [author] 20 Jan, 2015 @ 7:45pm 
It might be the item sorting one pulling it out, you can change the "locked container" in that script to be the same name as your trash to stop it from interfering. That's still weird that it still stops though.
Merpz 20 Jan, 2015 @ 3:56pm 
It still shuts off after like a few mins but now I can restart it by first clicking run on the programmable block and then start on the timer block. Atleast that is a small click to do to get it to work so I'm Happy :). I don't know if it stops after like a certain amount of runs or something. But I had like 12000-15000k stone that needed to be dumped xD
Merpz 20 Jan, 2015 @ 3:18pm 
And now it works! I guess your item sorting, assembly cleaning and refining materials scripts might interfere with it! :) Thanks for the tip! :) <3 your code scripts!!
Merpz 20 Jan, 2015 @ 3:11pm 
Ye your other codes, is that a problem? :O I didn't even think about that! Ill try to turn them off and then I'll post my findings!
Reptar  [author] 20 Jan, 2015 @ 9:08am 
@Merpz hmm that suounds weird.. Are you running any other scripts at the same time?
Merpz 19 Jan, 2015 @ 5:18am 
This code works like 2 minutes then it stops working and starts looping the stone in the connectors invenotries very quick. It stops to throw it out. All your other codes work perfect but this just goes crazy, I have 13 Connectors named Trash 1-13. I am the owner of the blocks and as i said it works for a short while then it stops. I wish i knew why. I have tried to remove the code block and also replaced the timer. Just to make sure. Same deal and after it stopps working the first time that does not change anything.
raymazoida 15 Jan, 2015 @ 6:41am 
Thanks... It's pretty good as it is...haven't done c# in a decade so trying to gently get back into it..... this was the first thing i thought of when the block came out, but I had just started a new world so only just got a large enough miner finished to make this a priority.

So far working very well :)
Reptar  [author] 15 Jan, 2015 @ 6:39am 
For sure, if you need any help with understand the script just let me know. I can throw some comments in there for you :P.
raymazoida 15 Jan, 2015 @ 6:37am 
ah cool! I thought all it was doing was moving the stuff to the connectors to throw out!

I will look through the code again so I can find that bit... thanks :D
Reptar  [author] 15 Jan, 2015 @ 6:35am 
@mrraybaker Not quite sure I am completely understanding you, but the script already sets the connectors to throw out whenever there is stone in them. If the connectors are empty or have anything besides stone in them, the connector will set throw out to off so that it doesn't accidentally throw anything else out, and tries to move whatever else is in there.
raymazoida 15 Jan, 2015 @ 6:30am 
Great stuff.....

Is there a way to set the connectors to "throw out"

If I use a timer to say turn on the connetors, run script (load connectors) then set to throw out the throw out option is an on/off so every other itteration through the timer block would be turning off the eject. Was thinking if I could add this bit to the script I'd be a very happy man :D
Beezil 14 Jan, 2015 @ 11:55pm 
Thank you SOOOOOO much for this script. You sir, are completely awesome.
siremagu 13 Jan, 2015 @ 10:37pm 
nevermind. It was some kind of bug. I ground out of the programming block. And rebuilt it then I loaded the script into it and it worked fine.
siremagu 13 Jan, 2015 @ 10:34pm 
I'm new to in game scripts. I have loaded your script into the block, and tied it to the timer.
The problem I have is that no matter what script I put in from the workshop, the run button is shown as darker than the rest. Am I missing a step to make a program able to be run?
Reptar  [author] 12 Jan, 2015 @ 11:55pm 
@Cryptotech Sounds like you don't have a connector or ejector named Trash, or you're running an older verision of the script and have another block with the name Trash in it.