Mini Tardis ComputerCraft 桥接
连接 Mini Tardis 与 CC:Tweaked
自动化你的塔迪斯!
简介
添加了 TARDIS Computer Interface(塔迪斯电脑接口)方块,作为 ComputerCraft 的外设使用。其合成方式如下:

(任何有线调制解调器均可)
使用方法
- 将该方块放置在 Mini Tardis 内部,并像平常一样将其连接到电脑
- 使用
peripheral.wrap(<side>) 或 peripheral.find("minitardis_bridge") 包装该外设
- 在编写塔迪斯脚本时参考方法参考部分
你也可以使用我编写的脚本来自动化塔迪斯
你可以在模组的 GitHub 页面上找到这些脚本,点击页面右侧的 View Source(查看源码)链接:
scripts/tardisServer.lua - 将此脚本放入塔迪斯内的电脑上,将其重命名为 startup.lua。如果有多个玩家游玩,请更改文件顶部的调制解调器频道。
电脑旁边必须有塔迪斯电脑接口;如果需要使用远程功能,则可选地配备末影调制解调器。
scripts/tardisRemote.lua - 将此脚本放入装有末影调制解调器的口袋电脑中,如有需要请在文件中更改频道。
scripts/gpsHost.lua - 使用有线调制解调器和末影调制解调器构建 GPS 星座网络,
在文件顶部填写关于你调制解调器的信息,并设置该星座所在的维度。将脚本重命名为 startup.lua。
方法参考
isLinked() 返回布尔值,指示电脑接口是否位于塔迪斯内
以下所有方法如果在塔迪斯外部调用电脑接口将会报错:
getState() 检查塔迪斯状态并返回以下字符串之一:
booting_up,塔迪斯正在启动中
crashed,塔迪斯已崩溃,需要重启
crashing,塔迪斯正在崩溃过程中
disabled,塔迪斯当前处于断电状态
drifting,塔迪斯正在维度间漂流
flying,塔迪斯正在飞往目的地
landed,塔迪斯处于静止着陆状态
landing,塔迪斯正在降落中
refueling,塔迪斯正在加油
searching_for_landing,塔迪斯即将开始降落
suspended_flight,能量导管在飞行中途被锁定
taking_off,塔迪斯正在起飞
boot() 如果成功则返回 true,从 disabled(断电)状态启动塔迪斯
shutdown() 如果成功则返回 true,从 landed(着陆)或 crashed(崩溃)状态关闭塔迪斯
refuel(boolean) 如果成功则返回 true,设置加油状态
getFuel() 返回 0 到 1000 之间的数字,表示塔迪斯的燃料量
getStability() 返回 0 到 1000 之间的数字,表示塔迪斯的稳定性
getAvailableWorlds() 返回字符串数组,表示塔迪斯能够前往的维度
getCurrentPos() 返回 XYZ 格式的包含三个数字的数组,如果塔迪斯未着陆则报错,返回塔迪斯的当前位置
getCurrentFacing() 返回以下字符串之一,如果塔迪斯未着陆则报错,表示塔迪斯当前的朝向:
north(北)
east(东)
west(西)
south(南)
getCurrentWorld() 返回字符串,表示塔迪斯当前所在的维度
getDestinationPos() 返回 XYZ 格式的包含三个数字的数组,如果目的地未知则报错,返回塔迪斯的当前目的地坐标
getDestinationFacing() 返回罗盘方向字符串,如果目的地未知则报错,表示塔迪斯到达目的地时应朝向的方向
getDestinationWorld() 返回字符串,如果目的地未知则报错,表示塔迪斯尝试飞行的目标维度
resetDestination() 如果成功则返回 true,将目的地重置为塔迪斯当前位置
setDestinationPos(x, y, z) 如果成功则返回 true,如果目的地不可达则报错,将目的地设置为提供的坐标
setDestinationFacing(compass_direction) 如果成功则返回 true,设置塔迪斯到达目的地时的朝向
setDestinationWorld(world_id) 如果成功则返回 true,如果塔迪斯无法进入该维度或尚未通过 Dimensions App(维度应用)发现该维度则报错,设置目的地维度
isDestinationLocked() 返回布尔值,指示目的地是否被锁定
setDestinationLocked(boolean) 如果成功则返回 true,设置目的地锁定的状态
areConduitsUnlocked() 返回布尔值,指示能量导管是否已解锁
setConduitsUnlocked(boolean) 如果成功则返回 true,锁定或解锁能量导管
handbrake(boolean) 如果成功则返回 true,设置手刹状态
getErrorOffsets() 返回偏移量数组,仅在 flying(飞行)状态下可调用,否则报错。每个偏移量是一个包含两个元素的数组。
- 偏移量的第一个元素是南北偏移,1 表示塔迪斯需要向南微调,-1 表示塔迪斯需要向北微调
- 偏移量的第二个元素是东西偏移,1 表示塔迪斯需要向东微调,-1 表示塔迪斯需要向西微调
- 返回示例:
{ {0,0}, {1,-1}, {1,0}, {0,-1} }
getCoordinateScale() 返回 0 到 3 之间的数字,表示定位比例解释器(Localization Scale Interpreter)的值
setCoordinateScale(number 0 to 3) 如果成功则返回 true,设置定位比例解释器的值,也可用于在 flying(飞行)状态下选择哪个偏移量将被微调
nudgeDestination(direction) 如果成功则返回 true,按提供的方向微调目的地,用于在 flying(飞行)状态下调整偏移量。方向可以是以下字符串之一:
north(北)
east(东)
west(西)
south(南)
up(上)
down(下)
getTotalDriftingPhases() 返回数字,仅在 drifting(漂流)状态下可调用,否则报错,表示总共有多少个漂流阶段
getDriftingPhasesComplete() 返回数字,仅在 drifting(漂流)状态下可调用,否则报错,表示已完成多少个漂流阶段
isDriftingPhaseReady() 返回布尔值,仅在 drifting(漂流)状态下可调用,否则报错。当塔迪斯准备好进行相位切换时返回 true,调用 handbrake(true) 以进行相位切换
Mini Tardis ComputerCraft Bridge
Bridges Mini Tardis and CC:Tweaked
Automate your TARDIS!
About
Adds TARDIS Computer Interface block that acts as a peripheral for ComputerCraft, it can be crafted as following:

