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

Nexarius

Members
  • Content Count

    164
  • Joined

  • Last visited

  • Days Won

    19

Nexarius last won the day on June 25

Nexarius had the most liked content!

1 Follower

About Nexarius

  • Rank
    Leading Member

Recent Profile Visitors

1774 profile views
  1. Yes it works with the milkyway gate. Have fun with that
  2. It's already checking for the lowest number of chevrons in any given address and using that.
  3. Wait what? How? You did what? But can it run modded minecraft? How deep is the rabbit hole?
  4. Are you using CptMercury script or mine? I guess it crashes because it doesn't know the depleted versions of the fuel rods. Try to change this: gp.set(x, y, reaktor_symbole[item[5]]) to this: gp.set(x, y, reaktor_symbole[item[5] or "█"]) Or in his script this: table.insert(sorted_by_color[color], {i, component_symbol[item.name]}) to this: table.insert(sorted_by_color[color], {i, component_symbol[item.name] or "█"}) and / or add the name to the component table with a new symbol.
  5. Is the wireless signal strenght enough to reach the second microcontroller?
  6. Try this: local component = require("component") local computer = require("computer") local term = require("term") local aw = require("adWrite") local ic = component.inventory_controller local gp = component.gpu local rc = component.reactor_chamber --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) local w = gp.getResolution() term.setCursor((w - #str)/2, row) term.write(str) end gp.setResolution(85, 27) term.clear() term.setCursor(1, 1) local INVENTORY_SIDE for i = 0, 5 do if ic.getInventorySize(i) then INVENTORY_SIDE = i break end end local anzahl_slots = ic.getInventorySize(INVENTORY_SIDE) local reaktor_symbole = { ["ic2:overclocked_heat_vent"] = "X", ["ic2:component_heat_vent"] = "O", ["ic2:quad_uranium_fuel_rod"] = "U", ["ic2:component_heat_exchanger"] = "W" } local dmg_colors = {[0] = "0x008421", "0x00FF00", "0xFFFF00", "0xFFA800", "0xFF6D00", "0xFF3A00", "0xFF2B00", "0xFF2B00", "0xFF0000" } local rc_status_text = {[0] = "<color fg=" .. dmg_colors[1] .. ">Alles OK </color>", "<color fg=" .. dmg_colors[2] .. ">Warm </color>", "<color fg=" .. dmg_colors[3] .. ">Sehr Warm </color>", "<color fg=" .. dmg_colors[5] .. ">Sehr Heiß </color>", "<color fg=" .. dmg_colors[8] .. ">ACHTUNG KERNSCHMELZE STEHT BEVOR!</color>" } local function getDuri(slot) local item = ic.getStackInSlot(INVENTORY_SIDE, slot) if not item then return {nil} end local dmg = item.damage local maxdmg = item.maxDamage local name = item.name local prozent = math.ceil(dmg / maxdmg * 8) local dmgColor = dmg_colors[prozent] or dmg_colors[0] return {item, dmg, maxdmg, dmgColor, name} end local function makepadding(text, max) return string.rep(" ", max - #tostring(text)) end gp.setBackground(colors.black) 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(2, 8) gp.setForeground(colors.cyan) centerF(9, "Komponenten") gp.setForeground(colors.white) 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") while true do local rcHeat = rc.getHeat() local rcMaxHeat = rc.getMaxHeat() local rcProzent = math.ceil(rcHeat / rcMaxHeat * 4) local rcStatus = rc_status_text[rcProzent] 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 local x = 38 local y = 10 local uran_zahl = 1 local ausgabe_uran = "" for slot = 1, anzahl_slots do -- Reaktor Komponenten anzeigen local item = getDuri(slot) if item[1] then gp.setForeground(tonumber(item[4])) gp.set(x, y, reaktor_symbole[item[5]]) if item[5] == "ic2:quad_uranium_fuel_rod" then -- Brennstäbe Ausgabe erstellen if ausgabe_uran ~= "" and uran_zahl ~= 5 then ausgabe_uran = ausgabe_uran .. " | " elseif uran_zahl == 5 then ausgabe_uran = ausgabe_uran .. "\n " end ausgabe_uran = string.format("%s%s: <color fg=%s>%s%d</color>/%d", ausgabe_uran, uran_zahl, item[4], makepadding(item[2], 5), item[2], item[3]) uran_zahl = uran_zahl + 1 end else gp.set(x, y, " ") end x = x + 1 if x > 46 then -- nächste Zeile x = 38 y = y + 1 end end term.setCursor(9, 7) gp.setForeground(colors.white) aw.write(ausgabe_uran) os.sleep(1) end
  7. Ah yes of course oopps This here: local makepadding(text, max) of course has to be: local function makepadding(text, max) It's also probably better if you try: local ic = component.getPrimary("inventory_controller") instead of: local ic = component.proxy(component.get("2a60f6e0")) if you want to use the program in the future in a new computer and don't want to change all the component addresses. As long as you don't want to access 2 of the same component type you don't need to do it with component.proxy.
  8. I've made some improvements. Its combined with a single function and they are called from a loop and the results are then stored in a table. It doesn't matter that they have differente maxdmg values because you have the dmg and the maxdmg and can easily calculate the percentage. Have fun with it. local component = require("component") local computer = require("computer") local term = require("term") local aw = require("adWrite") local gp = component.proxy(component.get("6fa6e9ed")) local rc = component.proxy(component.get("c3f546da")) local ic = component.proxy(component.get("2a60f6e0")) 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, ...) term.setCursor(spalte, zeile) aw.write(...) end function centerF(row, msg, ...) local mLen = string.len(msg) w, h = gp.getResolution() term.setCursor((w - mLen)/2, row) print(msg:format(...)) end gp.setResolution(67, 24) term.clear() term.setCursor(1 ,1) local function getDuri(slot) local vari = ic.getStackInSlot(3, slot) local dmg = vari.damage local maxdmg = vari.maxDamage local dmgColor = "0xFFFFFF" local prozent = dmg / maxdmg if prozent <= 0 then dmgColor = "0x008421" elseif prozent < 12.5 then dmgColor = "0x00FF00" elseif prozent < 25 then dmgColor = "0xFFFF00" elseif prozent < 37.5 then dmgColor = "0xFFA800" elseif prozent < 50 then dmgColor = "0xFF6D00" elseif prozent < 62.5 then dmgColor = "0xFF3A00" elseif prozent < 75 then dmgColor = "0xFF2B00" elseif prozent < 87.5 then dmgColor = "0xFF0000" else dmgColor = "0x970000" end return {vari, dmg, maxdmg, dmgColor} end local makepadding(text, max) -- return empty charaters with max length but minus the lenght of the text / number input local lang = string.len(tostring(text)) - max if lang < 0 then return "" else return string.rep(" ", lang) end end while true do gp.setBackground(colors.black) local UH = {} -- this table is for all UH for _, slot in pairs({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}) do -- go over all slots table.insert(UH, getDuri(slot)) -- filling the table end local KW = {} for _, slot in pairs({10, 11, 13, 14, 15, 17, 18, 37, 38, 40, 41, 42, 44, 45}) do table.insert(KW, getDuri(slot)) end local BS = {} for _, slot in pairs({21, 25, 30, 34}) do table.insert(UH, getDuri(slot)) end gp.setForeground(colors.orange) centerF(2, string.rep("-", 51)) centerF(3, "----- Atomreaktor -----") centerF(4, string.rep("-", 51)) gp.setForeground(colors.green) centerF(6, string.format("Brennstäbe")) local BS1S = makepadding(BS[1][2], 7) --BS[1][2] access first entry and then the 2 value (which is dmg) local BS2S = makepadding(BS[2][2], 7) -- I hope I understood correctly how those values are generated local BS3S = makepadding(BS[3][2], 7) local BS4S = makepadding(BS[4][2], 7) term.setCursor(2, 7) aw.write(string.format("1:" ..BS1S.. "<color fg=" ..BS1C.. ">" ..BS1D.. "</color>/" ..BS1MD.. " | 2:" ..BS2S.. "<color fg=" ..BS2C.. ">" ..BS2D.. "</color>/" ..BS2MD.. " | 3:" ..BS3S.. "<color fg=" ..BS3C.. ">" ..BS3D.. "</color>/" ..BS3MD)) os.sleep(1) end Btw what's with those <color> tags?
  9. The variables are NOT declared. You are calling those functions with undeclared variables which basically means you give it "nil". I recommend you change this: getDuriUH( UH01, 1, UH01D, UH01MD, UH01C ) to this: local UH01, UH01D, UH01MD, UH01C = getDuriUH(1) and this: function getDuriUH(uhvari, uhslot, uhdmg, uhmaxdmg, uhdmgColor) local uhvari = ic.getStackInSlot(3, uhslot) local uhdmg = uhvari.damage local uhmaxdmg = uhvari.maxDamage local uhdmgColor = "0xFFFFFF" if uhdmg == 0 then uhdmgColor = "0x008421" elseif uhdmg > 0 and uhdmg < 125 then uhdmgColor = "0x00FF00" elseif uhdmg >= 125 and uhdmg < 250 then uhdmgColor = "0xFFFF00" elseif uhdmg >= 250 and uhdmg < 375 then uhdmgColor = "0xFFA800" elseif uhdmg >= 375 and uhdmg < 500 then uhdmgColor = "0xFF6D00" elseif uhdmg >= 500 and uhdmg < 625 then uhdmgColor = "0xFF3A00" elseif uhdmg >= 625 and uhdmg < 750 then uhdmgColor = "0xFF2B00" elseif uhdmg >= 750 and uhdmg < 875 then uhdmgColor = "0xFF0000" elseif uhdmg >= 825 and uhdmg < 1000 then uhdmgColor = "0x970000" end end to this: local function getDuriUH(uhslot) local uhvari = ic.getStackInSlot(3, uhslot) local uhdmg = uhvari.damage local uhmaxdmg = uhvari.maxDamage local uhdmgColor = "0xFFFFFF" if uhdmg <= 0 then uhdmgColor = "0x008421" elseif uhdmg < 125 then uhdmgColor = "0x00FF00" elseif uhdmg < 250 then uhdmgColor = "0xFFFF00" elseif uhdmg < 375 then uhdmgColor = "0xFFA800" elseif uhdmg < 500 then uhdmgColor = "0xFF6D00" elseif uhdmg < 625 then uhdmgColor = "0xFF3A00" elseif uhdmg < 750 then uhdmgColor = "0xFF2B00" elseif uhdmg < 875 then uhdmgColor = "0xFF0000" elseif uhdmg < 1000 then uhdmgColor = "0x970000" end return uhvari, uhdmg, uhmaxdmg, uhdmgColor end Have you noticed how getDuriUH(), getDuriKW() and getDuriBS() are the same? You could just make them into 1 function and then divide the damage for KW by 5 and for BS by 20. But seriously those 50 lines were you basically just call the same function with a different interger... use a loop and a table.
  10. You could make a function and call it with pcall(). local i = 0 local function main() print("it still works", i) i = i + 1 os.sleep(1) end while true do pcall(main) end If someone interrupts the program it will only go back to the pcall line and the while loop restarts it immediently.
  11. He said if he or his friends are around. Your code needs some changes for that. local door = require("component").os_door local rfid = require("component").os_rfidreader local authorized = { "johnsmith" = true, "johnsmith_friend_1" = true, "johnsmith_friend_2" = true } while true do local scan = rfid.scan() local shouldOpen = false for _, player in ipairs(scan) do if authorized[player.name] then shouldOpen = true break end end if shouldOpen then door.open() else door.close() end os.sleep(1) end
  12. I don't know securitycraft or opensecurity but you can put a redstone card into the computer and get a redstone signal on incoming wormholes.
×
×
  • Create New...

Important Information

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