Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Color> GO_LCD_TextCol = new List<Color>() {
- new Color(255,0,0),
- new Color(0,255,0),
- new Color(255,255,0),
- new Color(255,0,255)
- };
- public Program()
- {
- Runtime.UpdateFrequency = UpdateFrequency.Update1 | UpdateFrequency.Update100;
- }
- long lCount=0;
- public void Main(string argument,UpdateType ut) {
- Echo(ut.ToString());
- Echo(argument);
- if ((ut & (UpdateType.Update1 | UpdateType.Update10 | UpdateType.Update100)) > 0)
- lCount++;
- Echo(lCount.ToString());
- Echo("Before=" + Runtime.UpdateFrequency.ToString());
- doshiz("AirVent03");
- if ((ut & (UpdateType.Terminal | UpdateType.Trigger)) > 0)
- {
- if (argument == "1")
- {
- Runtime.UpdateFrequency |= UpdateFrequency.Update1;
- Echo("Turn On Update1");
- }
- else if (argument == "10")
- {
- Runtime.UpdateFrequency |= UpdateFrequency.Update10;
- Echo("Turn On Update10");
- }
- else if (argument == "100")
- {
- Runtime.UpdateFrequency |= UpdateFrequency.Update100;
- Echo("Turn On Update100");
- }
- else if (argument == "once")
- {
- Runtime.UpdateFrequency |= UpdateFrequency.Once;
- Echo("Turn On Once");
- }
- else if (argument == "none")
- {
- Runtime.UpdateFrequency = UpdateFrequency.None;
- Echo("Set None");
- }
- else if (argument == "!1")
- {
- Runtime.UpdateFrequency &= ~UpdateFrequency.Update1;
- Echo("Turn Off Update1");
- }
- else if (argument == "!10")
- {
- Runtime.UpdateFrequency &= ~UpdateFrequency.Update10;
- Echo("Turn Off Update10");
- }
- else if (argument == "!100")
- {
- Runtime.UpdateFrequency &= ~UpdateFrequency.Update100;
- Echo("Turn Off Update100");
- }
- else if (argument == "!once")
- {
- Runtime.UpdateFrequency &= ~UpdateFrequency.Once;
- Echo("Turn Off Once");
- }
- Echo("After=" + Runtime.UpdateFrequency.ToString());
- }
- }
- /*
- * Set
- */
- public bool doshiz(string whichvent) {
- var vent = GridTerminalSystem.GetBlockWithName( whichvent ) as IMyAirVent;
- var lcd = GridTerminalSystem.GetBlockWithName( "TESTLCD1" ) as IMyTextPanel;
- VentStatus myvent;
- myvent=vent.Status;
- Echo (myvent.ToString());
- if( vent != null & lcd != null ) {
- string outstr;
- outstr=vent.CustomName +" 0utput: "+ (100 * vent.GetOxygenLevel() ).ToString( "#0.00" ) +"%" +"\n Atmosphere: "+ myvent.ToString() ;
- outstr+="\nPSi: "+ ((100 * vent.GetOxygenLevel()) / 6.79).ToString("#0.00");
- SetLCD2( "TESTLCD1", outstr );
- SetLCD2( "TESTLCD2", outstr );
- Echo( "LCD Set" );
- } else {
- Echo( "Block Not Found. Check Names" );
- }
- return false;
- }
- public bool SetLCD2(string mylcd, string mystr) {
- IMyTextSurface surface = GridTerminalSystem.GetBlockWithName(mylcd) as IMyTextSurface;
- if (surface != null)
- {
- Echo("Surface panel found");
- surface.ContentType = ContentType.SCRIPT;
- using (var frame = surface.DrawFrame())
- {
- MySprite test = MySprite.CreateText(mystr, mystr, new Color(1.0f), 1.3f, TextAlignment.CENTER);
- frame.Add(test);
- }
- }
- else
- {
- Echo("No surface panel found");
- }
- return true;
- }
- public bool SetLCD3(string mylcd, string mystr) {
- var console = GridTerminalSystem.GetBlockWithName(mylcd) as IMyTextPanel;
- if (console != null)
- console.WriteText("someWords");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement