Cboy / CodeOS Documentation

Small Updates added to Cboy / CodeOS to refine it’s data.

1 Like

Instead of copying and pasting the link, I will copy and paste the source code for y’all
You guys can test it out (JavaScript) but you guys will need the Settings and Text Sprite Extentions in order for the OS to function properly.
image

function remainderstorage () {

    Remainder = 80 - blockSettings.list().length

    return Remainder

}

let Remainder = 0

let maintextSprite = textsprite.create("CodeOS v0.01")

maintextSprite.setPosition(77, 10)

let textSprite = textsprite.create("" + blockSettings.readNumber("Storage") + " settings ")

textSprite.setPosition(77, 20)

game.onUpdateInterval(50, function () {

    spriteutils.setConsoleOverlay(false)

    blockSettings.writeNumber("Storage", blockSettings.list().length)

    blockSettings.writeNumber("MaxStorageSpace", 80)

    blockSettings.writeNumber("HardwareManager", remainderstorage())

    console.log("" + blockSettings.readNumber("Storage") + " settings " + ("" + blockSettings.readNumber("HardwareManager") + " settings    left"))

})

forever(function () {

    textSprite.setText("" + blockSettings.readNumber("Storage") + " settings ")

    textSprite.setPosition(80, 20)

    pause(1000)

    textSprite.setText("" + blockSettings.readNumber("HardwareManager") + " settings left")

    textSprite.setPosition(77, 20)

    pause(1000)

})
1 Like