Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Leutech

Members
  • Content Count

    22
  • Joined

  • Last visited

About Leutech

  • Rank
    Junior Member

Contact Methods

  • Minecraft
    Leutech
  • GitHub
    Leutech
  1. But now the script errored after the uranium is depleted
  2. Okay i thank you very much CptMercury it works completly^^.
  3. Ok i have test it and it works but i don't see the damage and maxdamage of each fuel rod.
  4. So i have it now but if i execute the script he says me this error: And the script looks now: local component = require("component") local computer = require("computer") local term = require("term") local aw = require("adWrite") local ic = component.inventory_controller local gp = component.proxy(component.get("6fa6e9ed")) local rc = component.proxy(component.get("c3f546da")) local tr = component.proxy(component.get("7621f0f8")) local rslamps = component.proxy(component.get("61d91131")) local rsreactor = component.proxy(component.get("a0a9b4d3")) local colors = { green = 0x00FF00, yellow = 0xFFFF00, orange = 0xFFA800, black = 0x000000, white = 0xFFFFFF, red = 0xFF0000, blue = 0x0000FF, cyan = 0x00FFFF } function write(zeile, spalte, str) term.setCursor(spalte, zeile) aw.write(str) end function centerF(row, str) w = gp.getResolution() term.setCursor((w - #str)/2, row) term.write(str) end gp.setResolution(85, 27) term.clear() term.setCursor(1 ,1) local dmg_colors = {[0] = "0x008421", "0x00FF00", "0xFFFF00", "0xFFA800", "0xFF6D00", "0xFF3A00", "0xFF2B00", "0xFF2B00", "0xFF0000" } local function getDuri(slot) local item = ic.getStackInSlot(3, slot) local dmg = item.damage local maxdmg = item.maxDamage local prozent = math.ceil(dmg / maxdmg * 8) local dmgColor = dmg_colors[prozent] return {item, dmg, maxdmg, dmgColor} end local function makepadding(text, max) return string.rep(" ", #tostring(text) - max) end local UH_slots = { 1, 2, 4, 5, 6, 8, 9, 12, 16, 19, 20, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 39, 43, 46, 47, 49, 50, 51, 53, 54 } local KW_slots = { 10, 11, 13, 14, 15, 17, 18, 37, 38, 40, 41, 42, 44, 45 } local BS_slots = { 21, 25, 30, 34 } while true do gp.setBackground(colors.black) local UH = {} for i, slot in ipairs(UH_slots) do UH[i] = getDuri(slot) end local KW = {} for i, slot in ipairs(KW_slots) do KW[i] = getDuri(slot) end local BS = {} for i, slot in ipairs(BS_slots) do BS[i] = getDuri(slot) end local line = string.rep("-", 51) gp.setForeground(colors.orange) centerF(2, line) centerF(3, "----- Atomreaktor -----") centerF(4,line) gp.setForeground(colors.green) centerF(6, "Brennstäbe") term.setCursor(9, 7) gp.setForeground(colors.white) local str = string.format( "1: <color fg=%d>%d</color>/%d | 2: <color fg=%d>%d</color>/%d | 3: <color fg=%d>%d</color>/%d | 4: <color fg=%d>%d</color>/%d", BS[1][4], BS[1][2], BS[1][3], BS[2][4], BS[2][2], BS[2][3], BS[3][4], BS[3][2], BS[3][3], BS[4][4], BS[4][2], BS[4][3] ) aw.write(str) term.setCursor(2, 8) gp.setForeground(colors.cyan) centerF(9, "Komponenten") gp.setForeground(colors.white) local str1 = string.format( "<color fg=%d>X</color><color fg=%d>X</color>O<color fg=%d>X</color><color fg=%d>X</color><color fg=%d>X</color>O<color fg=%d>X</color><color fg=%d>X</color>", UH[1][4], UH[2][4], UH[3][4], UH[4][4], UH[5][4], UH[6][4], UH[7][4] ) local str2 = string.format( "<color fg=%d>W</color><color fg=%d>W</color><color fg=%d>X</color><color fg=%d>W</color><color fg=%d>W</color><color fg=%d>W</color><color fg=%d>X</color><color fg=%d>W</color><color fg=%d>W</color>", KW[1][4], KW[2][4], UH[8][4], KW[3][4], KW[4][4], KW[5][4], UH[9][4], KW[6][4], KW[7][4] ) local str3 = string.format( "<color fg=%d>X</color><color fg=%d>X</color><color fg=%d>U</color><color fg=%d>X</color><color fg=%d>X</color><color fg=%d>X</color><color fg=%d>U</color><color fg=%d>X</color><color fg=%d>X</color>", UH[10][4], UH[11][4], BS[1][4], UH[12][4], UH[13][4], UH[14][4], BS[2][4], UH[15][4], UH[16][4] ) local str4 = string.format( "<color fg=%d>X</color><color fg=%d>X</color><color fg=%d>U</color><color fg=%d>X</color><color fg=%d>X</color><color fg=%d>X</color><color fg=%d>U</color><color fg=%d>X</color><color fg=%d>X</color>", UH[17][4], UH[18][4], BS[3][4], UH[19][4], UH[20][4], UH[21][4], BS[4][4], UH[22][4], UH[23][4] ) local str5 = string.format( "<color fg=%d>W</color><color fg=%d>W</color><color fg=%d>X</color><color fg=%d>W</color><color fg=%d>W</color><color fg=%d>W</color><color fg=%d>X</color><color fg=%d>W</color><color fg=%d>W</color>", KW[8][4], KW[9][4], UH[24][4], KW[10][4], KW[11][4], KW[12][4], UH[25][4], KW[13][4], KW[14][4] ) local str6 = string.format( "<color fg=%d>X</color><color fg=%d>X</color>O<color fg=%d>X</color><color fg=%d>X</color><color fg=%d>X</color>O<color fg=%d>X</color><color fg=%d>X</color>", UH[26][4], UH[27][4], UH[28][4], UH[29][4], UH[30][4], UH[31][4], UH[32][4] ) term.setCursor(38, 10) aw.write(str1) term.setCursor(38, 11) aw.write(str2) term.setCursor(38, 12) aw.write(str3) term.setCursor(38, 13) aw.write(str4) term.setCursor(38, 14) aw.write(str5) term.setCursor(38, 15) aw.write(str6) term.setCursor(1, 16) gp.setForeground(colors.yellow) centerF(17, "Legende") term.setCursor(1, 18) gp.setForeground(colors.white) term.setCursor(20, 18) aw.write("X = Übertakter Hitzeabzug") term.setCursor(20, 19) aw.write("O = Komponenten-Hitzeabzug") term.setCursor(20, 20) aw.write("U = Vierfach-Brennstab (Uran)") term.setCursor(20, 21) aw.write("W = Komponenten-Wärmetauscher") local rcHeat = rc.getHeat() local rcMaxHeat = rc.getMaxHeat() local rcProzent = math.ceil(rcHeat / rcMaxHeat * 4) local rcStatus = "" if rcProzent == 0 then rcStatus = "<color fg=0x00FF00>Alles OK </color>" -- rsreactor.setOutput(3, 20) elseif rcProzent == 1 then rcStatus = "<color fg=0xFFFF00>Warm</color>" elseif rcProzent == 2 then rcStatus = "<color fg=0xFFA800>Sehr Warm</color>" elseif rcProzent == 3 then rcStatus = "<color fg=0xFF3A00>Sehr Heiß</color>" elseif rcProzent == 4 then rcStatus = "<color fg=0xFF0000>ACHTUNG KERNSCHMELZE STEHT BEVOR!</color>" -- rsreactor.setOutput(3, 0) end term.setCursor(30, 23) aw.write("Reaktor Status: " ..rcStatus) local rcOnline = rc.producesEnergy() if rcOnline then term.setCursor(1, 24) gp.setForeground(colors.green) centerF(24, "Online") else term.setCursor(1, 24) gp.setForeground(colors.red) centerF(24, "Offline") end os.sleep(1) end
  5. yes but im test it self with the code you have give me
  6. Yeah i plan to display alle the data and a automatic shutdown for the reactor if his heat to high and the screen should display the current states: "Reactor is running", "Reactor has very high temperature", "WARNING MELTDOWN!" But i plan to display the other components such like this: XXOXXXOXX WWXWWWXWW XXUXXXUXX XXUXXXUXX WWXWWWXWW XXOXXXOXX X = Overclocked Heat Vent W = Component Heat Exchanger U = Quad Fuel Rod (Uranium) O = Component Heat Vent Only in this display the Components: X, W and U should be colored in the state of there damage.
  7. Ok its work now but the damage numbers are not colored. It should be look like this
  8. Okay i have test it but it wont work! In order to inform you The BS1S stands for the space after the "1:" and of course the BS2S for the space after "2:" in the aw.write(.....) thing. And i have send you the original reactor.lua file that ive made at first. reactor.lua
  9. Yeah ok thanks CptMercury i test it later and can you give the original first script, but later because im not at home
  10. Ok thanks i dont habe see this wirh the function i test iz later if i back at home. And yeah i know but its look for me better if i call the component directly over his address. But thanks for the other solution i keep it in mind.
  11. Okay if i want to start the script he says me "/lib/process.lua:52: /home/reactor.lua:72: ')' expected near ',':"
  12. Ok i have a see a mistake from you with the operation to get the percentage if i use this i get always a percentage of 0..... because the damage is never over the maxDamage so i cant do "dmg / maxdmg" i can use only "dmg * 100 / maxdmg" ^^
  13. Okay thanks i will try it and for your question with the "<color>" with him i can do this: The script there i use "adWrite" is from here:
  14. Okay i have test it now and now he print me the correct color code. And can you help me to put the massive things in a loop with one function of the percentage of the maxDamage of the right component?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.