General
Look at Read Only Variables' Home first.
These variables are Tables that contain a lot of functions and that can be considered as different libraries for what they do.
globalCallbacks [Table]
key | type | value |
---|---|---|
onBClear | Function | Function that gets called every time bClear() is used |
onSetMonitor | Function | Function that gets called every time setMonitor() is used |
globalMonitorBuffer [Table]
key | type | value |
---|---|---|
enabled | boolean | Says if globalMonitorBuffer is enabled |
frames | table | Contains the last and the new frame |
clear | function | Clears frames.newFrame table |
write | function | Writes on frames.newFrame table |
draw | function | Draws frames.newFrame table |
This makes possible to check what color and what text is displayed on a pixel on the screen by looking into globalMonitorBuffer.frames.
To use this you should check out setRenderer function.
globalMonitorBuffer.frames [Table]
key | type | value |
---|---|---|
lastFrame | table | Contains the pixels of the last drawn frame |
newFrame | table | Contains the pixels that are going to be drawn when globalMonitorBuffer.draw is called |
Notes:
- Every index is converted into a string when writing to these tables, so if you want to check a pixel you should use tostring on the x or y.
- Pixels that have the same color as the background and have no text and custom foreground will be nil values, basically only pixels that were written with globalMonitorBuffer.write will be in these tables.
OSSettings [Table]
key | type | value |
---|---|---|
settingsPath | String | Says where the settings need to be saved to keep them on reboot (Default: "/.settings") |
set | Function | Does settings.set() and also settings.save() with path OSSettings.settingsPath |
get | Function | settings.get() |
getNames | Function | settings.getNames() |
unset | Function | Does settings.unset() and also settings.save() with path OSSettings.settingsPath |
So I was tired of having to do settings.set or settings.unset and settings.save to make settings changes "permanent", so i've put them together in one function that has the same name but it's in this table
APLWD [Table]
APLWD means "All Purpose Lib Wireless Drawing" Its a protocol that sends data via rednet. It sends a table that contains every shape, text, bClear or background that was drawn on the host computer to every receiver computer that is connected to it.
key | type | value |
---|---|---|
enabled | Boolean | If set to true APLWD gets enabled |
cacheWritable | Boolean | If set to true APLWD will start to store data in its cache |
clearOnDraw | Boolean | When using APLWD.drawCache() if set to true it will clear the screen before drawing cache |
protocol | String | The name of the protocol used to host a rednet connection (Do not change) |
senderName | String | The prefix of a sender (Do not change) |
receiverName | String | The prefix of a receiver (Do not change) |
isReceiver | Boolean | If set to true then the computer is a receiver |
myName | String | The name of the computer in the rednet network |
senderID | String | The computer ID of the sender |
modemName | String | The name of the modem that is being used |
cache | Table | It holds everything that should be sended to the receivers to make them draw properly |
enable | Function | Sets APLWD.enabled |
broadcastOnLoopClock | Function | Sets globalLoop.APLWDBroadcastOnClock to true |
dontBroadcastOnLoopClock | Function | Sets globalLoop.APLWDBroadcastOnClock to false |
enableClearCacheOnLoopDraw | Function | Sets APLWD.clearOnDraw |
host | Function | Creates a server where receivers can connect to receive data |
connect | Function | Connects to an host to receive data |
close | Function | Closes server or closes connection to server and turns of the modem |
broadcastCache | Function | Broadcasts its cache to all connected computers |
receiveCache | Function | Waits until it receives data from host or times out if specified |
drawCache | Function | Draws APLWD.cache |
clearCache | Function | Clears APLWD.cache |