No edit summary |
mNo edit summary |
||
Line 30:
* [[Telescope]]
==Pilot.lua Wiki==▼
For more information about micron troller coding refer to this: https://github.com/iimurpyh/pilot-lua/wiki
== Microcontroller globals ==
Line 81 ⟶ 82:
Keyboard:Connect("TextInputted", FuncName) --runs the function when keyboard gets input </nowiki> </code>
▲==Pilot.lua Wiki==
==In-game Description==
|
Revision as of 04:12, 16 February 2024
The microcontroller is a part used to run code. When activated with a polysilicon, it will attempt to run its configured code value. Microcontrollers run on Pilot.lua, which is basically just normal rbx.lua with a few things added to interact with the game. Visit the Programming page for more info. Below is a diagram explaining how to place ports and ethernet cables for use with a microcontroller.
- Port
- EthernetCable
- Keyboard
- Microphone
- Disk
- Modem
- Screen
- TouchScreen
- LifeSensor
- Speaker
- Instrument
- Rail
- StarMap
- Telescope
Pilot.lua Wiki
For more information about micron troller coding refer to this: https://github.com/iimurpyh/pilot-lua/wiki
Microcontroller globals
GetPartFromPort()
Gets the first part it finds connected to the port
GetPartFromPort(2, "Switch") --gets the first switch connected to the second port
TriggerPort()
Sends a trigger signal from a port
TriggerPort(5) --sends a trigger signal out of the 5th port
Beep()
Makes the Microcontroller beep
Beep(1) --beeps with a pitch of 1
Parts
:Configure()
Configure can be run on any part. It works like configuring with hammer tool.
local Switch = GetPartFromPort(2, "Switch") --gets the first switch connected to the second port
Switch:Configure( {SwitchValue = true} ) --sets the switch to be on
:Trigger()
Simulates the part receiving a trigger signal
local Anchor = GetPartFromPort(1, "Anchor") --gets the first anchor connected to the first port
Anchor:Trigger() --triggers the anchor
:Connect()
Connects to a part's event, such as a keyboard input.
local Sign = GetPartFromPort(1, "Sign") --gets a sign
local Keyboard = GetPartFromPort(2, "Keyboard") --gets a keyboard
local function FuncName(text) --function that runs when keyboard gets input
text = text:sub(1, -2) --removes the newline from pressing enter to confirm keyboard input
Sign:Configure( { SignText = text } )
end --ends the function
Keyboard:Connect("TextInputted", FuncName) --runs the function when keyboard gets input
In-game Description
"Runs computer programs when triggered and powered. When triggered by an activator polysilicon, it will run code. When triggered by a deactivator polysilicon, it will stop running code. For more information on pilot.lua or the game's programming system, visit the programming tutorial or visit the wiki for the game online. Requires 5 power per second when running. Microcontroller Globals: void Beep(number Pitch) - default pitch 1, max 10 beeps playing concurrently object GetPort(number PortID) - returns port configured with 'PortID' object GetPartFromPort/GetPartsFromPort(object/number Port, string ClassName) - gets a part connected to port 'Port' with classname 'ClassName' void TriggerPort(object/number Port) - sends a trigger signal from the port 'Port' Globals also include all lua globals and all rbx.lua globals, except for roblox script-related or game-related globals such as workspace, game, stats, time, etc. "
Configuration
You can input code or a URL that leads directly to the code.