:3
This commit is contained in:
parent
491112768c
commit
68ec37f994
66 changed files with 6591 additions and 10096 deletions
31
computer/27/dismemberer.lua
Normal file
31
computer/27/dismemberer.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
ts = peripheral.wrap("back")
|
||||
|
||||
--[[
|
||||
on the tick where the train
|
||||
was imminent, but was not present.
|
||||
and now is present and imminent:
|
||||
payload sequence
|
||||
]]
|
||||
function ready()
|
||||
wasimminent = isimminent
|
||||
isimminent = ts.isTrainImminent()
|
||||
waspresent = ispresent
|
||||
ispresent = ts.isTrainPresent()
|
||||
if
|
||||
wasimminent and
|
||||
isimminent and
|
||||
(not waspresent) and
|
||||
ispresent
|
||||
then
|
||||
payload()
|
||||
end
|
||||
end
|
||||
function payload()
|
||||
sleep(0.3)
|
||||
if ts.isTrainPresent() then
|
||||
ts.disassemble()
|
||||
sleep(0.3)
|
||||
ts.assemble()
|
||||
end
|
||||
end
|
||||
repeat ready() sleep(0.05) until false
|
2
computer/27/startup.lua
Normal file
2
computer/27/startup.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
rednet.open("top")
|
||||
rednet.host("elevator")
|
Loading…
Add table
Add a link
Reference in a new issue