├── README.md ├── json-indyhud-v1-0.json ├── json-indyhud-v1-1.json ├── json-indyhud-v1-2.json ├── json-indyhud-v1-3.json ├── json-indyhud-v1-4.json └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 |
2 | 9 | 10 | 11 | 12 | 13 | 20 | [![Forks][forks-shield]][forks-url] 21 | [![Stargazers][stars-shield]][stars-url] 22 | [![Issues][issues-shield]][issues-url] 23 | [![MIT License][license-shield]][license-url] 24 | [![Twitch][twitch-shield]][twitch-url] 25 | 26 | 27 | 28 | 29 |
30 |
31 | 32 |

Indy HUD v1.4 by CodeInfused

33 | 34 |

35 | An augmented reality HUD for managing industry 36 |
37 | Watch a Demo 38 | · 39 | Report Bug 40 |

41 |
42 | 43 | 44 | 45 | 46 | ## About Indy HUD 47 | 48 | This is an augmented reality HUD for tracking states of your industry machines for Dual Universe. This script only requires a single programming board, and can manage all the units on a single core factory. 49 | 50 | _What This HUD Isn't:_ 51 | * Not an automation tool; it cannot start or stop machines 52 | * Not a recipe tool; it will not show recipe trees for items 53 | 54 |

(back to top)

55 | 56 | 57 | 58 | 59 | ## Getting Started 60 | 61 | _This programming board HUD is delivered by "json" import, a feature supported by Dual Universe for custom scripts. You will need to download a file as instructed below to use this HUD._ 62 | 63 | ### File Install 64 | 65 | 1. Click this link to open the json file directly (it will be raw text) [json-indyhud-v1-4.json][download-url] 66 | 2. Select all of the text contents (CTRL+A to select all), and then copy (CTRL+C). 67 | 3. You'll need to place a Programming Board at your factory. This should be a fresh board (or re-placed to clear it). 68 | 4. Right-click the programming board, go to "Advanced" > "Paste Lua Configuration From Clipboard" 69 | 5. After doing "Paste Lua Config", go into build mode. 70 | 6. Link your construct's Core to the programming board. 71 | 7. Link your construct's schematic container to the programming board also. 72 | 73 | That's it! Run the board now and enjoy. 74 | 75 | 76 | 77 | ## Changelog 78 | 79 | ### v1.4 80 | - Added support for Schematic Containers, adding available schematic counts to each industry element 81 | - Added option in Lua Parameters for the startup mode view (0-9) 82 | - New dynamic render range: AR automatically determines max distance to render machines based on active filters, extending the range when less matches are found, and shortening the range if needed for performance. 83 | 84 | ### v1.3 85 | - Added DE and FR language translations for menus and machine states 86 | - Added a 3rd mode for Containers, "full" shows all names within range 87 | - Added a corner highlight on machines that are set to "run forever" 88 | - Improved the foreground highlight of boxes being hovered on 89 | - Improved maintain levels when pending 90 | - Improved max machine load (no limit found yet) 91 | - Minor performance improvement 92 | 93 | ### v1.2 94 | - FIXED: initialization load bug for larger factories 95 | - Improved position of status box 96 | - Improved render performance when maxDist is lower and filters are applied 97 | - Reduced hover hitbox of distant units 98 | - Increased overall opacity 99 | - Added visual distance scaling of mini-boxes 100 | - Added recipe data to status detail view (optional) 101 | - Added containers to machine list (optional) 102 | - Added font size option (in Parameters) 103 | - Added opacity distance option (in Parameters) 104 | 105 | ### v1.1 106 | Improvements to performance for larger factories with hundreds of industry units to help prevent cpu shutdown errors. 107 | 108 | 109 | 110 | ## Usage 111 | 112 | Coming soon. 113 | 114 | 115 | 116 | ## Contact 117 | 118 | _While I do love Dual Universe and its community, I also have very little free time typically. I will try to answer questions via Discord, or if you catch me online on Twitch. But keep in mind this is a free resource, and I've spent a good chunk of time on it, so please be constructive and kind :)_ 119 | 120 | Discord: [Albatross HUD on DU-OSI](https://discord.gg/EThSxMGXBg) 121 | 122 | Twitch: [Watch CodeInfused on Twitch](https://twitch.tv/codeinfused)
123 | _I go online at pretty random times, so if you'd like to catch my streams, just go here and hit Follow_ 124 | 125 |

(back to top)

126 | 127 | 128 | 129 | 130 | ## License 131 | 132 | Distributed under the GNU GPLv3 license. See `LICENSE.txt` for more information. 133 | 134 |

(back to top)

135 | 136 | 137 | 138 | 139 | 140 | 141 | [download-url]: https://github.com/codeinfused/Indy-HUD/raw/main/json-indyhud-v1-4.json 142 | [contributors-shield]: https://img.shields.io/github/contributors/codeinfused/Indy-HUD.svg?style=plastic 143 | [contributors-url]: https://github.com/codeinfused/Indy-HUD/graphs/contributors 144 | [forks-shield]: https://img.shields.io/github/forks/codeinfused/Indy-HUD.svg?style=plastic 145 | [forks-url]: https://github.com/codeinfused/Indy-HUDy/network/members 146 | [stars-shield]: https://img.shields.io/github/stars/codeinfused/Indy-HUD.svg?style=plastic 147 | [stars-url]: https://github.com/codeinfused/Indy-HUD/stargazers 148 | [issues-shield]: https://img.shields.io/github/issues/codeinfused/Indy-HUD.svg?style=plastic 149 | [issues-url]: https://github.com/codeinfused/Indy-HUDy/issues 150 | [license-shield]: https://img.shields.io/github/license/codeinfused/Indy-HUD.svg?style=plastic 151 | [license-url]: https://github.com/codeinfused/Indy-HUD/blob/master/LICENSE.txt 152 | [twitch-shield]: https://img.shields.io/badge/twitch-live-red?logo=twitch&style=social 153 | [twitch-url]: https://twitch.tv/codeinfused 154 | [product-screenshot]: images/screenshot.png 155 | -------------------------------------------------------------------------------- /json-indyhud-v1-0.json: -------------------------------------------------------------------------------- 1 | {"slots":{"0":{"name":"core","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"maxDist = 90 --export: Maximum render distance in meters, 90 recommended\nmaxPerFrame = 400 --export: Units drawn per render frame, 400 max recommended\n\nlocal a,b,c,d,e,f=system.print,string.format,math.floor,math.max,math.min,table.concat;local g=16777216;local function h(i)local j=i.x*Industry.cx;local k=i.y*Industry.cy;local l=i.z*Industry.cz;return j+k+l+Industry.worldPos end;local function m(n)return n==math.huge or n==-math.huge end;local function o(p,q)local r=10^(q or 0)return c(p*r+0.5)/r end;local function s(t)if t==nil or t~=t or t<1 or type(t)~=\"number\"then return\"00:00:00\"end;local u=c(t/3600)t=t-3600*u;local e=c(t/60)t=t-60*e;local v=o(t,0)local w=b(\"%02d:%02d:%02d\",u,e,v)return w end;local function x(y,z)return y.dist .ar-olay{position:fixed; top:0vh; left:0vw; height:100vh; width:100vw;} .indy{ position: absolute; display: block; color: #222; font-size: 0.89vh; opacity: 0.6; width: 18vh; text-transform:uppercase; } .fs-s{font-size:0.85em;} .bg-b .ii{background:#303030; color:#fff;} .grow{flex-grow:1;} .ii-row{display: flex;} .ii{display:inline-block; padding: 0.2rem 0.3rem; margin:0.08rem; margin-left:0; background:#eee;} .ib{border:1px solid #eee; color:#fff;} .ii-dist, .ii-indy{display:inline-block; transform: skew(-15deg); font-weight:900;} .ii-state{color:#fff;} .state-red{background:#892e2e;} .state-green{background:#338f47;} .state-orange{background:#958122;} .ii-tier{color:#fff;} .ii.tier-X{background:#666;} .ii.tier-1{background:#5494f7;} .ii.tier-2{background:#2977ef;} .ii.tier-3{background:#06f;} .ii.tier-4{background:#0152cd;} .ii.tier-5{background:#003991;} .ii-scale{} .ii-name{white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} div.sks{padding:0.4em 0.5em; margin-top:0.5em; background:#3473BA; color:#fff; font-size:1.1em;} .legend{position:absolute; left:2vw; top:34.5vh; background:#fff; opacity:0.85; font-size:0.88vh; color:#222; z-index:999;} .legend h2{font-size:0.91vh; margin:0 0 0.2em 0; padding:0.15em 0.6em; background:#3473BA; color:#fff; font-weight:400;} p{color:#666; font-size:0.95em; padding:0em 0.3em; margin:0.2em 0.6em 0 0.6em; border-left:0.5em solid #3473BA;} ul{list-style:none; margin:0; padding:0.3em 0 0.2em 0;} ul li{margin-bottom:0.3em; padding:0.2em 0.6em;} li strong{background:#555; color:#f1f1f1; padding:0.2em 0.3em; margin-right:0.4em;} li span{background:#e1e1e1; color:#555; padding:0.2em 0.3em; margin-right:0.4em;} .svg{display:inline-block;} svg{width:100%;} svg,.svg{margin:0; padding:0;} li.]]..B.lastFilter..[[{background:#3473BA !important; color:#fff;} ]]..(B.searchActive and\"li.f1{background:#3473BA !important; color:#fff;}\"or\"\")..[[
Infinity Corporation

LUA TAB COMMANDS

