Globals
This 'types' section is incomplete, I have not written a generalised system for generating type documentation, and only have the bare bones version used in the 'objects' section.
Please note you can find the raw documentation here, I know it is hard to read, but you should be able to find any information you need in there.
This page is manually transcribed from the data and is not automatically generated.
- GetPartFromPort(Port | number port, string? className) → PilotObject
- Gets a part of the specified type from any port of the specified ID.
- GetPartsFromPort(Port | number port, string? className) → { PilotObject }
- Gets all the parts of the specified type from any port of the specified ID.
- GetPart(number? id) → PilotObject
- Gets a part of the specified type from any connected ports.
- GetParts(number? id) → { PilotObject }
- Gets all the parts of the specified type from any connected ports.
- GetPort(number? id) → Port
- Gets the connected port of the specified ID.
- GetPorts(number? id) → { Port }
- Gets all the connected ports of the specified ID. If no ID is specified it will get all connected ports.
- TriggerPort(Port | number port)
- Triggers the specified port.
- JSONDecode(string data) → JSON
- Encodes JSON. Proxy for
HttpService:JSONDecode
- Encodes JSON. Proxy for
- JSONEncode(JSON data) → string
- Encodes JSON. Proxy for
HttpService:JSONEncode
- Encodes JSON. Proxy for
- Beep(number? frequency)
- Produces a beep sound using a triangle wave.
- GetCPUTime() → number
- Returns the current elapsed CPU time.
- logError(string message, number? level)
- Logs an error in the output without yielding execution.
- pilot
- Provides functions for accessing/manipulating information about threads such as permissions, ownership, and interrupts.
- claimThread() → boolean
- Sets the thread's parent to the running thread. The target thread must be part of the sandbox and may not exist on a lower ring otherwise nothing will happen.
- getCPUTime() → number
- Returns the current elapsed CPU time.
- getRing() → number
- Gets the ring of the target (or running) thread.
- getThreadParent() → thread?
- Gets the parent of the target (or running) thread. The parent thread must be part of the sandbox and may not exist on a lower ring otherwise nil will be returned.
- getTimeout() → number
- Gets the current CPU timeout, or the CPU timeout that the given thread will obey.
- hasRing() → boolean
- Checks if the target (or running) thread has the specified ring privilege or lower.
- saveRing() → () → ()
- Creates a function which elevates the caller to the specified (or current) ring regardless of its privilege. You can use this to de-escalate, spawn a new thread, and then re-escalate your thread after. Requires ring 0 or lower.
- setInterrupt() → () → ()
- Will repeatedly call the interrupt every period CPU time on a valid resumption time (ignores yields/waits). Returns a function which deletes the interrupt.
- setRing()
- Sets the ring of the target (or running) thread. You can use .saveRing to store the current ring so you can escalate again later.
- setTimeout()
- Sets the CPU timeout of the given thread. Requires ring -1 or lower. This will not let you exceed the game's timeout, but will let you set lower timeouts. This has to do with whatever thread happens to be actively running. Currently there is not a way for you to recover from a timeout, so you should use .setInterrupt to handle your own custom timeouts.