Skip to content

OS Functions

Joachim Stolberg edited this page Jul 10, 2022 · 4 revisions

Import the file os.c to be able to use the functions.

Beduino supports the following "OS" like function:

get_timeofday

Returns the time of day in minutes(0 - 1439)

var t = get_timeofday();

get_day_count

Returns number days elapsed since world was created.

var t = get_day_count();

get_sec_time

Returns the time in seconds (0 - 65535)

var t = get_sec_time();

get_time

Returns the time in milliseconds (0 - 65535)

var t = get_time();

get_random

Returns a pseudo-random number x such that l <= x <= u

// Prototype: get_random(l, u);
var num = get_random(0, 10);

chat_msg

Sends yourself a chat message (max. length is 40 words)

chat_msg("Hi!");

get_description

Copy the description text of name to desc_buff. lang_code is needed for the translation (e.g. "en" or "de")

// Prototype: get_description(name, lang_code, desc_buff)
get_description("default:dirt", "de", s);
Clone this wiki locally