Advertisement
i6_quadcore

inscritor

Mar 7th, 2025 (edited)
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.04 KB | None | 0 0
  1. local a="2.5.1b"local b="koro Inscrit\xf5r"local c={compact=true}local d=nil;local e=nil;local f=nil;local g=nil;local h=nil;local i={["success"]={24,0},["fail"]={1,0.1,1,0}}local function j(k)if g and i[k]then for l=1,#i[k],2 do g.playNote("bit",3,i[k][l])sleep(i[k][l+1])end end end;local function m(n)local o=fs.open(n,"r")if not o then return end;local p=textutils.unserialize(o.readAll())o.close()return p end;local function q(n)local o=fs.open(n,"w")o.write(textutils.serialize(h,c))o.close()end;local function r(s)return math.floor(s+(s-1)/3)end;local function t()local u={}local v={}for s=1,9 do local w=d.getItemDetail(s)if w then local x=w.name;u[s]=x;if w.maxCount~=64 then v[x]={stackSize=w.maxCount}end;local y=d.pushItems("bottom",s)if y>1 then e.pushItems("top",1)break end;turtle.select(r(s))turtle.suckDown()end end;turtle.select(16)turtle.craft()turtle.dropDown()local z=e.getItemDetail(1)if not z then return end;local A=z.name;if z.maxCount~=64 then v[A]={stackSize=z.maxCount}end;if z.count~=1 then u.yield=z.count end;e.pushItems("top",1)for s=1,9 do if turtle.getItemCount(r(s))>0 then turtle.select(r(s))turtle.dropDown()if not u.remnants then u.remnants={}end;u.remnants[s]=u[s]==e.getItemDetail(1).name and 1 or 2;e.pushItems("top",1)end end;turtle.select(1)return A,u,v end;local function B()term.clear()term.setCursorPos(1,1)print(b.." "..a.."\n")local C=nil;d=peripheral.wrap("top")e=peripheral.wrap("bottom")f=peripheral.find("drive")g=peripheral.find("speaker")if d==nil or e==nil or f==nil then print("Configurazion no valide")return end;rs.setOutput("top",true)turtle.select(1)print("Pront")while true do os.pullEvent("redstone")if rs.getInput("right")then if not f.isDiskPresent()then print("Mancjant archiviazion esterni")j("fail")else local D,u,v=t()if not D then print("Ricete no valide")j("fail")else C=f.getMountPath().."/cookbook.dat"h=m(C)if not h then print("Inizializazion dal ricetari...")h={recipes={},info={}}end;h.recipes[D]=u;for k,E in pairs(v)do h.info[k]=E end;q(C)print("Memorizade cun suc\xe8s: "..D)j("success")end end end end end;B()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement