Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joserobjr committed Sep 14, 2017
0 parents commit bd6866d
Show file tree
Hide file tree
Showing 124 changed files with 10,957 additions and 0 deletions.
16 changes: 16 additions & 0 deletions OpenComputers Lua API.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="LUA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/components" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/openos-libs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/floppy/data" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/floppy/network" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/apis" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Lua" jdkType="Lua SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
81 changes: 81 additions & 0 deletions OpenComputers Lua API.ipr
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactManager">
<artifact type="jar" build-on-make="true" name="openos-lua-api.zip">
<output-path>$PROJECT_DIR$/out/artifacts/openos_lua_api_zip</output-path>
<root id="archive" name="openos-lua-api.zip">
<element id="module-output" name="OpenComputers Lua API" />
</root>
</artifact>
</component>
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
</profile>
<version value="1.0" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/OpenComputers Lua API.iml" filepath="$PROJECT_DIR$/OpenComputers Lua API.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Kahlua" project-jdk-type="Lua SDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="masterDetails">
<states>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>Kahlua</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
48 changes: 48 additions & 0 deletions bios/_bios_global.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
math.huge = 0.0

---@class bios_component
component = {}

---@param address string
---@param method string
---@return string|nil
function component.doc(address, method) end

---@param filter string
---@param optional exact boolean
---@return table
function component.list(filter, exact) end

---@param filter string
---@return table
function component.list(filter) end

---@param address string
---@return table
function component.fields(address) end

---@param address string
---@param method string
---@param optional args any
---@return any
function component.invoke(address, method, args, ...) end

---@param address string
---@return string|nil, string
function component.type(address) end


---@param address string
---@return _cmp_prx|nil,string
function component.proxy(address) end

---@param address string
---@return table|nil, string
function component.methods(address) end

---@param address string
---@return number|nil, string
function component.slot(address) end


return component
37 changes: 37 additions & 0 deletions components/_component/_abstract_bus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---@class component.abstract_bus : component_proxy
local abstract_bus = {}

---Returns whether the local bus interface is enabled.
--- @return boolean
function abstract_bus.getEnabled() end

---Sets whether the local bus interface should be enabled
--- @param enabled boolean
function abstract_bus.setEnabled(enabled) end

---Returns the local interface address. number is a 16 bit hexadecimal number (0xFFFF being a broadcast). Returns 0 if an address has not yet been set.
--- @return number
function abstract_bus.getAddress() end

---Sets the local interface address. number is a 16bit hexadecimal number.
--- @param address number
function abstract_bus.setAddress(address) end

---Scans the abstract bus for attached devices and returns them in a list.
--- @param mask number
--- @return table
function abstract_bus.scan(mask) end

--- Sends data across the abstract bus. The table data is in the form of key-value pairs, e.g.
--- lua> component.abstract_bus.send(0xFFFF, { ["action"]="dial", ["address"]="Losomdeh Salothirt Erpac" })
--- See SGTech2 documentation for more info on the Abstract Bus.
--- @param address number
--- @param data table
--- @return boolean
function abstract_bus.send(address, data) end

---Returns the maximum size a packet can be sent over the bus.
--- @return number
function abstract_bus.maxPacketSize() end

return abstract_bus
20 changes: 20 additions & 0 deletions components/_component/_access_point.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---@class component.access_point : component_proxy
local access_point = {}

---Get the signal strength (range) used when relaying messages.
--- @return number
function access_point.getStrength() end

---Set the signal strength (range) used when relaying messages.
--- @param strength number
function access_point.setStrength(strength) end

---Check whether Access Point is acting as a repeater (re-send received wireless messages).
--- @return boolean
function access_point.isRepeater() end

---Sets whether Access Point should act as a repeater (re-send received wireless messages).
--- @param enabled boolean
function access_point.setRepeater(enabled) end

return access_point
51 changes: 51 additions & 0 deletions components/_component/_appeng/_me_exportbus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---@class component.me_exportbus : component_proxy
local me_exportbus = {}


---DEPRECATED, use getExportConfiguration.
---@param side number
---@param optional slot number
---@return boolean
function me_exportbus.getConfiguration(side, slot) end

---DEPRECATED, use setExportConfiguration.
---@param side number
---@param slot number
---@param database address
---@param entry number
---@return boolean
function me_exportbus.setConfiguration(side, slot, database, entry) end

---DEPRECATED, use setExportConfiguration.
---@param side number
---@param optional slot number
---@return boolean
function me_exportbus.setConfiguration(side, slot) end

