Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
term.setBackgroundColor(colours.black) term.clear() term.setCursorPos(1,1) -- local airshipConfig = textutils.unserialize(fs.open("airshipConfig.txt",'r').readAll()) local airshipName = airshipConfig.airshipName local airshipChannel = tonumber(airshipConfig.airshipChannel) local modem = peripheral.wrap('top') local wiredModem = peripheral.wrap('right') -- local axis = { strafe_x = 0, strafe_y = 0, strafe_z = 0, -- turn_x = 0, turn_y = 0, turn_z = 0 } local last_axis -- local function transmitCommand(command_axes) local airshipTransmission = {'airshipTransmission',airshipName,command_axes} -- modem.transmit(airshipChannel,airshipChannel+1,airshipTransmission) end local function sendMovementCommand(command_axes) if command_axes ~= last_axis then transmitCommand(command_axes) end end -- local temp_axes = axis wiredModem.open(airshipChannel+2) parallel.waitForAll(function () while true do local function handleTransmission(event, modemSide, senderChannel, replyChannel, transmission, senderDistance) if event == 'modem_message' and transmission[1] and transmission[1] == 'airshipTransmission' then if transmission[2] == airshipName then print('Received Airship Command Transmission:',airshipName) -- local command_axes = transmission[3] temp_axes = command_axes end end end local airshipTransmission = handleTransmission(os.pullEvent()) end end, function () while true do sendMovementCommand(temp_axes) last_axis = temp_axes sleep(0.5) end end)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)