×
Create a new article
Write your page title here:
We currently have 277 articles on Waste Of Space Wiki. Type your article name above or create one of the articles listed here!



    Waste Of Space Wiki

    Programming: Difference between revisions

    Content deleted Content added
    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 aan in-depth programming language namedthat '''Pilot.lua'''.allows Pilot.luayou letsto playerswrite and execute software that can manage and manipulate the statesstate of other objects in-game. AsIt is called '''Pilot.lua''' is (a supersetreference ofto [https://luau-langrbx.lua).org/ Luau]As pilot.lua Roblox'is superseta subset off of [https://enrbx.wikipedia.org/wiki/Lua_lua (programming_language)which Lua]is 5.1more widely used across the ''Roblox'' platform) with added built-ins, learning Luaurbx.lua (orfirst atmay leastprovide Luaa better learning 5experience.1) firstCoding wouldallows for intricate logic circuitry to be benificialcrated, which can greatly expand one's possibilities.
    ImportantThe following parts forare core to programingprogramming:
     
    *[[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 <code>"target playername</code>:"<syntaxhighlight lang="lua" line="1">
    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:. These are the following default functions listed.
     
    *<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 a <code>"'''Parts[i]</code>'''" will work too.
     
    *<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 IonRocketionrocket's thrust speed property
    **<code>ClassName</code>, which is simply the name of the object
    *Methods
    **Object:Trigger(), which simply triggers the object
    **Object:Configure({Property=NewValue}), which configures the part to the given dictionary/table
    **Object:Connect, connectswhich ais functionsimilar to anroblox object'sconnections (part.Touched:Connect). An example includes event
    TouchTrigger:Connect("Touched", function() end)
     
    *Events
    **part:Connect("Triggered", function() end)
    Certain parts however will have their own special properties.
    *Screen
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.

    Recent changes

  • Jo857294 • 2 days ago
  • 116.111.185.163 • 15 days ago
  • 116.111.185.163 • 15 days ago
  • 116.111.185.163 • 15 days ago
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies.