Author Topic: Graphical Core Monitoring E2  (Read 9179 times)

bloxgate

  • Supreme Forum Overlord
  • Administrator
  • Hero Member
  • ******
  • Posts: 546
  • Karma: +50/-4
    • View Profile
    • Bloxgate's Website
  • IGN: bloxgate
Graphical Core Monitoring E2
« on: September 26, 2015, 01:58:20 pm »
Ever wanted a quick and easy way to tell your core's stats? Well now you can with the Bloxgate Graphical Core Monitoring E2! Simply connect the chip to your core and an EGP screen via the 2 wirelink inputs.


Code for copying:

E2 Editon (Core_Monitoring.txt)
Code: [Select]

@name Core Monitoring
@inputs Egp:wirelink Core:wirelink
@outputs Condition Health Shield Armor Cap
@persist Health Shield Armor Cap
@trigger


Health = Core["% Hull", number]
Shield = Core["% Shield", number]
Armor = Core["% Armor", number]
Cap = Core["% Capacitor", number]


if(first() || dupefinished()){
    Egp:egpClear()
    Health = Core["% Hull", number]
    Shield = Core["% Shield", number]
    Armor = Core["% Armor", number]
    Cap = Core["% Capacitor", number]
   
    Egp:egpResolution(vec2(0,0), vec2(100,100))
   
    Egp:egpBox(1, vec2(50,0), vec2(100, 20))
    Egp:egpColor(1, vec4(0,255,0,50))
    Egp:egpText(2, "Core Status", vec2(50 - "Core Status":length(), 0))
   
    Egp:egpBoxOutline(3, vec2(50,20), vec2(90,10))
    Egp:egpBoxOutline(4, vec2(50,40), vec2(90,10))
    Egp:egpBoxOutline(5, vec2(50,60), vec2(90,10))
    Egp:egpBoxOutline(6, vec2(50,80), vec2(90,10))
   
    Egp:egpBox(7, vec2(50,20), vec2(89 * (Shield/100), 9))
    Egp:egpBox(8, vec2(50,40), vec2(89 * (Armor/100), 9))
    Egp:egpBox(9, vec2(50,60), vec2(89 * (Health/100), 9))
    Egp:egpBox(10, vec2(50,80), vec2(89 * (Cap/100), 9))
   
    Egp:egpColor(7, vec4(0,255,0,50))
    Egp:egpColor(8, vec4(0,255,0,50))
    Egp:egpColor(9, vec4(0,255,0,50))
    Egp:egpColor(10, vec4(0,255,0,50))
   
    Egp:egpText(11, "  Shields: " + Shield, vec2(50 - "  Shields: ":length(), 19))
    Egp:egpText(12, "    Armor: " + Armor, vec2(50 - "    Armor: ":length(), 39))
    Egp:egpText(13, "     Hull: " + Health, vec2(50 - "     Hull: ":length(), 59))
    Egp:egpText(14, "Capacitor: " + Cap, vec2(50 - "Capactior: ":length(), 79))
}


runOnTick(1)
if(changed(Shield) || changed(Armor) || changed(Health) || changed(Cap)){
    Egp:egpSize(7, vec2(89 * (Shield/100), 9))
    Egp:egpSize(8, vec2(89 * (Armor/100), 9))
    Egp:egpSize(9, vec2(89 * (Health/100), 9))
    Egp:egpSize(10, vec2(89 * (Cap/100), 9))
   
    Egp:egpSetText(11, "  Shields: " + Shield)
    Egp:egpSetText(12, "    Armor: " + Armor)
    Egp:egpSetText(13, "     Hull: " + Health)
    Egp:egpSetText(14, "Capacitor: " + Cap)
   
    if(Shield < 75){
        if(Shield < 50){
            Egp:egpColor(7, vec4(255,0,0,50))
        } else {
            Egp:egpColor(7, vec4(0,255,255,50))
        }
    } else { Egp:egpColor(7, vec4(0,255,0,50)) }
    if(Armor < 75){
        if(Armor < 50){
            Egp:egpColor(8, vec4(255,0,0,50))
        } else {
            Egp:egpColor(8, vec4(0,255,255,50))
        }
    } else { Egp:egpColor(8, vec4(0,255,0,50)) }
    if(Health < 75){
        if(Health < 50){
            Egp:egpColor(9, vec4(255,0,0,50))
        } else {
            Egp:egpColor(9, vec4(0,255,255,50))
        }
    } else { Egp:egpColor(9, vec4(0,255,0,50))}
    if(Cap < 75){
        if(Cap < 50){
            Egp:egpColor(10, vec4(255,0,0,50))
        } else {
            Egp:egpColor(10, vec4(0,255,255,50))
        }
    } else { Egp:egpColor(10, vec4(0,255,0,50)) }
   
    if(Shield < 75 || Armor < 75 || Health < 75 || Cap < 75){
        if(Shield < 50 || Armor < 50 || Health < 50 || Cap < 50){
            Condition = 2
        } else {
            Condition = 1
        }
    }
}

ExpAdv2 Edition (Bloxgates_Core_Monitor.txt)
This file has been attached, as ExpAdv2 code contains ASCII control codes that I can not reliably copy to the forums.
« Last Edit: August 11, 2017, 09:48:08 am by bloxgate »

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Graphical Core Monitoring E2
« Reply #1 on: September 26, 2015, 09:27:23 pm »
Very nice!