:3
This commit is contained in:
		
							parent
							
								
									9b89185c2a
								
							
						
					
					
						commit
						5fe85f414b
					
				
							
								
								
									
										10
									
								
								rOSs.lua
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								rOSs.lua
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -38,16 +38,18 @@ return {
 | 
			
		|||
local ____lualib = require("lualib_bundle")
 | 
			
		||||
local __TS__Class = ____lualib.__TS__Class
 | 
			
		||||
local ____exports = {}
 | 
			
		||||
---
 | 
			
		||||
-- @noSelf *
 | 
			
		||||
____exports.Peripheral = __TS__Class()
 | 
			
		||||
local Peripheral = ____exports.Peripheral
 | 
			
		||||
Peripheral.name = "Peripheral"
 | 
			
		||||
function Peripheral.prototype.____constructor(self)
 | 
			
		||||
end
 | 
			
		||||
function Peripheral.find(self, ty, filter)
 | 
			
		||||
function Peripheral.find(ty, filter)
 | 
			
		||||
    return peripheral.find(ty, filter)
 | 
			
		||||
end
 | 
			
		||||
function Peripheral.findOne(self, ty, filter)
 | 
			
		||||
    local p, _a, _b, _c = table.unpack(____exports.Peripheral:find(ty, filter))
 | 
			
		||||
function Peripheral.findOne(ty, filter)
 | 
			
		||||
    local p, _a, _b, _c = table.unpack(____exports.Peripheral.find(ty, filter))
 | 
			
		||||
    return p
 | 
			
		||||
end
 | 
			
		||||
return ____exports
 | 
			
		||||
| 
						 | 
				
			
			@ -60,7 +62,7 @@ local basalt = ____basalt.default
 | 
			
		|||
local ____computercraft = require("src.computercraft")
 | 
			
		||||
local Peripheral = ____computercraft.Peripheral
 | 
			
		||||
local function main(self)
 | 
			
		||||
    local d = table.unpack(Peripheral:findOne("monitor"))
 | 
			
		||||
    local d = Peripheral.findOne("monitor")
 | 
			
		||||
    local main = basalt.addMonitor()
 | 
			
		||||
    main:setMonitor(d)
 | 
			
		||||
    main:addLabel():setText("uwu")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
 | 
			
		||||
/** @noSelf **/
 | 
			
		||||
export class Peripheral {
 | 
			
		||||
    static find<T extends Peripheral>(ty: string, 
 | 
			
		||||
                filter?: (name: string, wrapped: Peripheral) => boolean
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,8 +3,7 @@ import {Peripheral } from "./computercraft";
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
function main() {
 | 
			
		||||
    const [d]: [Monitor] = Peripheral.findOne("monitor");
 | 
			
		||||
 | 
			
		||||
    const d: Monitor = Peripheral.findOne("monitor");
 | 
			
		||||
    const main = basalt.addMonitor();
 | 
			
		||||
    main.setMonitor(d);
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user