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 |
||
(One intermediate revision by one other user not shown) | |||
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 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
|