Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
The implementation is good however I'd have to wiggle some things around to make it work,
As a general rule for ingame programming GridTerminalSystem Calls are very performance intensive, so Id be reluctant to put them in the Main method where it would be called every 6th tick, instead I'd probably find and cache the batteries in a startup operation,
But thanks for the effort, I'm likely going to release the new one soon, so hold tight until then!
It should be incorperating a lot better feature set too
I knew the code needed refining and optimizing but a quick fix for those who were as desperate as I was helps :) Always difficult modifying someone elses source code though as the styles are completely different to what I am familiar with.
Mine is no exception, being self taught I've tended to adopt some uh, less than conventional bad habits at times, heh,
Either way, sit tight, it should be very soon!
instead of
GridTerminalSystem.GetBlocksOfType<IMyBatteryBlock>(batteries);
I used
GridTerminalSystem.GetBlocksOfType<IMyBatteryBlock>(batteries, b => b.CubeGrid == Me.CubeGrid);
So that it only checks the batteries on the same grid, not on all connected grids.
instead of
BatteryLevel.Val = thisBattery.CurrentStoredPower*100;
I used
BatteryLevel.Val = thisBattery.CurrentStoredPower*100 / thisBattery.MaxStoredPower;
To get the percentage of the battery
And I added the following lines:
//If Low Battery Go And Recharge
if (BatteryLevel.Val<20.00 && ISNOTBURIED.Val)
{
DockingIterator(true, DOCK_ROUTE, GYRO, CONNECTOR, RC);
Echo("Status: Docking To Recharge");
return;
}
to MiningLogic, between
//If Full Go And Free Dock (stage 1)
if (MININGSTATUS.Val == "FULL" && ISNOTBURIED.Val)
{
DockingIterator(true, DOCK_ROUTE, GYRO, CONNECTOR, RC);
Echo("Status: Docking To Offload");
return;
}
and
//If Empty And Docked And Want To Go Mine, Undock (stage 2)
So that it checks the battery while mining and goes back if the battery has less than 20% of the power left
Rdav - If you'd like to create a GitHub repo for it, I'd be more than happy to help with script updates to include some of these ideas in a more configurable and less hard-coded way, so you won't have to do all the work.
I havent played SE in awhile so havent actually tested in a long time if it still works