TOTAL MACHINES: ]]..B.totalUnits..[[

NOT RENDERED: ]]..B.totalUnrender..[[

Search filters will stack until reset with R

]]..f(B.searches,', ')..[[
]]end;function A.getARxy(B,C)local D=h(C.pos)local t={D.x,D.y,D.z}return library.getPointOnScreen(t)end;function A.sortItems(B)table.sort(B.sortedIndy)end;function A.filter(B,t)if t=='errors'then B.lastFilter='a9'for E,F in ipairs(B.filters)do B.filters[E]=0 end;B.filters[3]=1;B.filters[4]=1;B.filters[5]=1;B.filters[7]=1;B.filters[8]=1 elseif t=='all'then B.lastFilter='r'B.searchActive=false;B.searches={}for E,F in ipairs(B.filters)do B.filters[E]=1 end elseif type(t/1)=='number'then B.lastFilter='a'..t;for E,F in ipairs(B.filters)do B.filters[E]=0 end;B.filters[t/1]=1 end end;function A.find(B,t)B.searchActive=true;local G=t:lower()B.searches[#B.searches+1]=G end;function A.init(B)B.curTime=system.getArkTime()B.worldPos=vec3(construct.getWorldPosition())local H=core.getElementIdList()local I={}local J={}local K=''B.fuelComps={}for E=1,#H,1 do local L={uid=H[E],class=core.getElementClassById(H[E]),state=1,schemLeft=0,unitsDone=0,batchTotal=0,batchLeft=0,maintainTotal=0,maintainDone=0,products={}}if L.class:lower():sub(1,8)=='industry'then L.name=core.getElementNameById(H[E])L.kind=core.getElementDisplayNameById(H[E])L.class=core.getElementClassById(H[E])L.pos=vec3(core.getElementPositionById(H[E]))I['uid'..L.uid]=L else end end;B.elemIndy=I;system.showScreen(1)system.setScreen(\"\")B.Renderer=coroutine.create(B.render)B.Processor=coroutine.create(B.update)B.ready=true end;function A.makeRender(B,C)if not B.ready then return\"\"end;if B.filters[C.state]==0 then return\"\"end;local M=B:getARxy(C)local N=M[2]*100;local O=M[1]*100;if O>90 or O<1 or(N>95 or N<1)then return\"\"end;C.dist=M[3]local P=utils.clamp((75-M[3])/70*1.2,0.7,1.0)local Q=1;Q=100-C.dist*10;local R=\"\"R=(100-C.dist/2-35)/100;local S=78;S=S+55*(maxDist-C.dist)/maxDist;S=S/100;local T='red'if C.state==2 then T='green'end;if C.state==6 or C.state==1 then T='orange'end;local U='X'local P='-'local V=\"No selection\"local W=C.schemLeft and\"SCHEMS: \"..C.schemLeft or\"-\"if C.mainProduct and C.mainProduct.name then U=C.mainProduct.tier;P=C.mainProduct.scale;if P==''or not P then P='-'end;V=C.mainProduct.name end;local X=true;if B.searchActive then for E,G in ipairs(B.searches)do if V==\"No selection\"or V:lower():find(G)==nil and C.kind:lower():find(G)==nil then X=false end end end;if not X then return\"\"end;local Y=false;if N>49 and N<52 and O>48 and O<50 then R=1;Q=300-C.dist*10;Y=true end;local K=\"\"if C.dist<17 or C.dist<=maxDist and Y==true then Q=200-C.dist*10;R=R+0.3;Q=math.floor(Q)local Z=s(C.timeLeft)local _=\"NA\"if C.batchTotal>0 then _=\"BATCHES: \"..C.batchLeft..\" / \"..b(\"%.0f\",C.batchTotal)elseif C.maintainTotal>0 then _=\"MAINTAIN: \"..C.maintainDone..\" / \"..b(\"%.0f\",C.maintainTotal)end;K=[[
]]..b(\"%.0f\",M[3])..[[m
]]..C.name..[[
]]..B.states[C.state]..[[
]]K=K..[[
]]..U..[[
]]..P..[[
]]..V..[[
]].._..[[
]]..W..[[
]]K=K..\"
\"else if C.dist>maxDist then K=\"\"else R=d(R,0.35)K=[[
]]..b(\"%.0f\",M[3])..[[m
]]end end;return K end;function A.compile(B)end;function A.coRender(B)local a0=coroutine.status(B.Renderer)if a0~=\"dead\"then local a1,a2=coroutine.resume(B.Renderer)if a2 then system.print(\"ERROR: \"..a2)end elseif a0==\"dead\"then B.Renderer=coroutine.create(B.render)local a1,a2=coroutine.resume(B.Renderer)end end;function A.render()local B=Industry;B:getCSS()B.renderBlocks={}B.renderBlocks[1]=B.cssBase;local E=1;for a3,C in pairs(B.elemIndy)do local a4=B:makeRender(C)if a4~=\"\"then E=E+1;B.renderBlocks[E]=a4 end;if math.fmod(E,maxPerFrame)==0 then coroutine.yield()end end;local a5=#B.renderBlocks-1;B.totalUnrender=B.totalUnits-a5;local K=table.concat(B.renderBlocks)system.setScreen(K)end;function A.coUpdate(B)local a0=coroutine.status(B.Processor)if a0~=\"dead\"then local a1,a2=coroutine.resume(B.Processor)if a2 then system.print(\"ERROR: \"..a2)end elseif a0==\"dead\"then B.Processor=coroutine.create(B.update)local a1,a2=coroutine.resume(B.Processor)end end;function A.update()local B=Industry;local a6=0;for a7,C in pairs(B.elemIndy)do local a8=core.getElementIndustryInfoById(C.uid)if not a8 then a(C.uid..' had no data')coroutine.yield()else C.state=a8.state;C.schemLeft=a8.schematicsRemaining;C.unitsDone=a8.unitsProduced;C.batchTotal=a8.batchesRequested;C.batchLeft=a8.batchesRemaining;C.maintainTotal=a8.maintainProductAmount;C.maintainDone=a8.currentProductAmount;C.products=a8.currentProducts;C.timeLeft=a8.remainingTime;C.mainProduct={}if C.maintainDone>=g then C.maintainDone=c(C.maintainDone/g)end;if#C.products>0 then C.mainProduct=C.products[1]local a9=system.getItem(C.mainProduct.id)C.mainProduct.name=a9.locDisplayName;C.mainProduct.fullname=a9.displayNameWithSize;C.mainProduct.type=a9.type;C.mainProduct.tier=a9.tier;C.mainProduct.scale=a9.size;C.mainProduct.icon=a9.iconPath;coroutine.yield()end end;a6=a6+1;if#C.products<1 then coroutine.yield()end end;B.totalUnits=a6 end;return A end)()Commands=(function()local A={active=false,label='Listen to Voice',timed=0,lastCMD='',list={show={desc=' [1 to 9, show specific message matches]',fn=function(B,aa)local t=aa[2]Industry:filter(t)end},find={desc=' [search key, find machines or outputs]',fn=function(B,aa)local ab=table.remove(aa,1)local F=table.concat(aa,' ')Industry:find(F)end}}}function A.init(B)B.helps={}for aa,ac in pairs(B.list)do if ac.desc then ac.name=aa;B.helps[#B.helps+1]=aa end end;table.sort(B.helps)end;function A.key(B,ad)local a7=ad:sub(7,8)local type=ad:sub(1,6)if a7=='9'then B:call('show errors')elseif ad=='r'then B:call('show all')elseif type=='option'then B:call('show '..a7)end end;function A.help(B)a('-------------------------')a('- INDY HUD BY CODEINFUSED')a('- COMMANDS')for E,ae in ipairs(B.helps)do a(ae..B.list[ae].desc)end;a('-------------------------')end;function A.call(B,af,ag)local aa={}for C in af:gmatch(\"%S+\")do table.insert(aa,C)end;local t=string.lower(aa[1])if t=='help'then B:help()elseif B.list[t]then B.list[t].fn(B,aa,ag)end end;return A end)()Industry:init()Commands:init()Commands:help()","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"Industry:coUpdate()\nIndustry:coRender()","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"Commands:call(text)","filter":{"args":[{"variable":"*"}],"signature":"onInputText(text)","slotKey":"-4"},"key":"2"},{"code":"if action:sub(1,6)=='option' then\n Commands:key(action)\nelseif action=='speedup' then\n Commands:key('r')\nend","filter":{"args":[{"variable":"*"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"3"}],"methods":[],"events":[]} -------------------------------------------------------------------------------- /json-indyhud-v1-1.json: -------------------------------------------------------------------------------- 1 | {"slots":{"0":{"name":"core","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"maxDist = 90 --export: Maximum render distance in meters.\nmaxPerFrame = 400 --export: Units drawn per render frame. Lower this if you are running other scripts too.\nmaxPerUpdate = 5\ndebugMode = false --export: Show debug data\nlocal a,b,c,d,e,f=system.print,string.format,math.floor,math.max,math.min,table.concat;local g=16777216;local function h(i)local j=i.x*Industry.cx;local k=i.y*Industry.cy;local l=i.z*Industry.cz;return j+k+l+Industry.worldPos end;local function m(n)return n==math.huge or n==-math.huge end;local function o(p,q)local r=10^(q or 0)return c(p*r+0.5)/r end;local function s(t)if t==nil or t~=t or t<1 or type(t)~=\"number\"then return\"00:00:00\"end;local u=c(t/3600)t=t-3600*u;local e=c(t/60)t=t-60*e;local v=o(t,0)local w=b(\"%02d:%02d:%02d\",u,e,v)return w end;local function x(y,z)return y.dist .indy{ position: absolute; display: block; color: #222; font-size: 0.89vh; opacity: 0.7; width: 18vh; text-transform:uppercase; } .fs-s{font-size:0.85em;} .bg-b .ii{background:#303030; color:#fff;} .grow{flex-grow:1;} .ii-row{display: flex;} .ii{display:inline-block; padding: 0.2rem 0.3rem; margin:0.08rem; margin-left:0; background:#eee;} .ib{border:1px solid #eee; color:#fff;} .ii-dist, .ii-indy{display:inline-block; transform: skew(-15deg); font-weight:900;} .ii-state{color:#fff;} .state-red{background:#892e2e;} .state-green{background:#338f47;} .state-orange{background:#958122;} .ii-tier{color:#fff;} .ii.tier-X{background:#666;} .ii.tier-1{background:#5494f7;} .ii.tier-2{background:#2977ef;} .ii.tier-3{background:#06f;} .ii.tier-4{background:#0152cd;} .ii.tier-5{background:#003991;} .ii-scale{} .ii-name{white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} div.sks{padding:0.4em 0.5em; margin-top:0.5em; background:#3473BA; color:#fff; font-size:1.1em;} .legend{position:absolute; left:2vw; top:34.5vh; background:#fff; opacity:0.85; font-size:0.88vh; color:#222; z-index:999;} .legend h2{font-size:0.91vh; margin:0 0 0.2em 0; padding:0.15em 0.6em; background:#3473BA; color:#fff; font-weight:400;} p{color:#666; font-size:0.95em; padding:0em 0.3em; margin:0.2em 0.6em 0 0.6em; border-left:0.5em solid #3473BA;} ul{list-style:none; margin:0; padding:0.3em 0 0.2em 0;} ul li{margin-bottom:0.3em; padding:0.2em 0.6em;} li strong{background:#555; color:#f1f1f1; padding:0.2em 0.3em; margin-right:0.4em;} li span{background:#e1e1e1; color:#555; padding:0.2em 0.3em; margin-right:0.4em;} .svg{display:inline-block;} svg{width:100%;} svg,.svg{margin:0; padding:0;} li.]]..B.lastFilter..[[{background:#3473BA !important; color:#fff;} ]]..(B.searchActive and\"li.f1{background:#3473BA !important; color:#fff;}\"or\"\")..[[
Infinity Corporation
]]if B.ready then B.cssBase=B.cssBase..[[

LUA TAB COMMANDS

TOTAL MACHINES: ]]..B.totalUnits..[[

NOT RENDERED: ]]..B.totalUnrender..[[

]]..(debugMode and\"

CHARACTER COUNT: \"..B.renderSize..\"

\"or\"\")..[[

Search filters will stack until reset with R

  • A:1show 1Stopped
  • A:2show 2Running
  • A:3show 3Miss Ingredients
  • A:4show 4Output Full
  • A:5show 5No Container Link
  • A:6show 6Pending
  • A:7show 7Miss Schematics
  • A:8show 8Server Error Issue
  • A:9show errorsAll Error Codes
  • Rshow allReset All Filters
  • find pureSearch For Output Products
  • find assemblySearch By Machine Type
]]..f(B.searches,', ')..[[
]]else B.cssBase=B.cssBase..[[

LOADING DATA

...

]]end;B.cssBase=B.cssBase..\"
\"end;function A.getARxy(B,C)local D=h(C.pos)local t={D.x,D.y,D.z}return library.getPointOnScreen(t)end;function A.sortItems(B)table.sort(B.sortedIndy)end;function A.filter(B,t)if t=='errors'then B.lastFilter='a9'for E,F in ipairs(B.filters)do B.filters[E]=0 end;B.filters[3]=1;B.filters[4]=1;B.filters[5]=1;B.filters[7]=1;B.filters[8]=1 elseif t=='all'then B.lastFilter='r'B.searchActive=false;B.searches={}for E,F in ipairs(B.filters)do B.filters[E]=1 end elseif type(t/1)=='number'then B.lastFilter='a'..t;for E,F in ipairs(B.filters)do B.filters[E]=0 end;B.filters[t/1]=1 end end;function A.find(B,t)B.searchActive=true;local G=t:lower()B.searches[#B.searches+1]=G end;function A.init(B)B.curTime=system.getArkTime()system.showScreen(1)system.setScreen(\"\")B.ready=false;B.worldPos=vec3(construct.getWorldPosition())B.Initializer=coroutine.create(B.initRun)B.Renderer=coroutine.create(B.render)B.Processor=coroutine.create(B.update)end;function A.coInit(B)local H=coroutine.status(B.Initializer)if H~=\"dead\"then local I,J=coroutine.resume(B.Initializer)if J then a(\"ERROR: \"..J)end end end;function A.initRun()local B=Industry;B.ready=false;local K=core.getElementIdList()local L={}for E=1,#K,1 do local M={uid=K[E],class=core.getElementClassById(K[E]),state=1,schemLeft=0,unitsDone=0,batchTotal=0,batchLeft=0,maintainTotal=0,maintainDone=0,products={}}if M.class:lower():sub(1,8)=='industry'then M.name=core.getElementNameById(K[E])M.kind=core.getElementDisplayNameById(K[E])M.class=core.getElementClassById(K[E])M.pos=vec3(core.getElementPositionById(K[E]))M.body=\"\"M.bodyTiny=\"\"M.dist=200;M.msgColor='orange'L['uid'..M.uid]=M else end end;B.elemIndy=L end;function A.makeBody(B,C)local N='red'if C.state==2 then N='green'end;if C.state==6 or C.state==1 then N='orange'end;C.msgColor=N;local O='X'local P='-'local Q=\"No selection\"local R=C.schemLeft and\"SCHEMS: \"..C.schemLeft or\"-\"if C.mainProduct and C.mainProduct.name then O=C.mainProduct.tier;P=C.mainProduct.scale;if P==''or not P then P='-'end;Q=C.mainProduct.name end;C.productName=Q;local S=\"NA\"if C.batchTotal>0 then S=\"BATCHES: \"..C.batchLeft..\" / \"..b(\"%.0f\",C.batchTotal)elseif C.maintainTotal>0 then S=\"MAINTAIN: \"..C.maintainDone..\" / \"..b(\"%.0f\",C.maintainTotal)end;C.bodyTiny=[[
]]..C.dist..[[m
]]C.body=[[
]]..C.dist..[[m
]]..C.name..[[
]]..B.states[C.state]..[[
]]..O..[[
]]..P..[[
]]..Q..[[
]]..S..[[
]]..R..[[
]]end;function A.makeRender(B,C)if B.filters[C.state]==0 then return\"\"end;local T=B:getARxy(C)local U=T[2]*100;local V=T[1]*100;if V>90 or V<1 or(U>95 or U<1)then return\"\"end;C.dist=b(\"%.0f\",T[3])/1;local W=C.dist;if W>maxDist then return\"\"end;local X=1;X=100-W*10;local Y=\"\"Y=(100-W/2-35)/100;local Q=C.productName;local Z=true;if B.searchActive then for E,G in ipairs(B.searches)do if Q==\"No selection\"or Q:lower():find(G)==nil and C.kind:lower():find(G)==nil then Z=false end end end;if not Z then return\"\"end;local _=false;if U>49 and U<52 and V>48 and V<50 then Y=1;X=300-W*10;_=true end;local a0=\"\"if W<17 or W<=maxDist and _==true then X=200-W*10;Y=Y+0.35;a0=[[
]]..C.body else Y=d(Y,0.45)a0=[[
]]..C.dist..[[m
]]end;a0=a0 ..\"
\"return a0 end;function A.compile(B)end;function A.coRender(B)local H=coroutine.status(B.Renderer)if H~=\"dead\"then local I,J=coroutine.resume(B.Renderer)if J then a(\"ERROR: \"..J)end elseif H==\"dead\"then B.Renderer=coroutine.create(B.render)local I,J=coroutine.resume(B.Renderer)end end;function A.render()local B=Industry;B:getCSS()B.renderBlocks={}B.renderBlocks[1]=B.cssBase;local E=1;if B.ready then for a1,C in pairs(B.elemIndy)do local a2=B:makeRender(C)E=E+1;if a2~=\"\"then B.renderBlocks[#B.renderBlocks+1]=a2 end;if math.fmod(E,maxPerFrame)==0 then coroutine.yield()end end end;local a3=#B.renderBlocks-1;B.totalUnrender=B.totalUnits-a3;local a0=table.concat(B.renderBlocks)B.renderSize=a0:len()system.setScreen(a0)end;function A.coUpdate(B)local H=coroutine.status(B.Processor)if H~=\"dead\"then local I,J=coroutine.resume(B.Processor)if J then a(\"ERROR: \"..J)end elseif H==\"dead\"then B.Processor=coroutine.create(B.update)local I,J=coroutine.resume(B.Processor)end end;function A.update()local B=Industry;local a4=0;for a5,C in pairs(B.elemIndy)do local a6=core.getElementIndustryInfoById(C.uid)if not a6 then a(C.uid..' had no data')else C.name=core.getElementNameById(C.uid)C.kind=core.getElementDisplayNameById(C.uid)C.class=core.getElementClassById(C.uid)C.state=a6.state;C.schemLeft=a6.schematicsRemaining;C.unitsDone=a6.unitsProduced;C.batchTotal=a6.batchesRequested;C.batchLeft=a6.batchesRemaining;C.maintainTotal=a6.maintainProductAmount;C.maintainDone=a6.currentProductAmount;C.products=a6.currentProducts;C.timeLeft=a6.remainingTime;C.mainProduct={}if C.maintainDone>=g then C.maintainDone=c(C.maintainDone/g)end;if C.products and#C.products>0 then C.mainProduct=C.products[1]local a7=system.getItem(C.mainProduct.id)C.mainProduct.name=a7.locDisplayName;C.mainProduct.type=a7.type;C.mainProduct.tier=a7.tier;C.mainProduct.scale=a7.size;C.mainProduct.icon=a7.iconPath end;B:makeBody(C)end;a4=a4+1;if math.fmod(a4,maxPerUpdate)==0 then coroutine.yield()end end;B.totalUnits=a4;B.ready=true end;return A end)()Commands=(function()local A={active=false,label='Listen to Voice',timed=0,lastCMD='',list={show={desc=' [1 to 9, show specific message matches]',fn=function(B,a8)local t=a8[2]Industry:filter(t)end},find={desc=' [search key, find machines or outputs]',fn=function(B,a8)local a9=table.remove(a8,1)local F=table.concat(a8,' ')Industry:find(F)end}}}function A.init(B)B.helps={}for a8,aa in pairs(B.list)do if aa.desc then aa.name=a8;B.helps[#B.helps+1]=a8 end end;table.sort(B.helps)end;function A.key(B,ab)local a5=ab:sub(7,8)local type=ab:sub(1,6)if a5=='9'then B:call('show errors')elseif ab=='r'then B:call('show all')elseif type=='option'then B:call('show '..a5)end end;function A.help(B)a('----------------------------')a('- twitch.tv/codeinfused')a('- tinyurl.com/indyhud')a('----------------------------')a('- INDY HUD BY CODEINFUSED v1.1')a('- COMMANDS')for E,ac in ipairs(B.helps)do a(ac..B.list[ac].desc)end;a('----------------------------')end;function A.call(B,ad,ae)local a8={}for C in ad:gmatch(\"%S+\")do table.insert(a8,C)end;local t=string.lower(a8[1])if t=='help'then B:help()elseif B.list[t]then B.list[t].fn(B,a8,ae)end end;return A end)()Industry:init()Commands:init()Commands:help()","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"Industry:coInit()\nIndustry:coUpdate()\nIndustry:coRender()\n--collectgarbage(\"collect\")","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"Commands:call(text)","filter":{"args":[{"variable":"*"}],"signature":"onInputText(text)","slotKey":"-4"},"key":"2"},{"code":"if action:sub(1,6)=='option' then\n Commands:key(action)\nelseif action=='speedup' then\n Commands:key('r')\nend","filter":{"args":[{"variable":"*"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"3"}],"methods":[],"events":[]} 2 | -------------------------------------------------------------------------------- /json-indyhud-v1-2.json: -------------------------------------------------------------------------------- 1 | {"slots":{"0":{"name":"core","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"maxDist = 70 --export: Maximum render distance in meters. Affects FPS.\nmaxPerFrame = 340 --export: Units drawn per render frame. Lower this if you are running other scripts too.\nfontSize = 0.94 --export: Recommended = 0.94, large = 1.2\nminimumOpacity = 0.45 --export: Lowest opacity of distant units. Range of zero to 1.\nshowContainers = false --export: Show containers in AR view and filters.\nshowRecipes = false --export: Show recipe list in the detail view box.\ndebugMode = false --export: Show debug data.\nKeyShift = false\nKeyAlt = false\nmaxPerUpdate = 10\nlocal a,b,c,d,e,f=system.print,string.format,math.floor,math.max,math.min,table.concat;local g=16777216;local function h(i)local j=i.x*Industry.cx;local k=i.y*Industry.cy;local l=i.z*Industry.cz;return j+k+l+Industry.worldPos end;local function m(n)return n==math.huge or n==-math.huge end;local function o(p,q)local r=10^(q or 0)return c(p*r+0.5)/r end;local function s(t)if t==nil or t~=t or t<1 or type(t)~=\"number\"then return\"00:00:00\"end;local u=c(t/3600)t=t-3600*u;local e=c(t/60)t=t-60*e;local v=o(t,0)local w=b(\"%02d:%02d:%02d\",u,e,v)return w end;local function x(y,z)return y.dist .indy{ position: absolute; display: block; color: #222; font-size: ]]..fontSize..[[vh; opacity: 0.7; width: ]]..20*fontSize..[[vh; text-transform:uppercase; transform-origin: 0 0; } .fs-s{font-size:0.92em;} .bg-b .ii{background:#303030; color:#fff;} .bg-k .ii{background:#666; color:#f1f1f1;} .grow{flex-grow:1;} .ii-row{display: flex;} .ii{display:inline-block; padding: 0.2rem 0.3rem; margin:0.08rem; margin-left:0; background:#eee;} .ib{border:1px solid #eee; color:#fff; text-transform:lowercase;} .ic{text-transform:lowercase;} .ii-dist, .ii-indy{display:inline-block; transform: skew(-15deg); font-weight:900;} .ii-st{color:#fff;} .st-red{background:#892e2e;} .st-green{background:#338f47;} .st-orange{background:#958122;} .ii-tier{color:#fff;} .ii.tier-X{background:#666;} .ii.tier-1{background:#5494f7;} .ii.tier-2{background:#2977ef;} .ii.tier-3{background:#06f;} .ii.tier-4{background:#0152cd;} .ii.tier-5{background:#003991;} .ii-name{white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} .ii-rb{background:#cacaca; color:#333;} div.sks{padding:0.4em 0.5em; margin-top:0.5em; background:#3473BA; color:#fff; font-size:1.1em;} .legend{position:absolute; left:2vw; top:]]..27-80*(fontSize-0.91)..[[vh; background:#fff; opacity:0.85; font-size:]]..fontSize..[[vh; color:#222; z-index:999;} .legend h2{font-size:]]..fontSize..[[vh; margin:0 0 0.2em 0; padding:0.15em 0.6em; background:#3473BA; color:#fff; font-weight:400;} .legend > p{color:#666; font-size:0.95em; line-height:1.0; padding:0em 0.3em; margin:0.4em 0.6em 0 0.6em; border-left:0.5em solid #3473BA;} ul{list-style:none; margin:0; padding:0.6em 0 0.2em 0;} ul li{margin-bottom:0.3em; padding:0.2em 0.6em;} li strong{background:#555; color:#f1f1f1; padding:0.2em 0.3em; margin-right:0.4em;} li span{background:#e1e1e1; color:#555; padding:0.2em 0.3em; margin-right:0.4em;} li span.on{background:#338f47; color:#fff;} li span.off{background:#777; color:#ccc;} .svg{display:inline-block;} svg{width:100%;} svg,.svg{margin:0; padding:0;} ]],cssBase=\"\"}local B={}function A.getCSS(C)C.cssBase=C.cssStatic..[[ li.]]..C.lastFilter..[[{background:#3473BA !important; color:#fff;} ]]..(C.searchActive and\"li.f1{background:#3473BA !important; color:#fff;}\"or\"\")..[[
Infinity Corporation
]]if C.ready then C.cssBase=C.cssBase..[[

LUA TAB COMMANDS

TOTAL ELEMENTS: ]]..C.totalUnits..[[

RENDERED: ]]..C.renderCt..[[

MATCHES IN RANGE: ]]..C.matchesFound..[[

Search filters will stack until reset with R

  • A:1show 1Stopped
  • A:2show 2Running
  • A:3show 3Miss Ingredients
  • A:4show 4Output Full
  • A:5show 5No Container Link
  • A:6show 6Pending
  • A:7show 7Miss Schematics
  • A:8show 8Server Error Issue
  • A:9show errorsAll Error Codes
  • Rshow allReset All Filters
  • find pureSearch For Output Products
  • find assemblySearch By Machine Type
]]..f(C.searches,', ')..[[

OTHER OPTIONS

  • S:G]]..(showContainers and\"on\"or\"off\")..[[Include Containers
  • S:L]]..(showRecipes and\"on\"or\"off\")..[[Show Recipes
  • S:RReload the HUD
]]else C.cssBase=C.cssBase..[[

LOADING DATA

...

]]end;C.cssBase=C.cssBase..\"
\"end;function A.getARxy(C,D)local t={D.pos.x,D.pos.y,D.pos.z}return library.getPointOnScreen(t)end;function A.sortItems(C)table.sort(C.sortedIndy)end;function A.filter(C,t)if t=='errors'then C.lastFilter='a9'for E,F in ipairs(C.filters)do C.filters[E]=0 end;C.filters[3]=1;C.filters[4]=1;C.filters[5]=1;C.filters[7]=1;C.filters[8]=1 elseif t=='all'then C.lastFilter='r'C.searchActive=false;C.searches={}for E,F in ipairs(C.filters)do C.filters[E]=1 end elseif type(t/1)=='number'then C.lastFilter='a'..t;for E,F in ipairs(C.filters)do C.filters[E]=0 end;C.filters[t/1]=1 end end;function A.find(C,t)C.searchActive=true;local G=t:lower()C.searches[#C.searches+1]=G end;function A.init(C)C.curTime=system.getArkTime()system.showScreen(1)system.setScreen(\"\")C.ready=false;C.loaded=false;C.worldPos=vec3(construct.getWorldPosition())C.Initializer=coroutine.create(C.initRun)C.Renderer=coroutine.create(C.render)C.Processor=coroutine.create(C.update)C.Organizer=coroutine.create(C.organize)end;function A.coInit(C)local H=coroutine.status(C.Initializer)if H~=\"dead\"then local I,J=coroutine.resume(C.Initializer)if J then a(\"ERROR: \"..J)end end end;function A.initRun()local C=Industry;local K=core.getElementIdList()local L={}for E=1,#K,1 do local M={uid=K[E],class=core.getElementClassById(K[E]),state=0,schemLeft=0,unitsDone=0,batchTotal=0,batchLeft=0,maintainTotal=0,maintainDone=0,products={}}local N=M.class:lower():sub(1,8)if N=='industry'or N=='containe'then M.name=core.getElementNameById(K[E])M.class=N;M.kind=core.getElementDisplayNameById(K[E])if M.class=='industry'then M.pos=vec3(core.getElementPositionById(K[E]))+vec3(core.getElementUpById(K[E]))else M.pos=vec3(core.getElementPositionById(K[E]))+vec3(core.getElementUpById(K[E]))/2;M.productName=M.name end;M.pos=vec3(h(M.pos))M.body=\"\"M.bodyTiny=\"\"M.dist=200;M.msgColor='orange'L['uid'..M.uid]=M else end;if math.fmod(E,maxPerFrame)==0 then coroutine.yield()end end;C.elemIndy=L;C.renderIndy={}C.loaded=true end;function A.makeContainer(C,D)D.bodyTiny=[[
]]..D.dist..[[m
]]D.body=[[
]]..D.dist..[[m
Container
]]..D.name..[[
]]end;function A.makeBody(C,D)local O='red'if D.state==2 then O='green'end;if D.state==6 or D.state==1 then O='orange'end;D.msgColor=O;local P='X'local Q='-'local R=\"No selection\"local S=D.schemLeft and\"SCHEMS: \"..D.schemLeft or\"-\"local T=false;if D.mainProduct and D.mainProduct.name then P=D.mainProduct.tier;Q=D.mainProduct.scale;if Q==''or not Q then Q='-'end;R=D.mainProduct.name;T=D.mainProduct.prid end;D.productName=R;local U=\"NA\"if D.batchTotal>0 then U=\"BATCHES: \"..D.batchLeft..\" / \"..b(\"%.0f\",D.batchTotal)elseif D.maintainTotal>0 then U=\"MAINTAIN: \"..D.maintainDone..\" / \"..b(\"%.0f\",D.maintainTotal)end;D.bodyTiny=[[
]]..D.dist..[[m
]]D.body=[[
]]..D.dist..[[m
]]..D.name..[[
]]..C.states[D.state]..[[
]]..P..[[
]]..Q..[[
]]..R..[[
]]..U..[[
]]..S..[[
]]if showRecipes and T and D.kind:lower():find('transfer unit')==nil then D.body=D.body..[[
]]..f(B[T],\", \")..[[
]]end end;function A.makeRender(C,D)local V=C:getARxy(D)local W=V[2]*100;local X=V[1]*100;if X>94 or X<1 or(W>96 or W<1)then return\"\"end;D.dist=c(V[3])local Y=D.dist;local Z=1;Z=100-Y*10;local _=\"\"_=(100-Y/1.5-5)/100;local a0=75;a0=a0+40*(maxDist-Y)/maxDist;a0=a0/100;local a1=''local R=D.productName;if D.class=='containe'then a1='bg-k'end;local a2=false;if W>49 and W<50.25 and X>48.5 and X<49.5 then _=0.99;Z=300-Y*10;a2=true end;local a3=\"\"if Y<=8 or Y<=maxDist and a2==true then Z=200-Y*10;a3=[[
]]..D.body else _=d(_,minimumOpacity)if D.class=='containe'then _=d(_-0.2,minimumOpacity)end;a3=[[
]]..D.dist..[[m
]]end;a3=a3 ..\"
\"return a3 end;function A.coRender(C)if not C.loaded then return end;local H=coroutine.status(C.Renderer)if H~=\"dead\"then local I,J=coroutine.resume(C.Renderer)if J then a(\"ERROR: \"..J)end elseif H==\"dead\"then C.Renderer=coroutine.create(C.render)local I,J=coroutine.resume(C.Renderer)end end;function A.render()local C=Industry;C.pPos=vec3(player.getWorldPosition())C:getCSS()C.renderBlocks={}C.renderBlocks[1]=C.cssBase;local E=1;if C.ready then for a4,a5 in pairs(C.renderIndy)do local a6=C:makeRender(C.elemIndy[a5])E=E+1;if a6~=\"\"then C.renderBlocks[#C.renderBlocks+1]=a6 end;if math.fmod(E,maxPerFrame)==0 then coroutine.yield()end end end;local a7=#C.renderBlocks-1;C.renderCt=a7;local a3=table.concat(C.renderBlocks)C.renderSize=a3:len()system.setScreen(a3)end;function A.coOrganize(C)if not C.loaded or not C.ready then return end;local H=coroutine.status(C.Organizer)if H~=\"dead\"then local I,J=coroutine.resume(C.Organizer)if J then a(\"ERROR: \"..J)end elseif H==\"dead\"then C.Organizer=coroutine.create(C.organize)local I,J=coroutine.resume(C.Organizer)end end;function A.organize()local C=Industry;local a8=c(maxPerFrame/4)local a9=0;local aa={}local E=0;if C.ready then for a5,D in pairs(C.elemIndy)do E=E+1;local ab=true;local Y=C.pPos:dist(vec3(D.pos))if Y>maxDist then ab=false elseif D.class=='containe'then if not showContainers then ab=false else local ac=true;local R=D.productName:lower()if C.searchActive then for E,G in ipairs(C.searches)do if R==\"no selection\"or R:find(G)==nil and D.kind:lower():find(G)==nil then ac=false end end end;if not ac then ab=false end end elseif C.filters[D.state]==0 then ab=false else local ac=true;local R=D.productName:lower()if C.searchActive then for E,G in ipairs(C.searches)do if R==\"no selection\"or R:find(G)==nil and D.kind:lower():find(G)==nil then ac=false end end end;if not ac then ab=false end end;if ab==true then if D.class~='containe'then a9=a9+1 end;aa[#aa+1]=a5 end;if math.fmod(E,a8)==0 then coroutine.yield()end end end;C.renderIndy=aa;C.matchesFound=a9 end;function A.coUpdate(C)if not C.loaded then return end;local H=coroutine.status(C.Processor)if H~=\"dead\"then local I,J=coroutine.resume(C.Processor)if J then a(\"ERROR: \"..J)end elseif H==\"dead\"then C.Processor=coroutine.create(C.update)local I,J=coroutine.resume(C.Processor)end end;function A.update()local C=Industry;local ad=0;for a5,D in pairs(C.elemIndy)do local ae=core.getElementIndustryInfoById(D.uid)if not ae or D.class=='containe'then C:makeContainer(D)else D.name=core.getElementNameById(D.uid)D.state=ae.state;D.schemLeft=ae.schematicsRemaining;D.unitsDone=ae.unitsProduced;D.batchTotal=ae.batchesRequested;D.batchLeft=ae.batchesRemaining;D.maintainTotal=ae.maintainProductAmount;D.maintainDone=ae.currentProductAmount;D.products=ae.currentProducts;D.timeLeft=ae.remainingTime;D.mainProduct={}if D.maintainDone>=g then D.maintainDone=c(D.maintainDone/g)end;if D.products and#D.products>0 then D.mainProduct=D.products[1]local af=D.mainProduct.id;local ag=system.getItem(af)D.mainProduct.name=ag.locDisplayName;D.mainProduct.tier=ag.tier;D.mainProduct.scale=ag.size;local ah='p'..af;D.mainProduct.prid=ah;if not B[ah]then local ai=system.getRecipes(af)local aj={}if#ai>0 then for ak,al in pairs(ai[1].ingredients)do local am=system.getItem(al.id)aj[#aj+1]=am.locDisplayName end end;B[ah]=aj end end;C:makeBody(D)end;ad=ad+1;if math.fmod(ad,maxPerUpdate)==0 then coroutine.yield()end end;C.totalUnits=ad;C.ready=true end;return A end)()Commands=(function()local A={active=false,label='Listen to Voice',timed=0,lastCMD='',list={show={desc=' [1 to 9, show specific message matches]',fn=function(C,an)local t=an[2]Industry:filter(t)end},find={desc=' [search key, find machines or outputs]',fn=function(C,an)local ao=table.remove(an,1)local F=table.concat(an,' ')Industry:find(F)end}}}function A.init(C)C.helps={}for an,ap in pairs(C.list)do if ap.desc then ap.name=an;C.helps[#C.helps+1]=an end end;table.sort(C.helps)end;function A.key(C,aq)local a5=aq:sub(7,8)local type=aq:sub(1,6)if a5=='9'then C:call('show errors')elseif aq=='speedup'then if KeyShift then Industry:init()else C:call('show all')end elseif aq=='lshift'then KeyShift=true elseif aq=='lalt'then KeyAlt=true elseif aq=='gear'then if KeyShift then showContainers=not showContainers end elseif aq=='light'then if KeyShift then showRecipes=not showRecipes end elseif type=='option'then C:call('show '..a5)end end;function A.keyStop(C,aq)if aq=='lshift'then KeyShift=false elseif aq=='lalt'then KeyAlt=false end end;function A.help(C)a('----------------------------')a('- twitch.tv/codeinfused')a('- tinyurl.com/indyhud')a('----------------------------')a('- INDY HUD BY CODEINFUSED v1.2')a('- COMMANDS')for E,ar in ipairs(C.helps)do a(ar..C.list[ar].desc)end;a('----------------------------')end;function A.call(C,as,at)local an={}for D in as:gmatch(\"%S+\")do table.insert(an,D)end;local t=string.lower(an[1])if t=='help'then C:help()elseif C.list[t]then C.list[t].fn(C,an,at)end end;return A end)()Industry:init()Commands:init()Commands:help()","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"Industry:coInit()\nIndustry:coUpdate()\nIndustry:coOrganize()\nIndustry:coRender()\ncollectgarbage(\"collect\")","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"Commands:call(text)","filter":{"args":[{"variable":"*"}],"signature":"onInputText(text)","slotKey":"-4"},"key":"2"},{"code":"--[[if action:sub(1,6)=='option' then\n Commands:key(action)\nelseif action=='speedup' then\n Commands:key('r')\nelseif action=='gear' then\nend\n]]\nCommands:key(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"3"},{"code":"Commands:keyStop(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"4"}],"methods":[],"events":[]} -------------------------------------------------------------------------------- /json-indyhud-v1-3.json: -------------------------------------------------------------------------------- 1 | {"slots":{"0":{"name":"core","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"language = 'EN' --export: EN, DE, FR\nmaxRenderDist = 60 --export: Maximum render distance in meters. Affects FPS.\nmaxPerFrame = 340 --export: Units drawn per render frame. Lower this if you are running other scripts too.\nfontSize = 0.94 --export: Recommended = 0.94, large = 1.2\nminimumOpacity = 0.45 --export: Lowest opacity of distant units. Range of zero to 1.\nshowContainers = true --export: Show containers in AR view and filters.\nshowRecipes = false --export: Show recipe list in the detail view box.\ndebugMode = false --export: Show debug data.\nlocal a=false;local b=false;local c=10;local d=false;local e,f,g,h,i,j=system.print,string.format,math.floor,math.max,math.min,table.concat;local k=16777216;local function l(m)local n=m.x*Industry.cx;local o=m.y*Industry.cy;local p=m.z*Industry.cz;return n+o+p+Industry.worldPos end;local function q(r)return r==math.huge or r==-math.huge end;local function s(t,u)local v=10^(u or 0)return g(t*v+0.5)/v end;local function w(x)if x==nil or x~=x or x<1 or type(x)~=\"number\"then return\"00:00:00\"end;local y=g(x/3600)x=x-3600*y;local i=g(x/60)x=x-60*i;local z=s(x,0)local A=f(\"%02d:%02d:%02d\",y,i,z)return A end;local function B(C,D)return C.dist0 and G[I]then return G[I][F]else return I end end;Industry=(function()local J={i=0,cx=vec3(construct.getWorldOrientationRight()),cy=vec3(construct.getWorldOrientationForward()),cz=vec3(construct.getWorldOrientationUp()),pPos=vec3(player.getWorldPosition()),loaded=false,ready=false,states={H('Stopped'),H('Running'),H('Needs Ingredients'),H('Output Full'),H('No Output Link'),H('Pending'),H('Missing Schematics'),H('Server Error')},allBlocks={},renderBlocks={},elemIndy={},renderIndy={},priorityIndy={},totalUnits=0,totalUnrender=0,matchesFound=0,renderSize=0,lastFilter='r',searchActive=false,searches={},filters={1,1,1,1,1,1,1,1},cssStatic=[[
Infinity Corporation
]]if L.ready then L.cssBase=L.cssBase..[[

INDY HUD v1.3

]]..H('TOTAL ELEMENTS')..[[: ]]..L.totalUnits..[[

]]..H('RENDERED')..[[: ]]..L.renderCt..[[

]]..H('MATCHES IN RANGE')..[[: ]]..L.matchesFound..[[

  • CTRL:BACKSPC]]..H('Exit HUD')..[[
  • A:1show 1]]..L.states[1]..[[
  • A:2show 2]]..L.states[2]..[[
  • A:3show 3]]..L.states[3]..[[
  • A:4show 4]]..L.states[4]..[[
  • A:5show 5]]..L.states[5]..[[
  • A:6show 6]]..L.states[6]..[[
  • A:7show 7]]..L.states[7]..[[
  • A:8show 8]]..L.states[8]..[[
  • A:9show errors]]..H('All Error Codes')..[[
  • Rshow all]]..H('Reset All Filters')..[[
  • find pure]]..H('Search For Output Products')..[[
  • find assembly]]..H('Search By Machine Type')..[[
]]..j(L.searches,', ')..[[

OPTIONS

  • S:G]]..H(showContainers and(d and\"full\"or\"on\")or\"off\")..[[]]..H('Include Containers')..[[
  • S:L]]..H(showRecipes and\"on\"or\"off\")..[[]]..H('Show Recipes')..[[
  • S:R]]..H('Reload the HUD')..[[
]]else L.cssBase=L.cssBase..[[

]]..H('LOADING DATA')..[[

...

]]end;L.cssBase=L.cssBase..\"
\"end;function J.getARxy(L,M)local x={M.pos.x,M.pos.y,M.pos.z}return library.getPointOnScreen(x)end;function J.sortItems(L)table.sort(L.sortedIndy)end;function J.filter(L,x)if x=='errors'then L.lastFilter='a9'for N,O in ipairs(L.filters)do L.filters[N]=0 end;L.filters[3]=1;L.filters[4]=1;L.filters[5]=1;L.filters[7]=1;L.filters[8]=1 elseif x=='all'then L.lastFilter='r'L.searchActive=false;L.searches={}for N,O in ipairs(L.filters)do L.filters[N]=1 end elseif type(x/1)=='number'then L.lastFilter='a'..x;for N,O in ipairs(L.filters)do L.filters[N]=0 end;L.filters[x/1]=1 end end;function J.find(L,x)L.searchActive=true;local P=x:lower()L.searches[#L.searches+1]=P end;function J.init(L)L.curTime=system.getArkTime()system.showScreen(1)system.setScreen(\"\")L.ready=false;L.loaded=false;L.worldPos=vec3(construct.getWorldPosition())L.Initializer=coroutine.create(L.initRun)L.Renderer=coroutine.create(L.render)L.Processor=coroutine.create(L.update)L.Organizer=coroutine.create(L.organize)end;function J.coInit(L)local Q=coroutine.status(L.Initializer)if Q~=\"dead\"then local R,S=coroutine.resume(L.Initializer)if S then e(\"ERROR: \"..S)end end end;function J.initRun()local L=Industry;local T=core.getElementIdList()local U={}for N=1,#T,1 do local V={uid=T[N],class=core.getElementClassById(T[N]),state=0,schemLeft=0,unitsDone=0,batchTotal=0,batchLeft=0,maintainTotal=0,maintainDone=0,products={}}local W=V.class:lower():sub(1,8)if W=='industry'or W=='containe'then V.name=core.getElementNameById(T[N])V.class=W;V.kind=core.getElementDisplayNameById(T[N])if V.class=='industry'then V.pos=vec3(core.getElementPositionById(T[N]))+vec3(core.getElementUpById(T[N]))else V.pos=vec3(core.getElementPositionById(T[N]))+vec3(core.getElementUpById(T[N]))/2;V.productName=V.name end;V.pos=vec3(l(V.pos))V.body=\"\"V.bodyTiny=\"\"V.dist=200;V.msgColor='orange'U['uid'..V.uid]=V else end;if math.fmod(N,maxPerFrame)==0 then coroutine.yield()end end;L.elemIndy=U;L.renderIndy={}L.loaded=true end;function J.makeContainer(L,M)M.bodyTiny=[[
]]..M.dist..[[m
]]M.body=[[
]]..M.dist..[[m
]]..H('Container')..[[
]]..M.name..[[
]]M.bodyTiny=M.body end;function J.makeBody(L,M)local X='red'if M.state==2 then X='green'elseif M.state==3 or M.state==7 then X='orange'elseif M.state==1 then X='steel'elseif M.state==6 then X='yellow'end;M.msgColor=X;local Y='X'local Z='-'local _=\"No selection\"local a0=M.schemLeft and\"SCHEMS: \"..M.schemLeft or\"-\"local a1=false;if M.mainProduct and M.mainProduct.name then Y=M.mainProduct.tier;Z=M.mainProduct.scale;if Z==''or not Z then Z='-'end;_=M.mainProduct.name;a1=M.mainProduct.prid end;M.productName=_;local a2=\"NA\"M.ordertype='na'if M.batchTotal>0 then a2=\"BATCHES: \"..M.batchLeft..\" / \"..f(\"%.0f\",M.batchTotal)M.ordertype='batch'elseif M.maintainTotal>0 then a2=\"MAINTAIN: \"..M.maintainDone..\" / \"..f(\"%.0f\",M.maintainTotal)M.ordertype='maintain'elseif M.state~=1 then a2=\"RUN ∞\"M.ordertype='run'end;M.bodyTiny=[[
]]..M.dist..[[m
]]M.body=[[
]]..M.dist..[[m
]]..M.name..[[
]]..L.states[M.state]..[[
T]]..Y..[[
]]..Z..[[
]].._..[[
]]..a2 ..[[
]]..a0 ..[[
]]if showRecipes and a1 and M.kind:lower():find('transfer unit')==nil then M.body=M.body..[[
]]..j(K[a1],\", \")..[[
]]end end;function J.makeRender(L,M)local a3=L:getARxy(M)local a4=a3[2]*100;local a5=a3[1]*100;if a5>94 or a5<1 or(a4>96 or a4<1)then return\"\"end;M.dist=g(a3[3])local a6=M.dist;local a7=1;a7=100-a6*10;local a8=\"\"a8=(100-a6/1.5-5)/100;local a9=75;a9=a9+40*(maxRenderDist-a6)/maxRenderDist;a9=a9/100;local aa=''local _=M.productName;if M.class=='containe'then aa='bg-k'end;local ab=false;if a4>49 and a4<50.25 and a5>48.5 and a5<49.5 then a8=0.99;a7=300-a6*10;ab=true end;local ac=M.ordertype=='run'and' glow'or''local ad=\"\"if a6<=8 or a6<=maxRenderDist and ab==true or M.class=='containe'and d==true then a7=200-a6*10;ad=[[
]]..M.body else a8=h(a8,minimumOpacity)if M.class=='containe'then a8=h(a8-0.2,minimumOpacity)end;ad=[[
]]..M.dist..[[m
]]end;ad=ad..\"
\"if ab==true then L.priorityIndy[#L.priorityIndy+1]=ad;return''else return ad end end;function J.coRender(L)if not L.loaded then return end;local Q=coroutine.status(L.Renderer)if Q~=\"dead\"then local R,S=coroutine.resume(L.Renderer)if S then e(\"ERROR: \"..S)end elseif Q==\"dead\"then L.Renderer=coroutine.create(L.render)local R,S=coroutine.resume(L.Renderer)end end;function J.render()local L=Industry;L.pPos=vec3(player.getWorldPosition())L:getCSS()L.priorityIndy={'
'}L.renderBlocks={}L.renderBlocks[1]=L.cssBase;L.renderBlocks[2]='
'local N=#L.renderBlocks+1;if L.ready then for ae,af in pairs(L.renderIndy)do local ag=L:makeRender(L.elemIndy[af])N=N+1;if ag~=\"\"then L.renderBlocks[#L.renderBlocks+1]=ag end;if math.fmod(N,maxPerFrame)==0 then coroutine.yield()end end end;L.renderBlocks[#L.renderBlocks+1]=\"
\"L.priorityIndy[#L.priorityIndy+1]=\"
\"local ah=#L.renderBlocks;L.renderCt=ah;local ad=table.concat(L.renderBlocks)..table.concat(L.priorityIndy)L.renderSize=ad:len()system.setScreen(ad)end;function J.coOrganize(L)if not L.loaded or not L.ready then return end;local Q=coroutine.status(L.Organizer)if Q~=\"dead\"then local R,S=coroutine.resume(L.Organizer)if S then e(\"ERROR: \"..S)end elseif Q==\"dead\"then L.Organizer=coroutine.create(L.organize)local R,S=coroutine.resume(L.Organizer)end end;function J.organize()local L=Industry;local ai=g(maxPerFrame/4)local aj=0;local ak={}local N=0;if L.ready then for af,M in pairs(L.elemIndy)do N=N+1;local al=true;local a6=L.pPos:dist(vec3(M.pos))if a6>maxRenderDist then al=false elseif M.class=='containe'then if not showContainers then al=false else local am=true;local _=M.productName:lower()if L.searchActive then for N,P in ipairs(L.searches)do if _==\"no selection\"or _:find(P)==nil and M.kind:lower():find(P)==nil then am=false end end end;if not am then al=false end end elseif L.filters[M.state]==0 then al=false else local am=true;local _=M.productName:lower()if L.searchActive then for N,P in ipairs(L.searches)do if _==\"no selection\"or _:find(P)==nil and M.kind:lower():find(P)==nil then am=false end end end;if not am then al=false end end;if al==true then if M.class~='containe'then aj=aj+1 end;ak[#ak+1]=af end;if math.fmod(N,ai)==0 then coroutine.yield()end end end;L.renderIndy=ak;L.matchesFound=aj end;function J.coUpdate(L)if not L.loaded then return end;local Q=coroutine.status(L.Processor)if Q~=\"dead\"then local R,S=coroutine.resume(L.Processor)if S then e(\"ERROR: \"..S)end elseif Q==\"dead\"then L.Processor=coroutine.create(L.update)local R,S=coroutine.resume(L.Processor)end end;function J.update()local L=Industry;local an=0;for af,M in pairs(L.elemIndy)do local ao=core.getElementIndustryInfoById(M.uid)if not ao or M.class=='containe'then L:makeContainer(M)else M.name=core.getElementNameById(M.uid)M.state=ao.state;M.schemLeft=ao.schematicsRemaining;M.unitsDone=ao.unitsProduced;M.batchTotal=ao.batchesRequested;M.batchLeft=ao.batchesRemaining;M.maintainTotal=ao.maintainProductAmount;M.maintainDone=ao.currentProductAmount;if M.state==6 and M.maintainDone=k then M.maintainDone=g(M.maintainDone/k)end;if M.products and#M.products>0 then M.mainProduct=M.products[1]local ap=M.mainProduct.id;local aq=system.getItem(ap)M.mainProduct.name=aq.locDisplayName;M.mainProduct.tier=aq.tier;M.mainProduct.scale=aq.size;local ar='p'..ap;M.mainProduct.prid=ar;if not K[ar]then local as=system.getRecipes(ap)local at={}if#as>0 then for au,av in pairs(as[1].ingredients)do local aw=system.getItem(av.id)at[#at+1]=aw.locDisplayName end end;K[ar]=at end end;L:makeBody(M)end;an=an+1;if math.fmod(an,c)==0 then coroutine.yield()end end;L.totalUnits=an;L.ready=true end;return J end)()Commands=(function()local J={active=false,label='Listen to Voice',timed=0,lastCMD='',list={show={desc=' [1 to 9, show specific message matches]',fn=function(L,ax)local x=ax[2]Industry:filter(x)end},find={desc=' [search key, find machines or outputs]',fn=function(L,ax)local ay=table.remove(ax,1)local O=table.concat(ax,' ')Industry:find(O)end}}}function J.init(L)L.helps={}for ax,az in pairs(L.list)do if az.desc then az.name=ax;L.helps[#L.helps+1]=ax end end;table.sort(L.helps)end;function J.key(L,aA)local af=aA:sub(7,8)local type=aA:sub(1,6)if af=='9'then L:call('show errors')elseif aA=='speedup'then if a then Industry:init()else L:call('show all')end elseif aA=='lshift'then a=true elseif aA=='lalt'then b=true elseif aA=='gear'then if a then if d==true then d=false;showContainers=false elseif showContainers==false then showContainers=true else d=true end end elseif aA=='light'then if a then showRecipes=not showRecipes end elseif type=='option'then L:call('show '..af)end end;function J.keyStop(L,aA)if aA=='lshift'then a=false elseif aA=='lalt'then b=false end end;function J.help(L)e('----------------------------')e('- FR by Elias Villd / DE by Ikara')e('- twitch.tv/codeinfused')e('- tinyurl.com/indyhud')e('----------------------------')e('- INDY HUD BY CODEINFUSED v1.3 rc')for N,aB in ipairs(L.helps)do e(aB..L.list[aB].desc)end;e('----------------------------')end;function J.call(L,aC,aD)local ax={}for M in aC:gmatch(\"%S+\")do table.insert(ax,M)end;local x=string.lower(ax[1])if x=='help'then L:help()elseif L.list[x]then L.list[x].fn(L,ax,aD)end end;return J end)()Industry:init()Commands:init()Commands:help()","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"Industry:coInit()\nIndustry:coUpdate()\nIndustry:coOrganize()\nIndustry:coRender()\ncollectgarbage(\"collect\")","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"Commands:call(text)","filter":{"args":[{"variable":"*"}],"signature":"onInputText(text)","slotKey":"-4"},"key":"2"},{"code":"--[[if action:sub(1,6)=='option' then\n Commands:key(action)\nelseif action=='speedup' then\n Commands:key('r')\nelseif action=='gear' then\nend\n]]\nCommands:key(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"3"},{"code":"Commands:keyStop(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"4"}],"methods":[],"events":[]} 2 | -------------------------------------------------------------------------------- /json-indyhud-v1-4.json: -------------------------------------------------------------------------------- 1 | {"slots":{"0":{"name":"core","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"language = 'EN' --export: EN, DE, FR\nstartingModeNumber = 0 --export: Codes 1 to 9, or 0 for \"Show All\".\nshowContainers = true --export: Show containers in AR view and filters.\nshowRecipes = true --export: Show recipe list in the detail view box.\nmaxRenderDist = 70 --export: Default render distance in meters. Can affects FPS.\nmaxPerFrame = 350 --export: Units drawn and checked per render frame. Lower this if you are running other scripts too or getting shutdowns.\nfontSize = 0.94 --export: Recommended = 0.94, large = 1.2\nminimumOpacity = 0.45 --export: Lowest opacity of distant units. Range of zero to 1.\ndebugMode = false --export: Show debug data.\n\nlocal a=maxRenderDist;local b=70;local c=false;local d=false;local e=10;local f=false;fpsEpoch=system.getArkTime()fpsTimer=0;renderFrames=0;fpsRender=0;fps=30;renderLoopPause=0;local g,h,i,j,k,l=system.print,string.format,math.floor,math.max,math.min,table.concat;local m=16777216;local function n(o)local p=o.x*Industry.cx;local q=o.y*Industry.cy;local r=o.z*Industry.cz;return p+q+r+Industry.worldPos end;local function s(t)return t==math.huge or t==-math.huge end;function round(u,v)local w=10^(v or 0)return i(u*w+0.5)/w end;local function x(y)if y==nil or y~=y or y<1 or type(y)~=\"number\"then return\"00:00:00\"end;local z=i(y/3600)y=y-3600*z;local k=i(y/60)y=y-60*k;local A=round(y,0)local B=h(\"%02d:%02d:%02d\",z,k,A)return B end;local function C(D,E)return D.dist0 and H[J]then return H[J][G]else return J end end;Industry=(function()local K={i=0,cx=vec3(construct.getWorldOrientationRight()),cy=vec3(construct.getWorldOrientationForward()),cz=vec3(construct.getWorldOrientationUp()),pPos=vec3(player.getWorldPosition()),loaded=false,ready=false,states={I('Stopped'),I('Running'),I('Needs Ingredients'),I('Output Full'),I('No Output Link'),I('Pending'),I('Missing Schematics'),I('Server Error')},allBlocks={},renderBlocks={},elemIndy={},renderIndy={},priorityIndy={},totalUnits=0,totalUnrender=0,matchesFound=0,renderSize=0,renderCt=0,lastFilter='r',searchActive=false,searches={},filters={1,1,1,1,1,1,1,1},cssStatic=[[\n \n
\n
\n \n \n \n \n \n \n Infinity Corporation\n
\n ]]if M.ready then M.cssBase=M.cssBase..[[\n

INDY HUD v1.4

\n

]]..I('TOTAL ELEMENTS')..[[: ]]..M.totalUnits..[[

\n

]]..I('RENDERED')..[[: ]]..M.renderCt..[[ (]]..fps..[[ fps)

\n

]]..I('MATCHES IN RANGE')..[[: ]]..M.matchesFound..[[

\n

RENDER DISTANCE: ]]..a..[[m

\n
    \n
  • CTRL:BACKSPC]]..I('Exit HUD')..[[
  • \n
  • A:1show 1]]..M.states[1]..[[
  • \n
  • A:2show 2]]..M.states[2]..[[
  • \n
  • A:3show 3]]..M.states[3]..[[
  • \n
  • A:4show 4]]..M.states[4]..[[
  • \n
  • A:5show 5]]..M.states[5]..[[
  • \n
  • A:6show 6]]..M.states[6]..[[
  • \n
  • A:7show 7]]..M.states[7]..[[
  • \n
  • A:8show 8]]..M.states[8]..[[
  • \n
  • A:9show errors]]..I('All Error Codes')..[[
  • \n
  • Rshow all]]..I('Reset All Filters')..[[
  • \n
  • find pure]]..I('Search For Output Products')..[[
  • \n
  • find assembly]]..I('Search By Machine Type')..[[
  • \n
\n
]]..l(M.searches,', ')..[[
\n

OPTIONS

\n
    \n
  • S:G]]..I(showContainers and(f and\"full\"or\"on\")or\"off\")..[[]]..I('Include Containers')..[[
  • \n
  • S:L]]..I(showRecipes and\"on\"or\"off\")..[[]]..I('Show Recipes')..[[
  • \n
  • S:R]]..I('Reload the HUD')..[[
  • \n
\n ]]else M.cssBase=M.cssBase..[[\n

]]..I('LOADING DATA')..[[

\n

...

\n
\n ]]end;M.cssBase=M.cssBase..\"
\"end;function K.getARxy(M,N)local y={N.pos.x,N.pos.y,N.pos.z}return library.getPointOnScreen(y)end;function K.sortItems(M)table.sort(M.sortedIndy)end;function K.filter(M,y)if y=='errors'then M.lastFilter='a9'for O,P in ipairs(M.filters)do M.filters[O]=0 end;M.filters[3]=1;M.filters[4]=1;M.filters[5]=1;M.filters[7]=1;M.filters[8]=1 elseif y=='all'then M.lastFilter='r'M.searchActive=false;M.searches={}for O,P in ipairs(M.filters)do M.filters[O]=1 end elseif type(y/1)=='number'then M.lastFilter='a'..y;for O,P in ipairs(M.filters)do M.filters[O]=0 end;M.filters[y/1]=1 end end;function K.find(M,y)M.searchActive=true;local Q=y:lower()M.searches[#M.searches+1]=Q end;function K.init(M)M.curTime=system.getArkTime()system.showScreen(1)system.setScreen(\"\")M.ready=false;M.loaded=false;M.schemBox=nil;M.schemsList={}M.worldPos=vec3(construct.getWorldPosition())if startingModeNumber>0 then if startingModeNumber==9 then Industry:filter('errors')else Industry:filter(startingModeNumber)end end;M.Initializer=coroutine.create(M.initRun)M.Renderer=coroutine.create(M.render)M.Processor=coroutine.create(M.update)M.Organizer=coroutine.create(M.organize)M.Schemer=coroutine.create(M.schemsCFN)end;function K.coInit(M)local R=coroutine.status(M.Initializer)if R~=\"dead\"then local S,T=coroutine.resume(M.Initializer)if T then g(\"ERROR: coinit\")end end end;function K.initRun()local M=Industry;local U=core.getElementIdList()local V={}local W=construct.getSchematicContainerId()for X,Y in pairs(unit)do if type(Y)==\"table\"and type(Y.export)==\"table\"and Y.getClass then if Y.getLocalId()==W then M.schemBox=Y end end end;for O=1,#U,1 do local Z={uid=U[O],class=core.getElementClassById(U[O]),state=0,schemLeft=0,unitsDone=0,batchTotal=0,batchLeft=0,maintainTotal=0,maintainDone=0,products={}}local _=Z.class:lower():sub(1,8)if _=='industry'or _=='containe'then Z.name=core.getElementNameById(U[O])Z.class=_;Z.kind=core.getElementDisplayNameById(U[O])if Z.class=='industry'then Z.pos=vec3(core.getElementPositionById(U[O]))+vec3(core.getElementUpById(U[O]))else Z.pos=vec3(core.getElementPositionById(U[O]))+vec3(core.getElementUpById(U[O]))/2;Z.productName=Z.name end;Z.pos=vec3(n(Z.pos))Z.body=\"\"Z.bodyTiny=\"\"Z.dist=200;Z.msgColor='orange'V['uid'..Z.uid]=Z else end;if math.fmod(O,maxPerFrame)==0 then coroutine.yield()end end;M.elemIndy=V;M.renderIndy={}M.loaded=true;if W==nil then system.print(\"Schematic container not set up for the construct.\")end;if M.schemBox==nil then system.print(\"No schematic container linked to this board.\")end end;function K.makeContainer(M,N)N.bodyTiny=[[
]]..N.dist..[[m
]]N.body=[[\n
\n
]]..N.dist..[[m
]]..I('Container')..[[
\n
\n
\n
]]..N.name..[[
\n
\n ]]N.bodyTiny=N.body end;function K.makeBody(M,N)local a0='red'if N.state==2 then a0='green'elseif N.state==3 or N.state==7 then a0='orange'elseif N.state==1 then a0='steel'elseif N.state==6 then a0='yellow'end;N.msgColor=a0;local a1='X'local a2='-'local a3=\"No selection\"local a4=N.schemLeft and\"SCHEMS: \"..N.schemLeft..\"/\"..N.schemCost or\"-\"local a5=false;if N.mainProduct and N.mainProduct.name then a1=N.mainProduct.tier;a2=N.mainProduct.scale;if a2==''or not a2 then a2='-'end;a3=N.mainProduct.name;a5=N.mainProduct.prid end;N.productName=a3;local a6=\"NA\"N.ordertype='na'if N.batchTotal>0 then if N.batchLeft~='--'then N.batchLeft=h(\"%.0f\",N.batchLeft)end;a6=\"BATCHES: \"..N.batchLeft..\" / \"..h(\"%.0f\",N.batchTotal)N.ordertype='batch'elseif N.maintainTotal>0 then a6=\"MAINTAIN: \"..h(\"%.0f\",N.maintainDone)..\" / \"..h(\"%.0f\",N.maintainTotal)N.ordertype='maintain'elseif N.state~=1 then a6=\"RUN ∞\"N.ordertype='run'end;N.bodyTiny=[[
]]..N.dist..[[m
]]N.body=[[\n
\n
]]..N.dist..[[m
]]..N.name..[[
\n
\n
\n
]]..M.states[N.state]..[[
\n
\n
\n
T]]..a1 ..[[
]]..a2 ..[[
]]..a3 ..[[
\n
\n
\n
]]..a6 ..[[
]]..a4 ..[[
\n
\n ]]if showRecipes and a5 and N.kind:lower():find('transfer unit')==nil then N.body=N.body..[[\n
\n
]]..l(L[a5],\", \")..[[
\n
\n ]]end end;function K.makeRender(M,N)local a7=M:getARxy(N)local a8=a7[2]*100;local a9=a7[1]*100;if a9>94 or a9<1 or(a8>96 or a8<1)then return\"\"end;N.dist=i(a7[3])local aa=N.dist;local ab=1;ab=100-aa*10;local ac=\"\"ac=(100-aa/1.5-5)/100;local ad=75;ad=ad+40*(a-aa)/a;ad=ad/100;local ae=''local a3=N.productName;if N.class=='containe'then ae='bg-k'end;local af=false;if a8>49 and a8<50.25 and a9>48.5 and a9<49.5 then ac=0.99;ab=300-aa*10;af=true end;local ag=N.ordertype=='run'and' glow'or''local ah=\"\"if aa<=8 or aa<=a and af==true or N.class=='containe'and f==true then ab=200-aa*10;ah=[[\n
\n ]]..N.body else ac=j(ac,minimumOpacity)if N.class=='containe'then ac=j(ac-0.2,minimumOpacity)end;ah=[[\n
\n
]]..N.dist..[[m
\n ]]end;ah=ah..\"
\"if af==true then M.priorityIndy[#M.priorityIndy+1]=ah;return''else return ah end end;function K.coRender(M)if not M.loaded then return end;M:render()end;function K.render()local M=Industry;local O=1;if renderLoopPause<1 then M.pPos=vec3(player.getWorldPosition())M:getCSS()M.priorityIndy={'
'}M.renderBlocks={}M.renderBlocks[1]=M.cssBase;M.renderBlocks[2]='
'else O=renderLoopPause end;renderLoopPause=0;if M.ready then for ai=O,#M.renderIndy,1 do local aj=M:makeRender(M.elemIndy[M.renderIndy[ai]])O=O+1;if aj~=\"\"then M.renderBlocks[#M.renderBlocks+1]=aj end;if math.fmod(O-renderLoopPause,maxPerFrame*2.5)==0 then renderLoopPause=O;break end end end;if renderLoopPause>0 then return end;M.renderBlocks[#M.renderBlocks+1]=\"
\"M.priorityIndy[#M.priorityIndy+1]=\"
\"local ak=#M.renderBlocks or 3;M.renderCt=ak-3;renderFrames=renderFrames+1;local ah=table.concat(M.renderBlocks)..table.concat(M.priorityIndy)system.setScreen(ah)end;function K.coOrganize(M)if not M.loaded or not M.ready then return end;local R=coroutine.status(M.Organizer)if R~=\"dead\"then local S,T=coroutine.resume(M.Organizer)if T then g(\"ERROR: coOrganize\")end elseif R==\"dead\"then M.Organizer=coroutine.create(M.organize)local S,T=coroutine.resume(M.Organizer)end end;function K.organize()local M=Industry;local al=i(maxPerFrame/2)local am=0;local an=0;local ao={}local O=0;if M.ready then for ap,N in pairs(M.elemIndy)do O=O+1;local aq=true;local aa=M.pPos:dist(vec3(N.pos))if aa>a then aq=false elseif N.class=='containe'then if not showContainers then aq=false else local ar=true;local a3=N.productName:lower()if M.searchActive then for O,Q in ipairs(M.searches)do if a3==\"no selection\"or a3:find(Q)==nil and N.kind:lower():find(Q)==nil then ar=false end end end;if not ar then aq=false end end elseif M.filters[N.state]==0 then aq=false else local ar=true;local a3=N.productName:lower()if M.searchActive then for O,Q in ipairs(M.searches)do if a3==\"no selection\"or a3:find(Q)==nil and N.kind:lower():find(Q)==nil then ar=false end end end;if not ar then aq=false end end;if aq==true then if N.class~='containe'then am=am+1 else an=an+1 end;ao[#ao+1]=ap end;if math.fmod(O,al)==0 then coroutine.yield()end end end;lastRenderIndyCt=#ao;M.renderIndy=ao;M.matchesFound=am+an;local as=maxPerFrame*1.5;local at=math.abs(as-M.matchesFound)local au=200;if at>800 then au=50 end;local av=round(at/au)if M.matchesFound>as then if av<2 then return end;a=j(a-j(3,av),40)else a=k(a+j(10,av),150)end end;function K.coSchems(M)if not M.loaded or M.schemBox==nil then return end;local R=coroutine.status(M.Schemer)if R~=\"dead\"then local S,T=coroutine.resume(M.Schemer)if T then g(\"ERROR: coSchem\")end elseif R==\"dead\"then M.schemBox.updateContent()M.Schemer=coroutine.create(M.schemsCFN)local S,T=coroutine.resume(M.Schemer)end end;function K.schemsCFN()local M=Industry;if M.schemBox==nil then return end;local aw={}local ax=M.schemBox.getContent()for ai,ay in pairs(ax)do coroutine.yield()aw[\"k\"..ay.id]=ay.quantity end;M.schemsList=aw end;function K.schemsUpdate()system.print('container update')end;function K.coUpdate(M)if not M.loaded then return end;local R=coroutine.status(M.Processor)if R~=\"dead\"then local S,T=coroutine.resume(M.Processor)if T then g(\"ERROR: coUpdate\")end elseif R==\"dead\"then M.Processor=coroutine.create(M.update)local S,T=coroutine.resume(M.Processor)end end;function K.update()local M=Industry;local az=0;for ap,N in pairs(M.elemIndy)do local aA=core.getElementIndustryInfoById(N.uid)if not aA or N.class=='containe'then M:makeContainer(N)else N.name=core.getElementNameById(N.uid)local aB=aA.requiredSchematicIds[1]or 0;N.state=aA.state;N.schemLeft=h(\"%.0f\",M.schemsList[\"k\"..aB]or 0)N.schemCost=aA.requiredSchematicAmount;N.schemIds=aA.requiredSchematicIds;N.unitsDone=aA.unitsProduced;N.batchTotal=aA.batchesRequested;N.batchLeft=aA.batchesRemaining;N.maintainTotal=aA.maintainProductAmount;N.maintainDone=aA.currentProductAmount;if N.state==6 and N.maintainDone=m then N.maintainDone=i(N.maintainDone/m)end;if N.products and#N.products>0 then N.mainProduct=N.products[1]local aC=N.mainProduct.id;local aD=system.getItem(aC)N.mainProduct.name=aD.locDisplayName;N.mainProduct.tier=aD.tier;N.mainProduct.scale=aD.size;local aE='p'..aC;N.mainProduct.prid=aE;if not L[aE]then local aF=system.getRecipes(aC)local aG={}if#aF>0 then for aH,aI in pairs(aF[1].ingredients)do local aJ=system.getItem(aI.id)aG[#aG+1]=aJ.locDisplayName..' '..aJ.size end end;L[aE]=aG end end;M:makeBody(N)end;az=az+1;if math.fmod(az,e)==0 then coroutine.yield()end end;M.totalUnits=az;M.ready=true end;return K end)()Commands=(function()local K={active=false,label='Listen to Voice',timed=0,lastCMD='',list={show={fn=function(M,aK)local y=aK[2]Industry:filter(y)end},find={desc=' [search key, find machines or outputs]',fn=function(M,aK)local aL=table.remove(aK,1)local P=table.concat(aK,' ')Industry:find(P)end}}}function K.init(M)M.helps={}for aK,aM in pairs(M.list)do if aM.desc then aM.name=aK;M.helps[#M.helps+1]=aK end end;table.sort(M.helps)end;function K.key(M,aN)local ap=aN:sub(7,8)local type=aN:sub(1,6)if ap=='9'then M:call('show errors')elseif aN=='speedup'then if c then Industry:init()else a=maxRenderDist;M:call('show all')end elseif aN=='lshift'then c=true elseif aN=='lalt'then d=true elseif aN=='gear'then if c then if f==true then f=false;showContainers=false elseif showContainers==false then showContainers=true else f=true end end elseif aN=='light'then if c then showRecipes=not showRecipes end elseif type=='option'then M:call('show '..ap)end end;function K.keyStop(M,aN)if aN=='lshift'then c=false elseif aN=='lalt'then d=false end end;function K.help(M)g(' ')g(' ')g(' ')g('----------------------------')g('- FR by Elias Villd / DE by Ikara')g('- twitch.tv/codeinfused')g('- tinyurl.com/indyhud')g('----------------------------')g('- INDY HUD BY CODEINFUSED v1.4')for O,aO in ipairs(M.helps)do if M.list[aO].desc~=nil then g(aO..M.list[aO].desc)end end;g('----------------------------')end;function K.call(M,aP,aQ)local aK={}for N in aP:gmatch(\"%S+\")do table.insert(aK,N)end;local y=string.lower(aK[1])if y=='help'then M:help()elseif M.list[y]then M.list[y].fn(M,aK,aQ)end end;return K end)()Industry:init()Commands:init()Commands:help()","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"fpsTimer = fpsTimer + 1\nlocal currEpoch = round(system.getArkTime())\nif currEpoch > fpsEpoch then\n fpsEpoch = currEpoch\n fps = fpsTimer\n fpsRender = renderFrames\n fpsTimer = 0\n renderFrames = 0\nend\n\nIndustry:coInit()\nIndustry:coSchems()\nIndustry:coUpdate()\nIndustry:coOrganize()\nIndustry:coRender()\ncollectgarbage(\"collect\")","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"Commands:call(text)","filter":{"args":[{"variable":"*"}],"signature":"onInputText(text)","slotKey":"-4"},"key":"2"},{"code":"--[[if action:sub(1,6)=='option' then\n Commands:key(action)\nelseif action=='speedup' then\n Commands:key('r')\nelseif action=='gear' then\nend\n]]\nCommands:key(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"3"},{"code":"Commands:keyStop(action)","filter":{"args":[{"variable":"*"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"4"}],"methods":[],"events":[]} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------