(Any wired modem will do)
How To Use
- Place the block inside of Mini Tardis and connect it to a computer like you normally would
- Wrap the peripheral using
peripheral.wrap(<side>) or peripheral.find("minitardis_bridge")
- Refer to Method Reference as you script your TARDIS
You can also use scripts I wrote that automate TARDIS
You can find the scripts on GitHub of the mod, View Source link on the right side of the page
scripts/tardisServer.lua - put this script on a computer inside of the TARDIS, rename it to startup.lua,
change modem channels found on top of the file if there's multiple people playing.
Computer must have TARDIS Computer Interface next to it and optionally ender modem if you want to use remote
scripts/tardisRemote.lua - put this script on a pocket computer with ender modem, change channels if needed in the file
scripts/gpsHost.lua - build a GPS constellation with wired modems and ender modems,
put info about your modems on top of the file and set which dimension the constellation is in. Rename script to startup.lua
Method Reference
isLinked() returns boolean, tells if Computer Interface is within TARDIS
All following methods will error if Computer Interface is not inside of a TARDIS
getState() checks TARDIS state and returns one of following strings:
booting_up, TARDIS is currently booting up
crashed, TARDIS has crashed and needs to be rebooted
crashing, TARDIS is in process of crashing
disabled, TARDIS is currently powered off
drifting, TARDIS is drifting between dimensions
flying, TARDIS is flying to the destination
landed, TARDIS is stationary
landing, TARDIS is currently landing
refueling, TARDIS is refueling
searching_for_landing, TARDIS is about to start landing
suspended_flight, energy conduits are locked in middle of flight
taking_off, TARDIS is taking off
boot() returns true if successful, boots TARDIS up from disabled state
shutdown() returns true if successful, shuts TARDIS down from landed or crashed states
refuel(boolean) returns true if successful, sets refueling state
getFuel() returns number 0 to 1000, tells how much fuel TARDIS has
getStability() returns number 0 to 1000, tells how much stability TARDIS has
getAvailableWorlds() returns an array of strings, tells which dimensions TARDIS is able to travel to
getCurrentPos() returns array of 3 numbers as XYZ, errors if TARDIS is not landed, current position of TARDIS
getCurrentFacing() returns one of following strings, errors if TARDIS is not landed, which way TARDIS is currently facing:
getCurrentWorld() returns string, world TARDIS is currently in
getDestinationPos() returns array of 3 numbers as XYZ, errors if destination is unknown, current destination of TARDIS
getDestinationFacing() returns compass direction string, errors if destination is unknown, which way TARDIS should face at the destination
getDestinationWorld() returns string, errors if destination is unknown, world TARDIS will try to fly to
resetDestination() returns true if successful, resets destination back to current TARDIS location
setDestinationPos(x, y, z) returns true if successful, errors if destination is unreachable, sets destination to provided coordinates
setDestinationFacing(compass_direction) returns true if successful, sets which way TARDIS will face at the destination
setDestinationWorld(world_id) returns true if successful, errors if TARDIS can't go in that world or it's not yet discovered with Dimensions app, sets destination world
isDestinationLocked() returns boolean, tells if destination is locked
setDestinationLocked(boolean) returns true if successful, sets lock state of destination lock
areConduitsUnlocked() returns boolean, tells if energy conduits are unlocked
setConduitsUnlocked(boolean) returns true if successful, locks or unlocks energy conduits
handbrake(boolean) returns true if successful, sets handbrake state
getErrorOffsets() returns array of offsets, can only be called during flying state, errors otherwise, each offset is an array of 2 elements.
- First element of an offset is north/south offset, 1 means TARDIS needs to be nudged south, -1 means TARDIS needs to be nudged north
- Second element of an offset is west/east offset, 1 means TARDIS needs to be nudged east, -1 means TARDIS needs to be nudged west
- Return example:
{ {0,0}, {1,-1}, {1,0}, {0,-1} }
getCoordinateScale() returns number 0 to 3, tells the value of Localization Scale Interpreter
setCoordinateScale(number 0 to 3) returns true if successful, sets value of Localization Scale Interpreter, also used to select which offset will be nudged during flying state
nudgeDestination(direction) returns true if successful, nudges destination in provided direction, used for adjusting offsets during flying state. Direction can be one of following strings:
north
east
west
south
up
down
getTotalDriftingPhases() returns number, can only be called during drifting state, errors otherwise, tells how many drifting phases are there
getDriftingPhasesComplete() returns number, can only be called during drifting state, errors otherwise, tells how many drifting phases have been completed
isDriftingPhaseReady() returns boolean, can only be called during drifting state, errors otherwise, is true when TARDIS is ready for phase shift, call handbrake(true) to phase shift
评论 0
登录后参与评分
还没有评论,来抢沙发吧