General
Look at Functions' Home first.
These functions are used to enable and make use of APLWD.
Note: Ender Modems although they are useful, please try to not use them if you can or you could start to get latency on all receiving computers that have a Wireless Modem or an Ender Modem and that are using APLWD.
APLWD.enable
argument | type | info |
---|---|---|
bool | Boolean | Says if you want to either enable or disable APLWD |
This function will set APLWD.enabled to bool
APLWD.broadcastOnLoopClock
This function will set globalLoop.APLWDBroadcastOnClock to true
APLWD.dontBroadcastOnLoopClock
This function will set globalLoop.APLWDBroadcastOnClock to false
APLWD.enableClearCacheOnLoopDraw
argument | type | info |
---|---|---|
bool | Boolean | Says if you want to either enable or disable APLWD |
This function will set globalLoop.APLWDClearCacheOnDraw to bool
APLWD.host
argument | type | info |
---|---|---|
modemName | String | The name of the modem that you want to use (or the side where it's located) |
hostname | String | The name that you want to give to the host computer. (default: tostring(os.getComputerID())) |
This function will host a rednet connection with APLWD.protocol as the protocol and APLWD.senderName..hostname
as the hostname.
Notes:
- APLWD.myName will be updated by the function, and it shouldn't be an empty string anymore.
- If there's another computer that is hosting with name APLWD.myName the command will error your app after closing the modem.
So it's recommended to use IDs (the default value) if you're not making anything that requires a custom name.
APLWD.connect
argument | type | info |
---|---|---|
modemName | String | The name of the modem that you want to use (or the side where it's located) |
senderName | String | The name that you want to give to the receiving computer when connecting to an host. (default: tostring(os.getComputerID())) |
hostname | String | The name of the host that you want to connect to. |
This function will search in APLWD.protocol if there's a computer with hostname APLWD.senderName..hostname
, if there is one then it will store that computer's id into APLWD.senderID (else it will error your app after closing the modem) then it will host a rednet connection with APLWD.protocol as the protocol and APLWD.receiverName..hostname
as the hostname.
Notes:
- APLWD.myName will be updated by the function, and it shouldn't be an empty string anymore.
- If there's another computer that is receiving with name APLWD.myName the command will error your app after closing the modem.
So it's recommended to use IDs (the default value) if you're not making anything that requires a custom name.
APLWD.close
This function will unhost and close any rednet connection that was opened with APLWD if it gives an error it may be because it couldn't store modem's name into APLWD.modemName
APLWD.broadcastCache
This function will broadcast APLWD.cache to all computers connected with protocol APLWD.protocol
APLWD.receiveCache
argument | type | info |
---|---|---|
timeout | Float | Timeout of rednet.receive |
This function will use rednet.receive to get APLWD.cache from protocol APLWD.protocol and filter the message to see if it was received from Computer with ID APLWD.senderID if so it will be setted to APLWD.cache
APLWD.drawCache
This function will use information from APLWD.cache to draw on the screen.
APLWD.clearCache
This function will clear APLWD.cache Table.