m
Reverted edits by Yellowman1273 (talk) to last revision by DarkBlueStealth
No edit summary Tags: Reverted Visual edit |
m (Reverted edits by Yellowman1273 (talk) to last revision by DarkBlueStealth) Tags: Rollback Reverted |
||
Line 1:
[[File:ComputerDiagram.png|alt=|thumb|300x300px|Diagram for how to construct a basic computer including a MicroController.]]Waste of Space features
*[[Microcontroller]] - Runs code when triggered by polysilicon if it is powered. This is an essential part, as it is the only way to run code unprivileged. <!-- "..as it is the only way to run code unprivileged" as administrators can use the terminal. -->
Line 6:
*[[Screen]] - Displays user interface objects on its surface (such as TextLabel, ImageLabel, ..). It is one of the most common ways to provide the user with feedback as it is able to display it in a clear, visual way. It can be to a certain extent supplemented with the much easier to program [[Sign|signs]].
*[[Disk]] - Stores values in a [https://create.roblox.com/docs/education/coding-5/intro-to-dictionaries dictionary] format. Can store large amounts of data like code and [[Model Builder|model codes]]. Data stored on a disk is permanent, as opposed to variables on a microcontroller (which are lost when the microcontroller is powered off, or the server is restarted).
*[[EthernetCable]] (Optional) - Extends the range of a port, similarly to how [[Wire|wires]] extend the [[Power and logic|power]] from a [[PowerCell]]. Note: The [[EthernetCable]] needs to be touching the hole on the [[Port]] in order to work.
*(UNSTABLE) [[Router]] (optional) - The router is the [[Antenna]] of [[EthernetCable|ethernet cables]]. It does the same thing as [[EthernetCable|ethernet cables]], only wireless. This is incredibly useful, as it allows for wireless connections, and allows for parts to be connected from across the region. Note that this is ONLY in [https://www.roblox.com/games/4569607361/Waste-Of-Space-UNSTABLE unstable].
Line 18:
*[[TouchScreen]] - A improved version of the [[Screen]], as it allows you to get the X and Y (in offset) of the cursor on the screen.
As an example, the code below is code for a smart turret that takes chat commands and targets players accordingly, with the command
local Gyro = GetPartFromPort(1, "Gyro") -- Gets gyro attached to port 1
local Microphone = GetPartFromPort(2, "Microphone") -- Gets microphone attached to port 2
Line 36 ⟶ 37:
end)
</syntaxhighlight>
There are many functions in Pilot.lua that allow you to interact with other objects
*
*
*
*
▲*<code>GetPort(ID)</code> - Returns a port instance that can be used in other functions. It is only really recommended if your going to do something like <code>port:Connect("Triggered")</code>
▲*<code>GetPartFromPort(ID or Port Instance, ClassName)</code> Returns a part if found directly attached to a port. An example would be GetPartFromPort(2, "Screen")
▲*<code>TriggerPort(ID or Port Instance)</code> - pretty self explanatory, sends a [[Button|trigger signal]] from the given port or port instance
▲*<code>GetPartsFromPort(ID or Port Instance, ClassName)</code> Returns an [https://create.roblox.com/docs/luau/tables array] of different parts attached to the [[Port]]. In order to use, it is recommended to use [https://create.roblox.com/docs/education/coding-5/pairs-and-ipairs ipairs], however, a <code>'''for i =''' number, number do</code> along with <code>Parts[i]</code> will work too.
All objects will contain certain programmable properties and functions. However, all instances will contain the following properties and methods:
*Properties
**Configurable properties, for example an
**
*Methods
**Object:Trigger(), which simply triggers the object
**Object:Configure({Property=NewValue}), which configures the part to the given dictionary/table
**Object:Connect,
TouchTrigger:Connect("Touched", function() end)
*Events
**part:Connect("Triggered", function() end)
Certain parts however will have their own special properties.
*Screen
|