Skip to content

1.14.4 functions

Clément Vandendaelen edited this page Jul 11, 2020 · 15 revisions

ComputerCraft

For this example we will take this situation : 2020-04-23_19 37 29

tardis = peripheral.wrap("top")

Returns a table of functions, allowing you to call peripheral methods as if they were normal Lua functions. If no peripheral is connected, returns nil. (http://computercraft.info/wiki/Peripheral.wrap)

Every call will damage the Aprioritron subsystem, make sur to read this : https://github.com/LotuxPunk/Handles/wiki/Aprioritron's-subsystem

Now you can do what ever you want !

Get TARDIS Location

local x, y, z = tardis.getLocation()

Get TARDIS current destination

local x, y, z = tardis.getDestination()

Set TARDIS destination

tardis.setDestination(x, y, z)

Set TARDIS dimension destination

tardis.setDimension(id)

id is the number before the dimension when you do tardis.getDimensions()

Set TARDIS destination and dimension destination

tardis.setDestinationAndDimension(x, y, z, id)

id is the number before the dimension when you do tardis.getDimensions()

Get possible TARDIS dimension

local dimensions = tardis.getDimensions()

dimensions is an array of strings with dimension id & dimension name

Start TARDIS Flight

tardis.setFlight(speedValue)

speedValue have to be 0 < speedValue <= 1

Set TARDIS refuel mode

tardis.setRefuel(boolean)

Set TARDIS Speed

tardis.setSpeed(value)

value have to be between 0 & 1

Get Energy of the TARDIS

local double = tardis.getArtronBank()

Get remaining time flight

local seconds = tardis.getTimeLeft()

Set doors status

tardis.setDoors(status)

String value status have to be "CLOSED", "BOTH" or "ONE"

Get doors status

local status = tardis.getDoors()

Get current dimension

local id = tardis.getDimension()

You can find the name of the dimension with getDimensions() and look at the index id

Get current facing

local facing = tardis.getFacing()

Set TARDIS facing

tardis.setFacing(facing)

String value facing have to be "NORTH", "SOUTH", "EAST" or "WEST"

Get life signs in the TARDIS

local count = tardis.getLifeSigns()

Get alarm status

local status = tardis.getAlarm()

Set alarm status

local status = tardis.setAlarm(boolean)

Get handbrake status

local status = tardis.isHandbrakeFree()

Set handbrake status

local status = tardis.setHandbrake(boolean)

Set speed

local speedValue = tardis.setSpeed(value)

Get speed

local speedValue = tardis.getSpeed()