-
Notifications
You must be signed in to change notification settings - Fork 1
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:
Returns the time of day in minutes(0 - 1439)
var t = get_timeofday();
Returns number days elapsed since world was created.
var t = get_day_count();
Returns the time in seconds (0 - 65535)
var t = get_sec_time();
Returns the time in milliseconds (0 - 65535)
var t = get_time();
Returns a pseudo-random number x such that l <= x <= u
// Prototype: get_random(l, u);
var num = get_random(0, 10);
Sends yourself a chat message (max. length is 40 words)
chat_msg("Hi!");
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);