Posted 12 April 2014 - 10:24 AM
Hi,
I've looked around to see if there is a way to create custom types in computercraft but there doesn't appear to be however after looking at some code from the peripheral API each peripheral seems to be a table of functions however I need to know how to make a function that references the table, this is my current code that i have gathered from the forums however the forums explain it quite poorly so it might not be correct code:
I've looked around to see if there is a way to create custom types in computercraft but there doesn't appear to be however after looking at some code from the peripheral API each peripheral seems to be a table of functions however I need to know how to make a function that references the table, this is my current code that i have gathered from the forums however the forums explain it quite poorly so it might not be correct code:
local version = "V1.0"
function help()
print("OpenPeripheral Render API "..version.." by Redstonedude")
end
function getNewRender()
return {setPeripheral = setPeripheralFunction, local peripheral = "peripheral string name goes here, code will change it"}
end
function setPeripheralFuncion(peripheral)
--code to set peripheral goes here
end