i have a program in CC, but it is not working at the moment because CC has some issues with bundled cabels and SFM does not want to interact with EnderIO redstone conduit.
So i ve change to OC. After 10 hour of looking throw and trying to learn how to do the code properly i have some basic things how they work, or at least i think that i do.
My question. can sombody tell me or show me simple code how to call table in difrent program ?
How to create folder on hardisk and then create programs in that folder ?
(i ve use filesystem.makeDirectory(Stock/Stock) as my HDD is labeled Stock , it made a folder Stock but when i use inside the stock edit ***.lua then save it and then used command ls in Stock it showed all program which are in main drive after instaling openOS.)
How to add path to packed.path ?
I will post the program from pastbin so you can see what i am trying to do. I would like to recreate the same on OC. so far i was not able to do so.
os.loadAPI("keeplistAPI")
rs.setBundledOutput("bottom",0)
local aeSide = "right" -- side where is interface connected
local bunSide = "bottom" -- side where bundled cabel is connected
local ae = peripheral.wrap(aeSide)
function findUpdated(keepItem)
local newlist = ae.getAvailableItems()
for number,item in pairs(newlist) do
if keepItem["id"] == item.fingerprint.id
and keepItem["dmg"]== item.fingerprint.dmg
and keepItem["nbt_hash"] == item.fingerprint.nbt_hash
then lvlStock(keepItem["keepqty"], item.size, keepItem["color"])
end
end
end
function lvlStock( kItemQty , aeItemQty , barva)
if kItemQty <= aeItemQty then rs.setBundledOutput(bunSide,colors.subtract(rs.getBundledOutput(bunSide),barva))
print("True")
else rs.setBundledOutput(bunSide,colors.combine(rs.getBundledOutput(bunSide),barva))
print("False")
end
end
while true do
for i=1,#keeplistAPI.keeplist do
findUpdated(keeplistAPI.keeplist[i])
end
sleep(5)
end
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hi,
i have a program in CC, but it is not working at the moment because CC has some issues with bundled cabels and SFM does not want to interact with EnderIO redstone conduit.
So i ve change to OC. After 10 hour of looking throw and trying to learn how to do the code properly i have some basic things how they work, or at least i think that i do.
My question. can sombody tell me or show me simple code how to call table in difrent program ?
How to create folder on hardisk and then create programs in that folder ?
(i ve use filesystem.makeDirectory(Stock/Stock) as my HDD is labeled Stock , it made a folder Stock but when i use inside the stock edit ***.lua then save it and then used command ls in Stock it showed all program which are in main drive after instaling openOS.)
How to add path to packed.path ?
I will post the program from pastbin so you can see what i am trying to do. I would like to recreate the same on OC. so far i was not able to do so.
Thank you
this is the API
And this is the main program.
Link to post
Share on other sites