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


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Nexarius

  1. 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.
  2. 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?
  3. 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.
  4. 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.
  5. 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
  6. 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.
  7. Oh^^ The stargate interface has to be under the stargate not under the power supply.
  8. The computer has to activate each chevron individually and if you start the update everything else gets disabled even the dialing sequence. Just don't update the dialing computer while it's dialing the gate. (I should probably not allow updating while dialing)
  9. Okay thanks for the reports. I reverted the last update so it should be back to normal.
  10. I have the same versions and it works. I changed something (but I can't test it) so try version 3.6.8.
  11. Which version of the mod is installed? That error should only come when the stargate multiblock is not complete or similar.
  12. The modem_message event also gives you the component address of the sending card. You could use that. You could also give each computer an id and have the computer send that on every message.
  13. You can update to 3.6.6 3.6.7 and see it. Btw its "Glyph 1" without the "-". I think you can already use the green redstone signal for that.
  14. Are you sure you connected the cable to the correct side? I think it was "right from the computer perspective" so basically the left side when you are standing from the front (or something weird like that). Try bottom or up they are never mixed up
  15. The redstone output only works with bundled cables. You need project red or something similar that's compatible. Then bunbled cable into the computer case -> orange cable -> redstone wire. Cool but sadly it's too large. It cannot be larger than 32x16 with 32 width and 16 high and yours is 35 high.
  16. The stargate status monitor does work for Universe gates only the chevrons don't. I need 32x16 ASCII art of all the universe chevrons to make it work and I don't know how to do that. I'll look into adding the redstone output. It should be fairly easy.
  17. Everything looks alright... It should work. Can you send me your save + the mods?
  18. Could you make a video showing how it doesn't work because it doesn't make sense to me right now.
  19. I've just checked if I broke anything when I added AUNIS support but it works with sgcraft gate just as good as before. Did you perhaps enter a wrong stargate address? Can you check for errors?
  • Create New...

Important Information

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