Examples: ATO Stop Point Transmitter - EternalBlueFlame/Traincraft-5 GitHub Wiki

Examples: ATO Stop Point Transmitter

Requirements

ComputerCraft. You can get the latest 1.7.10 version here.\

Not required for this setup, but for this example, the computer is located right next to the transmitter:

Speed Transmitter under the tracks, and a computer to the side of the speed transmitter

Static Stop Point

A stop point is different from a speed change because it shows where a train should stop. When the distance is below the speed limit, it starts going down until 10km/h where it stays that way until MTC is disable or it passes a speed transmitter that changes the speed.

local atoTransmitter = peripheral.find("ato_stoppoint_transmitter") -- Finds an ATO Stop Point transmitter attached to the computer
local stopX = 54 -- What the stop position X will be
local stopY = 65 -- What the stop position Y will be
local stopZ = 21 -- What the stop position Z will be

atoTransmitter.setX(stopX) -- Sets the X stop position for the passing train to 54
atoTransmitter.setY(stopY) -- Sets the Y stop position for the passing train to 65
atoTransmitter.setZ(stopZ) -- Sets the Z stop position for the passing train to 21

Dynamic Stop Point

In this example, the normal stop point is X 54, Y 65, and Z 21, but if there is a redstone signal on the right side, it will switch to X 65, Y 40, Z 43.

local atoTransmitter = peripheral.find("ato_stoppoint_transmitter") -- Finds an ATO Stop Point transmitter attached to the computer
local stopX = 54 -- What the stop position X will be
local stopY = 65 -- What the stop position Y will be
local stopZ = 21 -- What the stop position Z will be

local otherStopX = 65 -- What the other stop position X will be
local otherStopY = 40 -- What the other stop position Y will be
local otherStopZ = 43 -- What the other stop position Z will be

if redstone.getInput("right") then -- If there is a redstone input on the right side, then..
atoTransmitter.setX(stopX) -- Sets the X stop position for the passing train to 54
atoTransmitter.setY(stopY) -- Sets the Y stop position for the passing train to 65
atoTransmitter.setZ(stopZ) -- Sets the Z stop position for the passing train to 21
else -- If not, then..
atoTransmitter.setX(otherStopX) -- Sets the X stop position for the passing train to 65
atoTransmitter.setY(otherStopY) -- Sets the Y stop position for the passing train to 40
atoTransmitter.setZ(otherStopZ) -- Sets the Z stop position for the passing train to 43

Anything else?

By these examples, (and the comments), you have learned how to set the speed limit of a speed limit block for MTC.

If you still need help, contact PeachMaster#9135 (or ((PeachMaster)chair.ridingEntity)) on the Discord. Happy coding!