-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuclear.lua
More file actions
1 lines (1 loc) · 3.92 KB
/
Copy pathnuclear.lua
File metadata and controls
1 lines (1 loc) · 3.92 KB
1
local t='&a,b,c,d,e=component,computer,coroutine,error,"redstone_changed"&f,g,h,i,j,k=a.list,a.proxy,b.uptime,b.pullSignal,b.pushSignal,c.yield;&l,m=g(f("transposer")()),g(f("redstone")())&n,o,p,q,r=l.getAllStacks,l.transferItem,l.getStackInSlot,l.getInventorySize,m.setOutput;&s={[3]=0.8,[6]=0.5,[9]=0.5,[10]=0.7,[15]=0.7,[22]=0.9,[26]=1,[29]=1,[33]=0.9,[40]=0.7,[45]=0.7,[46]=0.5,[49]=0.5,[52]=0.8}&t,u,v,w,x,y,z,A,B,C={},{},{},{}&D,E={1,[0]=0}&F={0,0,0,0,0,[0]=0}&&@ G(H)if E $E[H]=1;repeat k()until D[H]@& @;E={[H]=1}::I::for J=5,2,-1 do if w[J]and not E[J]$k()goto I @ @;&K,L={0,2,0,3,1},{}for J=2,5 do if w[J]$L[J]=p(J,1).tag @ @;for J=5,2,-1 do r(J,1)&M=h()+1;while h()<M do k()@;r(J,0)for N=2,5 do if w[N]and p(N,1).tag~=L[N]$for O=2,5 do D[O]=({3,5,2,4})[(K[O]+K[J]-K[N])%4+1]@;@& @ @ @ @;&&@ P(H,Q)if F[H]~=Q $if D[H]$F[H]=Q;&R=r(D[H],Q)k()@& R else G(H)A=nil;j(e)@ @ @;&&@ S()B=B and 0 or nil;for H,T in pairs(t)do t[H],v[H],u[H]={},{},{}&U=0;for V in l.getAllStacks(H)do U=U+1;&W,X=V.name,V.size;if W==x $t[H][U]=X elseif W==z and V.damage<70 $v[H][U]=1 elseif y and W==y $u[H][U]=X @;if B and not W $B=U @ @ @;if B==0 $d("ME接口已满")@ @;&Y,Z,_="燃料棒","冷却单元","缺少"&&@ a0(U,a1)&a2=t;if s[U]$a2=v elseif y and U%2==0 $a2=u @;for O,a3 in pairs(a2)do for J,N in pairs(a3)do if N>0 $if not B $a3[J]=N-1 @;@& O,J @ @ @;S()if a1 $r({0,0,0,0,0,[0]=0})b.shutdown(1)@;@& a0(U,1)@;&&@ a4(H)&a5,a6,a7,a8={},{},{},5;&a9=n(H)for J=1,54 do &V=a9()&W,aa=V.name,V.damage;a7[J]=W;if s[J]$if W~=z or aa>99-2*s[J]$a5[#a5+1]=J else if aa>98-4*s[J]$a6[#a6+1]=J @;a8=math.min(a8,(98-aa)/s[J]-3)@ elseif y and J%2==0 $if W~=y $a5[#a5+1]=J @ elseif W~=x $a5[#a5+1]=J @ @;if a5[1]$for T,U in ipairs(a6)do a5[#a5+1]=U @;if P(H,0)$&ab=h()+1;while h()<ab do k()@ else S()@;for T,U in ipairs(a5)do::ac::&ad,ae=a0(U)if a7[U]$if o(table.unpack({H,C,1,U,B}))<1 $S()goto ac @;a7[U]=nil @;if o(ad,H,1,ae,U)<1 $S()goto ac @ @ else &ab=h()+math.max(a8,0.3)P(H,A and 1 or 0)while h()<ab do if k()$break @ @ @ @;&af,ag="gregtech:gt.","_Coolantcell"&ah={[af.."rodThorium4"]=4,[af.."rodUranium4"]=13,[af.."rodHighDensityUranium4"]=13,[af.."rodMOX4"]=13,[af.."rodHighDensityPlutonium4"]=13,[af.."rodNaquadria4"]=13,[af.."rodNaquadah32"]=1050,[af.."rodTiberium4"]=13,[af.."rodExcitedUranium4"]=200,[af.."rodExcitedPlutonium4"]=200}&ai={[af.."60k_Helium"..ag]=6,[af.."180k_Helium"..ag]=18,[af.."360k_Helium"..ag]=36,[af.."60k_NaK"..ag]=6,[af.."180k_NaK"..ag]=18,[af.."360k_NaK"..ag]=36,[af.."180k_Space"..ag]=18,[af.."360k_Space"..ag]=36,[af.."540k_Space"..ag]=54,[af.."1080k_Space"..ag]=108,[af.."neutroniumHeatCapacitor"]=1e5}for J=0,5 do &&@ aj()&a9,ak=n(J),0;for N=1,a9.count()do &V=a9()&W=V.name;if ah[W]$if x and x~=W $if ah[x]+ah[W]==1250 $y=W;if ah[x]<ah[y]$x,y=y,x @ else d("不支持的混合"..Y)@ @;x,t[J]=y and x or W,{}elseif ai[W]and V.damage<70 $if z and z~=W $d("必须为一种"..Z)@;z,t[J]=W,{}else ak=ak+1 @ @;@& ak==a9.count()@;&W=q(J)~=0 and l.getInventoryName(J)if W=="blockReactorChamber"$if q(J)<54 $d("必须为六仓反应堆")@;w[J]={side=J}elseif W=="tile.appliedenergistics2.BlockInterface"or W=="tile.fluid_interface"$if B $d("存在多个ME接口")@;B,t,x,z=0,{}aj()C=J elseif W and not B and aj()$C=J @ @;if not x $d(_..Y)@;if not z $d(_..Z)@;if not C $d(_.."输出容器")@;if not next(w)$d(_.."反应堆")@;if y $s={[3]=0.2,[6]=0.5,[9]=0.1,[10]=0.7,[15]=0.2,[22]=0.9,[26]=1,[29]=0.2,[33]=0.2,[40]=0.7,[45]=0.2,[46]=0.5,[49]=0.1,[52]=0.8}@;for U,al in pairs(s)do s[U]=ah[x]/ai[z]*al @;if s[26]>10 $d(Z.."热容过小")@;for H,T in pairs(t)do u[H]={}v[H]={}@;S()for H,T in pairs(w)do w[H]=c.wrap(&@()while 1 do a4(H)@ @)@;&&@ am(an)@& &@(...)&R=an(...)k()@& R @ @;n=am(n)o=am(o)p=am(p)j(e)while 1 do &ao;&ap=i(0.05)if ap==e $&aq=m.getInput()for J=0,5 do if not w[J]and aq[J]>0 $ao=not A;A=1;goto ar @ @;ao=A;A=nil;if ao $F={0,0,0,0,0,[0]=0}r(F)@::ar::@;for T,as in pairs(w)do as(ao)@ @';load(t:gsub("&@","function"):gsub("@&","return"):gsub("%$","then "):gsub("&","local "):gsub("@","end"))()