@casual-simulation/aux-vm-client
Advanced tools
Changelog
V3.3.0
casualos
, and provides functionality to query the CasualOS backend API.login
- Authenticates the cilent to a CasualOS backend.query
- Queries a CasualOS backend.repl
- A Read-eval-print-loop (REPL) that makes interacting with the CasualOS backend via JavaScript really easy.os.calculateViewportCoordinatesFromPosition(portal, position)
- Calculates the viewport coordinates from the given 3D position in the portal.
portal
is the portal that the request is from (one of grid
, miniGrid
, map
, or miniMap
).position
is the 3D position in the portal.(X: 0, Y: 0)
represents the center of the camera while (X: -1, Y: -1)
represents the lower left corner and (X: 1, Y: 1)
represents the upper right corner.os.calculateViewportCoordinatesFromScreenCoordinates(portal, coordinates)
- Calculates the viewport coordinates from the given 2D screen position.
portal
is the portal that the request is for (one of grid
, miniGrid
, map
, or miniMap
).position
is the 2D position on the screen.os.calculateScreenCoordinatesFromViewportCoordinates(portal, coordinates)
- Calculates the screen coordinates from the given 2D viewport coordinates.
portal
is the portal that the request is for (one of grid
, miniGrid
, map
, or miniMap
).position
is the 2D viewport coordinates that the screen coordinates should be found for.transient-input
support for Apple Vision Pro.
superUser
user role.
none
, and superUser
.superUser
role.none
role.superUser
role, a user has access to some operations that they would not normally have access to, including:
getUserInfo
for all userscreateAccount
listSessions
for all userslistRecords
for all users and studioslistStudios
for all userslistStudioMembers
for all studiosgetSubscriptions
for all users and studiossessionKey
and a connectionKey
in the local storage of their web browser to keep them logged in.sessionKey
and connectionKey
query params are specified in the URL, they will be used instead of the stored ones.updateSubscription
operation (POST /api/v2/subscriptions/update
) to allow super users to grant a subscription to users or studios.
miniGridPortal
did not support using os.focusOn()
with a position.Changelog
V3.2.19
implements
, interface
, let
, package
, private
, protected
, public
, static
, yield
keywords are no longer allowed to be used as identifiers.Infinity
, undefined
, etc.) are no longer allowed.0
.
0
and having every digit less than 8
let num = 0123; // This does not equal 123, but is actually 83 in decimal
preact/compat
for custom apps.
preact/compat
improves Preact compatibility with React behavior and features.os.appCompat
API.
preact/compat
.Suspense
, lazy()
, createPortal()
, forwardRef()
, memo()
, and PureComponent
.createRef()
and createContext()
to os.appHooks
.@onGridClick
, @onGridUp
, and @onGridDown
shouts to all loaded insts.Changelog
V3.2.18
import
and export
statements.
import
and export
statements in scripts.import {abc} from "example.system.tag"
can be used to import the abc
variable or function from the bot with the example.system
system and the tag
tag.import { sortBy } from 'https://esm.run/lodash-es';"
imports the sortBy
function from the lodash-es
module provided by https://esm.run.casualos
module. This module exports all of CasualOS's built-in functions. It is the only module that cannot be overriden with @onResolveModule
. For example:
import { os } from 'casualos';
os.toast('Hello from my module!');
@onResolveModule
.
@onResolveModule
for more information.let casted = <any>value;
syntax for casting types is not supported since all scripts support JSX.📄
prefix for "library" scripts.
@
prefix. Using the @
prefix makes what we call a "listener script" or "listener tag".📄
prefix instead of @
. Using 📄
makes what we call a "library script" or "library tag".shout()
or whisper()
to communicate with a library script. Additionally, thisBot.script()
does not work either.os.toast()
, you have to first import the casualos
module. For example:
import { os } from 'casualos';
os.toast('Hello from my module!');
.transferControlToOffscreen()
and .getContext()
functions on <canvas>
HTML elements..setPointerCapture()
and .releasePointerCapture()
functions on HTML elements.?owner=player
in the URL while not being logged in would cause a public inst to be loaded instead of prompting the user to login.os.getCurrentInst()
would return undefined
if the inst is a static inst.