---Get the configuration of the export bus pointing in the specified direction.
---@param side number
---@param optional slot
---@return boolean
function me_exportbus.getExportConfiguration(side, slot) end

---Configure the export bus pointing in the specified direction to export item stacks matching the specified descriptor.
---@param side number
---@param slot number
---@param database address
---@param entry number
---@return boolean
function me_exportbus.setExportConfiguration(side, slot, database, entry) end

---Configure the export bus pointing in the specified direction to export item stacks matching the specified descriptor.
---@param side number
---@param optional slot number
---@return boolean
function me_exportbus.setExportConfiguration(side, slot) end

---Make the export bus facing the specified direction perform a single export operation into the specified slot.
---@param side number
---@param slot number
---@return boolean
function me_exportbus.exportIntoSlot(side, slot) end

return me_exportbus
24 changes: 24 additions & 0 deletions components/_component/_appeng/_me_importbus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---@class component.me_importbus : component_proxy
local me_importbus = {}

---Get the configuration of the import bus pointing in the specified direction.
---@param side number
---@param optional slot number
---@return boolean
function me_importbus.getImportConfiguration(side, slot) end

---Configure the import bus pointing in the specified direction to import item stacks matching the specified descriptor.
---@param side number
---@param slot number
---@param database address
---@param entry number
---@return boolean
function me_importbus.setImportConfiguration(side, slot, database, entry) end

---Configure the import bus pointing in the specified direction to import item stacks matching the specified descriptor.
---@param side number
---@param optional slot number
---@return boolean
function me_importbus.setImportConfiguration(side, slot) end

return me_importbus
22 changes: 22 additions & 0 deletions components/_component/_appeng/_me_interface.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---@class component.me_interface : component_proxy
local me_interface = {}

---
---@param optional slot
---@return table
function me_interface.getInterfaceConfiguration(slot) end

---Configure the interface.
---@param optional slot number
---@param database address
---@param entry number
---@param optional size number
---@return boolean
function me_interface.setInterfaceConfiguration(slot, database, entry, size) end

---Configure the interface.
---@param optional slot number
---@return boolean
function me_interface.setInterfaceConfiguration(slot, database, entry, size) end

return me_interface
12 changes: 12 additions & 0 deletions components/_component/_chunkloader.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---@class component.chunkloader : component_proxy
local chunkloader = {}

---Returns whether the chunkloader is currently active.
--- @return boolean
function chunkloader.isActive() end

---Enables or disables the chunkloader. Returns the new state, which may be false if no chunk loading ticket could be acquired.
--- @param enabled boolean
function chunkloader.setActive(enabled) end

return chunkloader
26 changes: 26 additions & 0 deletions components/_component/_cofh/_ender_fluid.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---@class component.ender_fluid : component_proxy
local ender_fluid = {}


---Returns whether the tile entity can receive fluids.
---@return boolean
function ender_fluid.canReceiveFluid() end

---Returns whether the tile entity can send fluids.
---@return boolean
function ender_fluid.canSendFluid() end

---Returns the frequency.
---@return number
function ender_fluid.getFrequency() end

---Returns the name of the channel.
---@return string
function ender_fluid.getChannelString() end

---Sets the frequency to the given value. Returns whether the frequency change was successful
---@param frequency number
---@return boolean
function ender_fluid.setFrequency(frequency) end

return ender_fluid
25 changes: 25 additions & 0 deletions components/_component/_cofh/_ender_item.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---@class component.ender_item : component_proxy
local ender_item = {}

---Returns whether the tile entity can receive items.
---@return boolean
function ender_item.canReceiveItems() end

---Returns whether the tile entity can send items.
---@return boolean
function ender_item.canSendItems() end

---Returns the frequency.
---@return number
function ender_item.getFrequency() end

---Sets the frequency to the given value. Returns whether the frequency change was successful
---@param frequency number
---@return boolean
function ender_item.setFrequency(frequency) end

---Returns the name of the channel.
---@return string
function ender_item.getChannelString() end

return ender_item
14 changes: 14 additions & 0 deletions components/_component/_cofh/_energy_handler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---@class component.energy_handler : component_proxy
local energy_handler = {}

---Returns the amount of stored energy for the given side.
---@param optional direction number
---@return number
function energy_handler.getEnergyStored(direction) end

---Returns the maximum amount of stored energy for the given side
---@param optional direction number
---@return number
function energy_handler.getMaxEnergyStored(direction) end

return energy_handler
Loading

0 comments on commit bd6866d

Please sign in to comment.