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);
|
||||
int iceamount = getCurrentIceAmount();
|
||||
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) {
|
||||
toggleCollectors(false);
|
||||
|
@ -32,13 +39,6 @@ public void Main(string args) {
|
|||
toggleCollectors(true);
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue