Skip to content

List of API functions for mods OpenComputers and CC:Tweaked

Zuxelus edited this page Jun 10, 2020 · 2 revisions

List of API functions for mods OpenComputers and CC:Tweaked

General Info

OpenComputers
Put Information Panel block close to Adapter block. Check with Analyzer (Shift + right click) that Adapter can see Panel block.
In computer open lua and find the block as a component
/home # lua
Lua 5.2 Copyright (C) 1994-2017 ...
lua> info=component.info_panel_advanced
lua> info.getCardData()
{n=0}
lua> info.getCardData()
{"29 640",
"40 000",
"10 360",
"74.1",
n=4}
lua>

CC:Tweaked
Put Information Panel block close to Computer block.
In computer open lua and set the block as a pheripheral.
> lua
Interactive Lua promt.
lua> info=peripheral.wrap("right")
lua> info.getCardData()
{}
lua> info.getCardData()
{
"29 640",
"40 000",
"10 360",
"74.1"
}

Advanced Info Panel

boolean isActive() - Checks if panel is powered.
int getRange() - Get panel card range.
List<String> getCardData - Get list of strings showed on the panel. If no cards return empty.
int getColorBack() - Get background color.
int getColorText() - Get font color.
setColorBack(int color) - Set background color. (0..15)
setColorText(int color) - Set font color. (0..15)
string getCardTitle(int slot) - Get card title from the slot. (0..2)
setCardTitle(int slot, string) - Set card title from the slot. (0..2)
int getThickness() - Get panel thickness.
setThickness(int) - Set panel thickness. (1..16)
int getRotHor() - Get panel horizonal rotation.
setRotHor(int) - Set panel horizonal rotation. (-8..8)
int getRotVert() - Get panel vertical rotation.
setRotVert(int) - Set panel vertical rotation. (-8..8)