{"slots":{"0":{"name":"slot1","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":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"0"},"key":"0"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"1"},"key":"1"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"2"},"key":"2"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"3"},"key":"3"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"4"},"key":"4"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"5"},"key":"5"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"6"},"key":"6"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"7"},"key":"7"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"8"},"key":"8"},{"code":"onClick(x, y)","filter":{"args":[{"variable":"*"},{"variable":"*"}],"signature":"mouseDown(x,y)","slotKey":"9"},"key":"9"},{"code":"local a=\"V2.1.7\"\r\n\r\nPlayerContainerProficiency = 30 --export Your Container Proficiency bonus in total percent (Skills->Mining and Inventory->Inventory Manager)\r\nPlayerContainerOptimization = 0 --export Your Container Optimization bonus in total percent (Skills->Mining and Inventory->Stock Control)\r\nLowLevel = 25 --export Percent for low level indicator\r\nHighLevel = 50 --export Percent for high level indicator\r\nContainerMatch = \"C_(.+)\" --export Match for single item Storage Container names (e.g. \"C_Hematite\")\r\nOverflowMatch = \"O_(.+)\" --export Match for single item Overflow Container names (e.g. \"O_Hydrogen\")\r\nDisplayBlocks = \"t5 t4 gl pl a12 t3 t2 t1 ga\" --export Container types to display from top to bottom (t1-t5, pl, al, a12, a34, ga, gl)\r\nContRowsPerScreen = 20 --export Container rows per screen\r\nProdRowsPerScreen = 24 --export Production rows per screen\r\nAlignTop = false --export Align with top of screen\r\nWaitingAsAlarm = false --export Display waiting state with alarm colour\r\nKeepBlocksTogether = false --Don't break blocks across displays\r\nAnalyseThrottle = 400 --export Maximum Core Elements to process at once, lower this if you get an immediate CPU overload\r\nDataThrottle = 50 --export Maximum changes to process each update, lower this if you get CPU overloads after some time\r\nAnalyseDelay = .3 --export Rate at which core elements are initially analysed\r\nFirstDelay = .3 --export Delay before First calculations after analyse completes\r\nRefreshDelay = 5 --export Screen Refresh Rate\r\nMonitorDelay = 3 --export Rate at which changes are processed\r\nSkipHeadings = false --export No substance headings\r\nUS_Spellings = false --export Expect American spellings\r\n\r\ncontGap = 1.33 --export Cont Table gap (temporary)\r\nprodGap = 0.4 --export Prod Table gap (temporary)\r\nprodBase = 95 --export Prod Table base (temporary)\r\nprodScale = 1.0 --export Prod Table scale (temporary)\r\n\r\ncontDebug = false --export Container Debug Flag\r\noverloadDebug = false --export CPU overload Debug Flag\r\n\r\nlocal b=prodScale*(prodBase/ProdRowsPerScreen-prodGap)local c=100/ContRowsPerScreen-contGap;properties={Bauxite={density=1.2808,ore=true},Coal={density=1.3465,ore=true},Quartz={density=2.6498,ore=true},Hematite={density=5.0398,ore=true},Chromite={density=4.54,ore=true},Malachite={density=3.9997,ore=true},Limestone={density=2.7105,ore=true},Natron={density=1.5499,ore=true},Petalite={density=2.4119,ore=true},Garnierite={density=2.6,ore=true},Acanthite={density=7.1995,ore=true},Pyrite={density=5.0098,ore=true},Cobaltite={density=6.33,ore=true},Cryolite={density=2.9495,ore=true},Kolbeckite={density=2.37,ore=true},GoldNuggets={density=19.3,ore=true,short=\"GoldNug\"},Rhodonite={density=3.76,ore=true},Columbite={density=5.38,ore=true},Illmenite={density=4.55,ore=true},Vanadinite={density=6.95,ore=true},Hydrogen={density=0.069785,short=\"H₂\"},Oxygen={density=1.0000,short=\"O₂\"},Aluminium={density=2.7,short=\"Al\",usSpelling=\"Aluminum\"},Carbon={density=2.27,short=\"C\"},Silicon={density=2.33,short=\"Si\"},Iron={density=7.85,short=\"Fe\"},Calcium={density=1.55,short=\"Ca\"},Chromium={density=7.19,short=\"Cr\"},Copper={density=8.96,short=\"Cu\"},Sodium={density=0.97,short=\"Na\"},Lithium={density=0.53,short=\"Li\"},Nickel={density=8.91,short=\"Ni\"},Silver={density=10.49,short=\"Ag\"},Sulfur={density=1.82,short=\"S\"},Cobalt={density=8.9,short=\"Co\"},Fluorine={density=1.7,short=\"Fl\"},Gold={density=19.3,short=\"Au\"},Scandium={density=2.98,short=\"Sc\"},Manganese={density=7.21,short=\"Mn\"},Niobium={density=8.57,short=\"Ni\"},Titanium={density=4.51,short=\"Ti\"},Vanadium={density=6.00,short=\"Va\"},Silumin={density=3.00},Steel={density=8.05},AlFe={density=7.50},AlLi={density=2.50},CaRefCu={density=8.10},CuAg={density=9.20},Duralumin={density=2.80},[\"Stainless steel\"]={density=7.75,short=\"S.Steel\"},Inconel={density=8.5},[\"Maraging steel\"]={density=8.23,short=\"M.Steel\"},[\"Red gold\"]={density=14.13},ScAl={density=2.85},Polycarbonate={density=1.4,short=\"Polycarb\"},Polycalcite={density=1.5,short=\"Polycalc\"},Polysulfide={density=1.6,short=\"Polysulf\"},Fluoropolymer={density=1.65,short=\"Fl.Poly\"},Glass={density=2.5},[\"Advanced glass\"]={density=2.6,short=\"Adv.Glass\"},[\"AgLi reinforced glass\"]={density=2.8,short=\"AgLi Glass\"},[\"Gold coated glass\"]={density=3.0,short=\"Gold Glass\"}}local d={t5={Headers={\"T5 Ores\",\"T5 Pures\"},Rows={{\"Rhodonite\",\"Manganese\"},{\"Columbite\",\"Niobium\"},{\"Illmenite\",\"Titanium\"},{\"Vanadinite\",\"Vanadium\"}}},t4={Headers={\"T4 Ores\",\"T4 Pures\"},Rows={{\"Cobaltite\",\"Cobalt\"},{\"Cryolite\",\"Fluorine\"},{\"GoldNuggets\",\"Gold\"},{\"Kolbeckite\",\"Scandium\"}}},pl={Headers={\"Plastic\",\"Plastic\"},Rows={{\"Polycarbonate\",\"Polycalcite\"},{\"Polysulfide\",\"Fluoropolymer\"}}},gl={Headers={\"Glass\",\"Glass\"},Rows={{\"Glass\",\"Advanced glass\"},{\"AgLi reinforced glass\",\"Gold coated glass\"}}},al={Headers={\"T1/2 Alloys\",\"T3/4 Alloys\"},Rows={{\"Silumin\",\"AlLi\"},{\"AlFe\",\"CuAg\"},{\"Steel\",\"Inconel\"},{\"Duralumin\",\"Red gold\"},{\"CaRefCu\",\"Maraging steel\"},{\"Stainless steel\",\"ScAl\"}}},a12={Headers={\"T1 Alloys\",\"T2 Alloys\"},Rows={{\"Silumin\",\"Duralumin\"},{\"AlFe\",\"CaRefCu\"},{\"Steel\",\"Stainless steel\"}}},a34={Headers={\"T3 Alloys\",\"T4 Alloys\"},Rows={{\"AlLi\",\"Red gold\"},{\"CuAg\",\"Maraging steel\"},{\"Inconel\",\"ScAl\"}}},t3={Headers={\"T3 Ores\",\"T3 Pures\"},Rows={{\"Petalite\",\"Lithium\"},{\"Garnierite\",\"Nickel\"},{\"Pyrite\",\"Sulfur\"},{\"Acanthite\",\"Silver\"}}},t2={Headers={\"T2 Ores\",\"T2 Pures\"},Rows={{\"Natron\",\"Sodium\"},{\"Malachite\",\"Copper\"},{\"Limestone\",\"Calcium\"},{\"Chromite\",\"Chromium\"}}},t1={Headers={\"T1 Ores\",\"T1 Pures\"},Rows={{\"Bauxite\",\"Aluminium\"},{\"Hematite\",\"Iron\"},{\"Coal\",\"Carbon\"},{\"Quartz\",\"Silicon\"}}},ga={Headers={\"H₂\",\"O₂\"},Rows={{\"Hydrogen\",\"Oxygen\"},{\"Hydrogen\",\"Oxygen\",true}}}}local e={[\"electronics industry\"]=\"Elec. ind.\",[\"chemical industry\"]=\"Chem. ind.\",[\"metalworks industry\"]=\"Met. ind.\"}local f={basic=1,uncommon=2,advanced=3,rare=4}function slotValid(g)return g and type(g)==\"table\"and type(g.export)==\"table\"and g.getElementClass end;local h={}local i={}local j={}local k={}local l={}local m={}local n={[0]=\"No Schematic Set\"}local o=1;local p={on=false,id=0,stickers={}}local q=0;function onStart()if overloadDebug then system.print(\"onStart\")end;function setMessage(r,s)local t=[[
]]..s..[[
]]r.setHTML(t)end;for u,g in pairs(unit)do if slotValid(g)then if g.setHTML then g.activate()setMessage(g,\"If you see this you need to rename the screens...\")elseif not databank and g.getStringValue then databank=g elseif not core and g.getConstructId then core=g end end end;if not core then for u,g in pairs(unit)do if slotValid(g)then if g.setHTML then setMessage(g,\"Core Unit must be connected to the master board\")end end end;return end;q=2^math.floor(math.log(core.getMaxHitPoints(),10)+3)for u,g in pairs(unit)do if slotValid(g)then if g.setHTML then local v=g.getId()if v then local w=core.getElementNameById(v)local type,x=string.match(w,\"(.*)Display(%d)\")if type and x then x=tonumber(x)if type==\"Cont\"then if h[x]then h[x].screens[v]=g else h[x]={screens={[v]=g}}end;setMessage(g,\"If you see this you may need to restart the master board\")elseif type==\"Prod\"then if i[x]then i[x].screens[v]=g else i[x]={screens={[v]=g}}end;setMessage(g,\"If you see this you may need to restart the master board\")end end end end end end end;function analyseCore()if overloadDebug then system.print(\"Analyse Core\")end;function extractSubstanceName(w,y)local z=string.gsub(w,y,\"\")return z end;function getBaseCointainerProperties(v)local A=core.getElementMaxHitPointsById(v)if A<124 then return 0.0,0.0 elseif A<999 then return 229.09,1000.0 elseif A<7997 then return 1281.31,8000.0 elseif A<17316 then return 7421.35,64000.0 elseif A<34633 then return 14842.7,128000.0 elseif A<69267 then return 44210.0,256000.0 else return 88410.0,512000.0 end end;function addContainer(v,type)if#h==0 then return false end;if not string.lower(type):match(\"^container\")then return false end;local w=core.getElementNameById(v)if not w then return true end;if contDebug then system.print(\"Checking container: \"..w..\" [\"..v..\"] against name matches\")end;local B=false;local z=string.match(w,\"^\"..ContainerMatch)if not z then z=string.match(w,\"^\"..OverflowMatch)if not z then if contDebug then system.print(\" Ignoring because no name match\")end;return end;B=true end;local C=properties[z]if not C then if contDebug then system.print(\" Ignoring because \"..z..\" not tracked\")end;return true end;local D,E=getBaseCointainerProperties(v)capacity=E*(1.0+PlayerContainerProficiency/100)if contDebug then system.print(\"Adding container: \"..w..\" [\"..v..\"] storing \"..z)end;j[v]={name=w,id=v,substance=z,capacity=capacity,selfMass=D,property=C,overflow=B,isHub=E==0}return true end;function addIndustry(v,type)if#i==0 then return false end;local F,G=string.match(type,\"(%S+)%s(.+)\")if not F or not G then return false end;local H=string.lower(F)if not f[H]then return false end;local w=core.getElementNameById(v)local I=string.lower(G)local J=e[I]or G;local K={name=w,industry=G,shortType=J,id=v,tier=H}if I==\"assembly line\"then K.assembly=true;local L,M=assemblySize(v)K.sortKey=L*100000+f[H]*10000+v;K.size=M else K.sortKey=G..\"_\"..w..\"_\"..v end;table.insert(k,K)return true end;local N=core.getElementIdList()local O=AnalyseThrottle;local P=#N;for Q,v in ipairs(N)do local type=core.getElementTypeById(v)if not addContainer(v,type)then addIndustry(v,type)end;O=O-1;P=P-1;if O==0 then coroutine.yield(P)O=AnalyseThrottle end end end;local R={\"XS\",\" S\",\" M\",\" L\",\"XL\"}function assemblySize(v)local S=core.getElementMassById(v)local L=math.floor(math.log(S-90,10)+0.1)return L,R[L]end;tolColours={blue=\"#332288\",cyan=\"#66CCEE\",green=\"#228833\",yellow=\"#CCBB44\",red=\"#EE6677\",purple=\"#AA3377\",grey=\"#BBBBBB\",darkYellow=\"#666633\"}local T=\"darkslategray\"local U=tolColours.green;local V=tolColours.cyan;local W=tolColours.yellow;local X=tolColours.red;local Y=\"alignBottom\"if AlignTop then Y=\"alignTop\"end;local Z=[[]]local _={d1=[[
]],de=[[
]],tc=[[]],tp=[[
]],te=[[
]],tr=[[]],tr2=[[]],tre=[[]],th=[[]],thL=[[]],thL2=[[]],thR=[[]],th3=[[ ]],the=[[]],nbr=[[]],nbre=[[]]}function cell(a0,s,a1,a2,M)local a3=\"\"if a1 then a3=a3 ..\" text-align:\"..a1 ..\";\"end;if a2 then a3=a3 ..\" color:\"..a2 ..\";\"end;if M then a3=a3 ..\" font-size:\"..M..\";\"end;if a3 then a3=[[ style=\"]]..a3 ..[[\"]]end;return[[]]..s..[[]]end;function refreshContainerDisplay(a4)local a5={}function processSubstanceContainer(a6)local a7=(core.getElementMassById(a6.id)-a6.selfMass)*(1.0+PlayerContainerOptimization/100)local a8=a7/a6.property.density;local a9=a6.substance;if a6.overflow then a9=\"O_\"..a6.substance end;if a5[a9]then a5[a9].volume=a5[a9].volume+a8;a5[a9].contentMass=a5[a9].contentMass+a7;a5[a9].capacity=a5[a9].capacity+a6.capacity else a5[a9]={substance=a6.substance,volume=a8,contentMass=a7,capacity=a6.capacity,overflow=a6.overflow}end;if contDebug then system.print(a6.name..\" \"..a6.substance..\" : contentMass : \"..a5[a9].contentMass)end end;for Q,a6 in pairs(j)do processSubstanceContainer(a6)end;function statusColour(aa,ab)if ab then aa=100.0-aa end;if aa<=LowLevel then return X end;if aa<=HighLevel then return W end;return U end;function barGraph(a0,aa,a2)return[[
]]end;function correctSpelling(s)if US_Spellings and properties[s]and properties[s].usSpelling then return properties[s].usSpelling end;return s end;function displayFormat(z,B)local s=correctSpelling(z)local a9=z;if B then a9=\"O_\"..z end;local ac=a5[a9]local ad=properties[z].short;if B then if ad then s=ad..\" Overflow\"else s=s..\" OF\"end elseif s:len()>10 and ad then s=ad end;if not ac then if B then return nil end;return\"?\",0.0,\"kℓ\",s end;local a8=ac.volume;local aa=math.min(100.0*a8/ac.capacity,100.0)if a8>=1000000 then return string.format(\"%02.1f\",a8/1000000),aa,\"Mℓ\",s end;return string.format(\"%02.1f\",a8/1000),aa,\"kℓ\",s end;function addSubstanceDisplay(ae,af,aa,ab,a8)local a2=statusColour(aa,ab)local ag=false;if a2==X and a8~=\"?\"then ag=X end;return cell(\"18%\",ae,false,ag)..cell(\"13%\",af,\"right\")..barGraph(\"17%\",aa,a2)end;function newHTMLRow(ah)local ai,aj,ak,ae=displayFormat(ah.text1,ah.overflow)if not ai then return\"\"end;local al,am,an,af=displayFormat(ah.text2,ah.overflow)local ao=\" \"local ap=statusColour(am,ah.overflow)local aq=false;if ap==X and al~=\"?\"then aq=X end;return _.tr..addSubstanceDisplay(ae,ai..ak,aj,ah.overflow,ai).._.th..ao.._.the..addSubstanceDisplay(af,al..an,am,ah.overflow,al).._.tre end;function newHTMLHeader(ah)return _.tr2 ..[[]]..ah.text1 ..[[]]..ah.text2 ..[[]].._.tre end;local ar={}function addRow(as,at,B)ar[#ar+1]={text1=as,text2=at,overflow=B}end;function addHeaderRow(as,at)if not SkipHeadings then ar[#ar+1]={text1=as,text2=at,header=true}end end;for a9 in DisplayBlocks:gmatch(\"%S+\")do local au=d[a9]if au then addHeaderRow(au.Headers[1],au.Headers[2])for Q,ah in ipairs(au.Rows)do addRow(ah[1],ah[2],ah[3])end end end;function addDisplayRows(av)local aw={}local t=_.d1 .._.tc;local ax=#ar-ContRowsPerScreen*av+1;local ay=ax+ContRowsPerScreen-1;ax=math.max(ax,1)for az=ax,ay do local ah=ar[az]if not ah then break end;table.insert(aw,ah)if ah.header then t=t..newHTMLHeader(ah)else t=t..newHTMLRow(ah)end;az=az+1 end;t=t.._.te.._.de;return t,aw end;for aA,aB in pairs(a4)do local t,aw=addDisplayRows(aA)aB.rows=aw;for v,aC in pairs(aB.screens)do aC.setHTML(Z..t)end end end;function refreshIndustryScreens(a4)local ar={}function addRow(v,as,at,aD,aE,a2,M)ar[#ar+1]={id=v,text1=as,text2=at,text3=aD,text4=aE,colour=a2,size=M}end;function addHeaderRow(as,at,aD,aE)if not SkipHeadings then ar[#ar+1]={text1=as,text2=at,text3=aD,text4=aE,header=true}end end;local aF={}for aG in pairs(m)do table.insert(aF,aG)end;table.sort(aF)local aH={}for aG in pairs(l)do table.insert(aH,aG)end;table.sort(aH)local aI=#k-#aH;addHeaderRow(\"Machine\",\"Making [\"..#aF..\"/\"..aI..\"]\",\"#\",\"Alert\")for Q,aG in ipairs(aF)do local aJ=m[aG]local a2=X;local aK=aJ.status.state;if aK==\"JAMMED_MISSING_INGREDIENT\"then if WaitingAsAlarm then a2=X else a2=W end;aK=\"WAITING\"elseif aK==\"JAMMED_OUTPUT_FULL\"then a2=X;aK=\"OUTPUT FULL\"elseif aK:find(\"JAMMED\")==1 then a2=X end;local aL=n[aJ.status.schematicId]addRow(aJ.id,aJ.shortType,aL,aJ.id,aK,a2,alertFontSize)end;if#aH>0 then addHeaderRow(\"Assm.\",\"Making\",\"#\",\"Status\")for Q,aG in pairs(aH)do local aM=l[aG]local a2=X;local aK=aM.status.state;if aK==\"JAMMED_MISSING_INGREDIENT\"then if WaitingAsAlarm then a2=X else a2=W end;aK=\"WAITING\"elseif aK==\"RUNNING\"then a2=U elseif aK==\"STOPPED\"or aK==\"PENDING\"then a2=V elseif aK==\"JAMMED_OUTPUT_FULL\"then a2=X;aK=\"OUTPUT FULL\"elseif aK==\"JAMMED_NO_OUTPUT_CONTAINER\"then a2=X;aK=\"NO OUT\"elseif aK:find(\"JAMMED\")==1 then a2=X end;local aL=n[aM.status.schematicId]addRow(aM.id,aM.size..\"-T\"..f[aM.tier],aL,aM.id,aK,a2)end end;function newHTMLRow(ah)local a3=\"\"if ah.colour then a3=a3 ..\" color:\"..ah.colour..\";\"end;if p.on and ah.id==p.id then a3=a3 ..\" background-color:\"..tolColours.darkYellow..\";\"end;if a3 then a3=[[ style=\"]]..a3 ..[[\"]]end;return[[\r\n]].._.thL..[[ \r\n]].._.thL.._.nbr..ah.text1 .._.nbre..[[\r\n]].._.thL.._.nbr..ah.text2 .._.nbre..[[\r\n]].._.thR.._.nbr..ah.text3 .._.nbre..[[ \r\n]].._.thL.._.nbr..ah.text4 .._.nbre..[[\r\n]]end;function newHTMLHeader(ah)return _.tr2 ..[[]]..ah.text1 ..[[]]..ah.text2 ..[[]]..ah.text3 ..[[ ]]..ah.text4 ..[[]].._.tre end;function addDisplayRows(av)local aw={}local t=_.d1 .._.tp;local ax=#ar-ProdRowsPerScreen*av+1;local ay=ax+ProdRowsPerScreen-1;ax=math.max(ax,1)for az=ax,ay do local ah=ar[az]if not ah then break end;table.insert(aw,ah)if ah.header then t=t..newHTMLHeader(ah)else t=t..newHTMLRow(ah)end;az=az+1 end;t=t.._.te.._.de;return t,aw end;for aA,aB in pairs(a4)do local t,aw=addDisplayRows(aA)aB.rows=aw;for v,aC in pairs(aB.screens)do aC.setHTML(Z..t)end end end;function refreshScreens()refreshContainerDisplay(h)refreshIndustryScreens(i)end;function processFirst()if contDebug or overloadDebug then system.print(\"Tick First\")end;unit.stopTimer(\"First\")refreshScreens()end;function processChanges()if contDebug or overloadDebug then system.print(\"Tick Statuses\")end;function lookupSchematic(aN)if n[aN]then return end;local aO=core.getSchematicInfo(aN)local aP=json.decode(aO)if not aP.products then n[aN]=\"Unknown#\"..aN;return end;n[aN]=aP.products[1].name end;function processStatus(K)local aQ=core.getElementIndustryStatus(K.id)local aR=json.decode(aQ)K.status=aR;if K.assembly then lookupSchematic(aR.schematicId)l[K.sortKey]=K;return end;if aR.state and aR.state:find(\"JAMMED\")==1 then lookupSchematic(aR.schematicId)m[K.sortKey]=K else m[K.sortKey]=nil end end;local O=math.min(DataThrottle,#k)if overloadDebug then system.print(\"#industries=\"..#k..\" max=\"..O..\" DataThrottle=\"..DataThrottle)end;local x=o;for az=1,O do processStatus(k[x])x=x+1;if x>#k then x=1 end end;o=x end;function processTick()if contDebug or overloadDebug then system.print(\"Tick Live\")end;refreshScreens()end;function onStop()for Q,g in pairs(unit)do if slotValid(g)then if g.setHTML then g.clear()end end end end;function HideHighlight()p.on=false;if#p.stickers==0 then return end;for az in pairs(p.stickers)do core.deleteSticker(p.stickers[az])end;p.stickers={}end;function ShowHighlight()p.on=true;table.insert(p.stickers,core.spawnArrowSticker(p.x+p.xoffset,p.y,p.z,\"north\"))table.insert(p.stickers,core.spawnArrowSticker(p.x,p.y-p.yoffset,p.z,\"east\"))table.insert(p.stickers,core.spawnArrowSticker(p.x-p.xoffset,p.y,p.z,\"south\"))table.insert(p.stickers,core.spawnArrowSticker(p.x,p.y+p.yoffset,p.z,\"west\"))table.insert(p.stickers,core.spawnArrowSticker(p.x,p.y,p.z-p.zoffset,\"up\"))table.insert(p.stickers,core.spawnArrowSticker(p.x,p.y,p.z+p.zoffset,\"down\"))end;function HighlightElement(v)if p.on then HideHighlight()end;p.id=v;local aS=vec3(core.getElementPositionById(v))p.x=aS.x-q;p.y=aS.y-q;p.z=aS.z-q;local M=3.1*(math.log(core.getElementMassById(v),10)-1.0)p.xoffset=M;p.yoffset=M;p.zoffset=M;ShowHighlight()end;function screenClicked(aT,aU,v,r,ar)local aV=math.floor(#ar-ProdRowsPerScreen*(1-aU)+1)local ah=ar[aV]if not ah.id then return end;if ah.id==p.id then HideHighlight()else HighlightElement(ah.id)end;refreshIndustryScreens(i,false)end;function onClick(aT,aU)for aA,aB in pairs(i)do for v,r in pairs(aB.screens)do if r.getMouseX()~=-1 and r.getMouseY()~=-1 then screenClicked(aT,aU,v,r,aB.rows)return end end end end;function processAnalysis()unit.stopTimer(\"Analyse\")if overloadDebug then system.print(\"Analyse Tick\")end;local Q,aW=coroutine.resume(AnalyseCo)if aW then if overloadDebug then system.print(\"Analyse yielded, elements left: \"..aW)end;unit.setTimer(\"Analyse\",AnalyseDelay)return end;unit.setTimer(\"First\",FirstDelay)unit.setTimer(\"Live\",RefreshDelay)unit.setTimer(\"MonitorChanges\",MonitorDelay)end;system.print(\"InDUstry Status \"..a)local databank=nil;onStart()if not core then system.print(\"InDUstrious Error: Core must be linked to a slot\")else AnalyseCo=coroutine.create(analyseCore)unit.setTimer(\"Analyse\",AnalyseDelay)end","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"10"},{"code":"onStop()","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"11"},{"code":"processFirst()","filter":{"args":[{"value":"First"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"12"},{"code":"processTick()","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"13"},{"code":"processChanges()","filter":{"args":[{"value":"MonitorChanges"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"14"},{"code":"processAnalysis()","filter":{"args":[{"value":"Analyse"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"15"}],"methods":[],"events":[]}