display info in script block
This commit is contained in:
parent
13dab24311
commit
fc9a15e87a
1 changed files with 9 additions and 9 deletions
|
@ -22,8 +22,15 @@ public void Main(string args) {
|
||||||
collectorGroup.GetBlocksOfType(collectors);
|
collectorGroup.GetBlocksOfType(collectors);
|
||||||
int iceamount = getCurrentIceAmount();
|
int iceamount = getCurrentIceAmount();
|
||||||
collectorState = collectors[0].Enabled ? "Active" : "Inactive";
|
collectorState = collectors[0].Enabled ? "Active" : "Inactive";
|
||||||
Echo($"Current Ice Amount: {iceamount}");
|
|
||||||
Echo($"Collectors are {collectorState}");
|
var msg = string.Format("\n\nIce Manager by Firq\n----------------------------\nCurrent Time: {0}\n----------------------------\nCollectors are {1}\nIce Amount: {2}M",
|
||||||
|
DateTime.UtcNow.ToLocalTime().ToLongTimeString(), collectorState, Math.Round((iceamount / 1000000.0), 2));
|
||||||
|
var screen = Me.GetSurface(0);
|
||||||
|
screen.ContentType = ContentType.TEXT_AND_IMAGE;
|
||||||
|
screen.Alignment = TextAlignment.CENTER;
|
||||||
|
|
||||||
|
screen.WriteText(msg, false);
|
||||||
|
Echo(msg);
|
||||||
|
|
||||||
if(iceamount > upperThreshold) {
|
if(iceamount > upperThreshold) {
|
||||||
toggleCollectors(false);
|
toggleCollectors(false);
|
||||||
|
@ -32,13 +39,6 @@ public void Main(string args) {
|
||||||
toggleCollectors(true);
|
toggleCollectors(true);
|
||||||
Echo($"Collectors are ON");
|
Echo($"Collectors are ON");
|
||||||
}
|
}
|
||||||
|
|
||||||
var msg = string.Format("\n\nIce Manager by Firq\n----------------------------\nCurrent Time: {0}\n----------------------------\nCollectors are {1}\nIce Amount: {2}M",
|
|
||||||
DateTime.UtcNow.ToLocalTime().ToLongTimeString(), collectorState, Math.Round((iceamount / 1000000.0), 2));
|
|
||||||
var screen = Me.GetSurface(0);
|
|
||||||
screen.ContentType = ContentType.TEXT_AND_IMAGE;
|
|
||||||
screen.Alignment = TextAlignment.CENTER;
|
|
||||||
screen.WriteText(msg, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentIceAmount() {
|
public int getCurrentIceAmount() {
|
||||||
|
|
Loading…
Reference in a new issue