Skip to content

Other Utilities & System Functions

Overview

The Other section of the cee API contains general utility and interaction methods for managing the computer's environment, handling events, and manipulating system-level operations in CC: Computer Energetics.


Calling Conventions / Prefixes

Functions in this section are accessed via the global cee namespace:

cee.setScreenButtonMode("event")

API Reference Table

Method Signature Arguments & Types Description
cee.getAnalog(pin) pin (number) Reads the analog value from a specified pin (0–1).
cee.setScreenButtonMode(mode) mode (string, "switch" or "event") Sets the behavior of the screen button.
cee.getScreenButtonMode() None Returns the current mode of the screen button.
cee.getScreen() None Returns the computer’s terminal screen handle.
cee.setScreenSize(width, height) width (number), height (number) Resizes the screen to specified character dimensions.
cee.getScreenSize() None Returns the width and height of the screen in characters.

Lua Code Examples

Example 1: Reading Analog Input

local value = cee.getAnalog(1)
print("Analog value:", value)

Example 2: Setting Screen Button Mode

cee.setScreenButtonMode("event")

while true do
    local _, name = os.pullEvent("cee_button")
    if name == "screen" then
        print("Screen button pressed!")
    end
end